Fix lingering timer in iaqualink (#92856)

pull/92973/head
epenet 2023-05-11 07:55:36 +01:00 committed by GitHub
parent 2c79adad5e
commit 0cc3e8200c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -3,6 +3,7 @@ from __future__ import annotations
import asyncio import asyncio
from collections.abc import Awaitable, Callable, Coroutine from collections.abc import Awaitable, Callable, Coroutine
from datetime import datetime
from functools import wraps from functools import wraps
import logging import logging
from typing import Any, Concatenate, ParamSpec, TypeVar from typing import Any, Concatenate, ParamSpec, TypeVar
@ -139,7 +140,7 @@ async def async_setup_entry( # noqa: C901
await hass.config_entries.async_forward_entry_setups(entry, platforms) await hass.config_entries.async_forward_entry_setups(entry, platforms)
async def _async_systems_update(now): async def _async_systems_update(_: datetime) -> None:
"""Refresh internal state for all systems.""" """Refresh internal state for all systems."""
for system in systems: for system in systems:
prev = system.online prev = system.online
@ -161,7 +162,9 @@ async def async_setup_entry( # noqa: C901
async_dispatcher_send(hass, DOMAIN) async_dispatcher_send(hass, DOMAIN)
async_track_time_interval(hass, _async_systems_update, UPDATE_INTERVAL) entry.async_on_unload(
async_track_time_interval(hass, _async_systems_update, UPDATE_INTERVAL)
)
return True return True