14 files
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user