Ryan McGuire 29433cddd7
All checks were successful
Build and Publish / release (push) Successful in 4m6s
support sensor name mapping
2025-03-05 12:53:57 -05:00

13 lines
297 B
Go

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
}