Proxy updates for AWN
All checks were successful
Build and Publish / release (push) Successful in 2m53s

This commit is contained in:
2025-01-12 17:49:54 -05:00
parent 19823ea08f
commit e8fbacfe6d
3 changed files with 35 additions and 4 deletions

View File

@@ -79,5 +79,20 @@ func updateToAWNParams(update *weather.WeatherUpdate) *url.Values {
weather.SetURLVal(params, "windgustmph", update.WindGustMPH)
weather.SetURLVal(params, "windspeedmph", update.WindSpeedMPH)
weather.SetURLVal(params, "maxdailygust", update.MaxDailyGust)
// Batteries
for _, status := range update.Batteries {
switch status.Component {
case BattOutdoorSensor:
weather.SetURLVal(params, "battin", status.Status)
case BattIndoorSensor:
weather.SetURLVal(params, "battout", status.Status)
case BattRainSensor:
weather.SetURLVal(params, "battrain", status.Status)
case BattCO2Sensor:
weather.SetURLVal(params, "batt_co2", status.Status)
}
}
return params
}