support sensor name mapping
All checks were successful
Build and Publish / release (push) Successful in 4m6s

This commit is contained in:
2025-03-05 12:53:57 -05:00
parent f98a4cf348
commit 29433cddd7
8 changed files with 231 additions and 60 deletions

View File

@ -0,0 +1,12 @@
package config
// If the weather-station has a mapping, returns the new
// name for the sensor
func (ws *WeatherStation) MapSensor(sensor string) string {
for name, replacement := range ws.SensorMappings {
if name == sensor && replacement != "" {
return replacement
}
}
return sensor
}