Skip to content

Commit

Permalink
bug fixed : Report Weather service defect
Browse files Browse the repository at this point in the history
  • Loading branch information
kcofoni committed Jun 13, 2023
1 parent e7076a9 commit 14534b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions custom_components/netro_watering/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class WeatherConditions(enum.Enum):
vol.Optional(ATTR_WEATHER_WIND_SPEED): vol.All(
vol.Coerce(float), vol.Range(min=0, max=60)
),
vol.Required(ATTR_WEATHER_HUMIDITY): vol.All(
vol.Optional(ATTR_WEATHER_HUMIDITY): vol.All(
vol.Coerce(int), vol.Range(min=0, max=100)
),
vol.Optional(ATTR_WEATHER_PRESSURE): vol.All(
Expand Down Expand Up @@ -398,7 +398,9 @@ async def report_weather(call: ServiceCall) -> None:
"t_max": weather_t_max,
"t_dew": weather_t_dew,
"wind_speed": weather_wind_speed,
"humidity": int(weather_humidity),
"humidity": int(weather_humidity)
if weather_humidity
else weather_humidity,
"pressure": weather_pressure,
},
)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/netro_watering/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"validators==0.20.0"
],
"ssdp": [],
"version": "1.1.1",
"version": "1.1.2",
"zeroconf": []
}

0 comments on commit 14534b6

Please sign in to comment.