From 93afc2b255502aff84b0ae2b7183b058e0108bdb Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Wed, 23 Sep 2026 13:05:08 +0200 Subject: [PATCH] Update __init__.py --- custom_components/reveil/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/custom_components/reveil/__init__.py b/custom_components/reveil/__init__.py index 192de60..fb7661f 100644 --- a/custom_components/reveil/__init__.py +++ b/custom_components/reveil/__init__.py @@ -150,11 +150,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ReveilConfigEntry) -> bo await manager.async_load() entry.runtime_data = manager - await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) - manager.async_start() entry.async_on_unload(manager.async_stop) - entry.async_on_unload(entry.add_update_listener(_async_reload_on_update)) + + hass.data.setdefault(DOMAIN, {}) if len(hass.data[DOMAIN]) == 1: www_path = Path(__file__).parent / "www" @@ -164,6 +163,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ReveilConfigEntry) -> bo StaticPathConfig(f"/api/{DOMAIN}/reveil-card.js", str(card_file), cache_headers=False) ]) + await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) + entry.async_on_unload(entry.add_update_listener(_async_reload_on_update)) + return True