Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions custom_components/hilo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down