mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 14:45:09 +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()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
|
|
||||||
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = AnalyticsInsightsData(
|
hass.data[DOMAIN] = AnalyticsInsightsData(coordinator=coordinator, names=names)
|
||||||
coordinator=coordinator, names=names
|
|
||||||
)
|
|
||||||
|
|
||||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||||
entry.async_on_unload(entry.add_update_listener(update_listener))
|
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:
|
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Unload a config entry."""
|
"""Unload a config entry."""
|
||||||
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
|
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
|
return unload_ok
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ async def async_setup_entry(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the entries."""
|
"""Initialize the entries."""
|
||||||
|
|
||||||
analytics_data: AnalyticsInsightsData = hass.data[DOMAIN][entry.entry_id]
|
analytics_data: AnalyticsInsightsData = hass.data[DOMAIN]
|
||||||
coordinator: HomeassistantAnalyticsDataUpdateCoordinator = (
|
coordinator: HomeassistantAnalyticsDataUpdateCoordinator = (
|
||||||
analytics_data.coordinator
|
analytics_data.coordinator
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user