Skip to content

Commit

Permalink
fix[weather::forecasts]: add forecast data to attributes to load it w…
Browse files Browse the repository at this point in the history
…hile re-start

Actually simulate behaviour HA 2024.3
  • Loading branch information
IATkachenko committed Mar 30, 2024
1 parent a9d801d commit cc5a1a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/yandex_weather/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
ATTR_MIN_FORECAST_TEMPERATURE = "min_forecast_temperature"
ATTR_API_FORECAST_ICONS = "forecast_icons"

ATTR_FORECAST_DATA = "forecast_data"
ATTR_FORECAST_DATA = "forecast" # just to be able to load saved forecast after restart

CONF_UPDATES_PER_DAY = "updates_per_day"
CONF_IMAGE_SOURCE = "image_source"
Expand Down
1 change: 1 addition & 0 deletions custom_components/yandex_weather/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def _handle_coordinator_update(self) -> None:
"wind_gust": self.coordinator.data.get(ATTR_API_WIND_GUST),
"yandex_condition": self.coordinator.data.get(ATTR_API_YA_CONDITION),
"forecast_icons": self.coordinator.data.get(ATTR_API_FORECAST_ICONS),
ATTR_FORECAST_DATA: self._twice_daily_forecast,
}
try:
self._attr_extra_state_attributes["temp_water"] = self.coordinator.data.get(
Expand Down

0 comments on commit cc5a1a4

Please sign in to comment.