This commit is contained in:
Home Assistant Version Control
2026-09-09 13:41:09 +00:00
parent 06228b4138
commit 3f5a84f2e5
14 changed files with 76 additions and 65 deletions
+9 -9
View File
@@ -326,6 +326,14 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
except asyncio.CancelledError:
pass
for task in list(hilo.subscriptions):
if task and not task.done():
task.cancel()
try:
await task
except asyncio.CancelledError:
pass
try:
await hilo._api.signalr_devices.disconnect()
except Exception as err:
@@ -337,14 +345,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)
@@ -951,7 +951,7 @@ class Hilo:
async def async_update(self) -> None:
"""Update tarif periodically."""
if self.generate_energy_meters or self.track_unknown_sources:
if self.generate_energy_meters:
self.check_tarif()
if self.track_unknown_sources:
+2 -2
View File
@@ -11,6 +11,6 @@
"documentation": "https://github.com/dvd-dev/hilo",
"iot_class": "cloud_push",
"issue_tracker": "https://github.com/dvd-dev/hilo/issues",
"requirements": ["python-hilo>=2026.3.5"],
"version": "2026.8.3"
"requirements": ["python-hilo>=2026.9.1"],
"version": "2026.9.1"
}