diff --git a/custom_components/knmi/weather.py b/custom_components/knmi/weather.py index 44c3e56..40a0604 100644 --- a/custom_components/knmi/weather.py +++ b/custom_components/knmi/weather.py @@ -23,6 +23,7 @@ DOMAIN as SENSOR_DOMAIN, Forecast, WeatherEntity, + WeatherEntityFeature, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( @@ -88,6 +89,7 @@ class KnmiWeather(WeatherEntity): _attr_native_temperature_unit = TEMP_CELSIUS _attr_native_visibility_unit = LENGTH_KILOMETERS _attr_native_wind_speed_unit = SPEED_KILOMETERS_PER_HOUR + _attr_supported_features = WeatherEntityFeature.FORECAST_DAILY def __init__( self, @@ -171,9 +173,8 @@ def native_visibility(self) -> float | None: """Return the visibility in native units.""" return self.coordinator.get_value("zicht", float) - @property - def forecast(self) -> list[Forecast] | None: - """Return the forecast in native units.""" + async def async_forecast_daily(self) -> list[Forecast] | None: + """Return the daily forecast in native units.""" forecast = [] timezone = pytz.timezone(API_TIMEZONE) today = dt.as_utc( @@ -207,7 +208,3 @@ def forecast(self) -> list[Forecast] | None: forecast.append(next_day) return forecast - - async def async_forecast_daily(self) -> list[Forecast] | None: - """Return the daily forecast in native units.""" - return self.forecast diff --git a/hacs.json b/hacs.json index 295430e..04257c7 100644 --- a/hacs.json +++ b/hacs.json @@ -1,5 +1,5 @@ { - "name": "KNMI", - "homeassistant": "2023.8.0", - "render_readme": true + "name": "KNMI", + "homeassistant": "2023.9.0", + "render_readme": true }