diff --git a/custom_components/weather_template/weather.py b/custom_components/weather_template/weather.py index 830afc6..edf5b5d 100644 --- a/custom_components/weather_template/weather.py +++ b/custom_components/weather_template/weather.py @@ -220,14 +220,18 @@ def _updater(value): return _updater def _update_forecast(self, forecast): - try: - forecast_json = json.loads(forecast) - except ValueError: - _LOGGER.error( - "Could not parse forecast from template response: %s", forecast - ) - self._forecast = None - return + if type(forecast) == str: + try: + forecast_json = json.loads(forecast) + except ValueError: + _LOGGER.error( + "Could not parse forecast from template response: %s", forecast + ) + self._forecast = None + return + else: + forecast_json = forecast + self._forecast = forecast_json def _add_float_template_attribute( diff --git a/hacs.json b/hacs.json index 23ff673..f6b07ab 100644 --- a/hacs.json +++ b/hacs.json @@ -1,4 +1,4 @@ { "name": "Weather Template", - "homeassistant": "0.115.0" + "homeassistant": "0.118.0" }