mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 22:25:13 +02:00
Don't store analytics insights info on entry level (#114429)
This commit is contained in:
committed by
GitHub
parent
eb0aa6bb82
commit
1c151d78a4
@@ -49,9 +49,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
|
||||
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = AnalyticsInsightsData(
|
||||
coordinator=coordinator, names=names
|
||||
)
|
||||
hass.data[DOMAIN] = AnalyticsInsightsData(coordinator=coordinator, names=names)
|
||||
|
||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||
entry.async_on_unload(entry.add_update_listener(update_listener))
|
||||
@@ -62,7 +60,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
"""Unload a config entry."""
|
||||
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
|
||||
hass.data[DOMAIN].pop(entry.entry_id)
|
||||
hass.data.pop(DOMAIN)
|
||||
|
||||
return unload_ok
|
||||
|
||||
|
@@ -65,7 +65,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Initialize the entries."""
|
||||
|
||||
analytics_data: AnalyticsInsightsData = hass.data[DOMAIN][entry.entry_id]
|
||||
analytics_data: AnalyticsInsightsData = hass.data[DOMAIN]
|
||||
coordinator: HomeassistantAnalyticsDataUpdateCoordinator = (
|
||||
analytics_data.coordinator
|
||||
)
|
||||
|
Reference in New Issue
Block a user