From 20c5f360e344e63c46ec418a64ef5d71ee42c4ac Mon Sep 17 00:00:00 2001 From: Philipp Grimm Date: Thu, 15 Feb 2024 23:25:10 +0100 Subject: [PATCH] debug cleanup entities --- custom_components/eltako/eltako_integration_init.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/eltako/eltako_integration_init.py b/custom_components/eltako/eltako_integration_init.py index 69d9e5b..d49690b 100644 --- a/custom_components/eltako/eltako_integration_init.py +++ b/custom_components/eltako/eltako_integration_init.py @@ -85,7 +85,7 @@ def cleanup_unavailable_entities(hass: HomeAssistant): for e in hass.config_entries.async_entries(): LOGGER.debug(f"CONFIG ENTRIES: entry_id {e.entry_id}, unique_id: {e.unique_id}") - # dr.async_cleanup(hass, device_reg, entity_registry) + dr.async_cleanup(hass, device_reg, entity_registry) async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: @@ -152,14 +152,14 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b await usb_gateway.async_setup() set_gateway_to_hass(hass, usb_gateway) - cleanup_unavailable_entities(hass) - hass.data[DATA_ELTAKO][DATA_ENTITIES] = {} for platform in PLATFORMS: hass.async_create_task( hass.config_entries.async_forward_entry_setup(config_entry, platform) ) + cleanup_unavailable_entities(hass) + return True async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: