From 496a975c582552e4b6dd048a02a10891aa3e6c7b Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 15 Aug 2023 17:17:35 +0200 Subject: [PATCH] Set _attr_condition in WeatherEntity (#98459) --- homeassistant/components/buienradar/weather.py | 1 - homeassistant/components/smhi/weather.py | 1 - homeassistant/components/weather/__init__.py | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/homeassistant/components/buienradar/weather.py b/homeassistant/components/buienradar/weather.py index aedfcf82aea..cdb8adf1dac 100644 --- a/homeassistant/components/buienradar/weather.py +++ b/homeassistant/components/buienradar/weather.py @@ -136,7 +136,6 @@ class BrWeather(WeatherEntity): self._stationname = config.get(CONF_NAME, "Buienradar") self._attr_name = self._stationname or f"BR {'(unknown station)'}" - self._attr_condition = None self._attr_unique_id = "{:2.6f}{:2.6f}".format( coordinates[CONF_LATITUDE], coordinates[CONF_LONGITUDE] ) diff --git a/homeassistant/components/smhi/weather.py b/homeassistant/components/smhi/weather.py index e62d236c819..db5d7287ccd 100644 --- a/homeassistant/components/smhi/weather.py +++ b/homeassistant/components/smhi/weather.py @@ -149,7 +149,6 @@ class SmhiWeather(WeatherEntity): name=name, configuration_url="http://opendata.smhi.se/apidocs/metfcst/parameters.html", ) - self._attr_condition = None self._attr_native_temperature = None @property diff --git a/homeassistant/components/weather/__init__.py b/homeassistant/components/weather/__init__.py index 635c4948285..74671f0c1df 100644 --- a/homeassistant/components/weather/__init__.py +++ b/homeassistant/components/weather/__init__.py @@ -227,7 +227,7 @@ class WeatherEntity(Entity, PostInit): """ABC for weather data.""" entity_description: WeatherEntityDescription - _attr_condition: str | None + _attr_condition: str | None = None # _attr_forecast is deprecated, implement async_forecast_daily, # async_forecast_hourly or async_forecast_twice daily instead _attr_forecast: list[Forecast] | None = None