From f7cbb29cb8f30c857886e195f1f955f627e729b5 Mon Sep 17 00:00:00 2001 From: Tor Inge Redalen Date: Tue, 20 Sep 2022 20:44:24 +0200 Subject: [PATCH] check if data for probability_of_precipitation exists --- custom_components/met_next_6_hours_forecast/weather.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/met_next_6_hours_forecast/weather.py b/custom_components/met_next_6_hours_forecast/weather.py index 59ca285..e0a6d22 100755 --- a/custom_components/met_next_6_hours_forecast/weather.py +++ b/custom_components/met_next_6_hours_forecast/weather.py @@ -183,7 +183,9 @@ async def async_update(self): native_precipitation=details["precipitation_amount"], precipitation_probability=details[ "probability_of_precipitation" - ], + ] + if "probability_of_precipitation" in details + else None, datetime=time, condition=condition, native_pressure=current["air_pressure_at_sea_level"],