From 0c6034b6efdbd6ae2228186a9a6a90dd9400e6bd Mon Sep 17 00:00:00 2001 From: Guy Khmelnitsky <3136012+GuyKh@users.noreply.github.com> Date: Mon, 15 May 2023 12:22:31 +0300 Subject: [PATCH] Fix bad None weather_code (#37) * Fix bad None weather_code * manifest fix --- custom_components/ims/manifest.json | 2 +- custom_components/ims/weather.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/ims/manifest.json b/custom_components/ims/manifest.json index 839fbe1..b1887f7 100644 --- a/custom_components/ims/manifest.json +++ b/custom_components/ims/manifest.json @@ -7,5 +7,5 @@ "iot_class": "cloud_polling", "issue_tracker": "https://github.com/t0mer/ims-custom-component/issues", "requirements": ["weatheril>=0.29.1"], - "version": "0.1.9" + "version": "0.1.9b" } diff --git a/custom_components/ims/weather.py b/custom_components/ims/weather.py index 096b551..e7c0e9c 100644 --- a/custom_components/ims/weather.py +++ b/custom_components/ims/weather.py @@ -290,7 +290,7 @@ def forecast(self): ).isoformat(), ATTR_FORECAST_NATIVE_TEMP: hourly_forecast.temperature, ATTR_FORECAST_NATIVE_TEMP_LOW: entry.minimum_temperature, - ATTR_FORECAST_CONDITION: WEATHER_CODE_TO_CONDITION[str(last_weather_code)], + ATTR_FORECAST_CONDITION: WEATHER_CODE_TO_CONDITION[last_weather_code], ATTR_FORECAST_NATIVE_PRECIPITATION: hourly_forecast.rain, ATTR_FORECAST_WIND_BEARING: WIND_DIRECTIONS[hourly_forecast.wind_direction_id], ATTR_FORECAST_PRECIPITATION_PROBABILITY: hourly_forecast.rain_chance,