From 3775219a9a51e5b0986e8c479957fffdc426a818 Mon Sep 17 00:00:00 2001 From: "Ian C." <108159253+ic-dev21@users.noreply.github.com> Date: Sat, 5 Sep 2026 13:17:02 -0400 Subject: [PATCH] Remove session close on integration unload Per HA's guidelines, we aren't supposed to own the session lifecycle and should not be closing it manually. HA is supposed to close this gracefully in the background. --- custom_components/hilo/__init__.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/custom_components/hilo/__init__.py b/custom_components/hilo/__init__.py index 9ec483a1..9a49fe63 100644 --- a/custom_components/hilo/__init__.py +++ b/custom_components/hilo/__init__.py @@ -337,14 +337,6 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) if unload_ok: - try: - if hasattr(hilo, "_api") and hilo._api and hasattr(hilo._api, "session"): - if hilo._api.session and not hilo._api.session.closed: - await hilo._api.session.close() - LOG.debug("Session closed") - except Exception as err: - LOG.error("Error closing session: %s", err) - LOG.debug("Hilo Integration unloaded") hass.data[DOMAIN].pop(entry.entry_id)