mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Fix lingering timer in freedns (#92572)
* Fix lingering timer in freedns * type hint
This commit is contained in:
parent
19dcc8c88f
commit
176820d665
@ -1,6 +1,6 @@
|
|||||||
"""Integrate with FreeDNS Dynamic DNS service at freedns.afraid.org."""
|
"""Integrate with FreeDNS Dynamic DNS service at freedns.afraid.org."""
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import timedelta
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
@ -53,11 +53,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
if result is False:
|
if result is False:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
async def update_domain_callback(now):
|
async def update_domain_callback(now: datetime) -> None:
|
||||||
"""Update the FreeDNS entry."""
|
"""Update the FreeDNS entry."""
|
||||||
await _update_freedns(hass, session, url, auth_token)
|
await _update_freedns(hass, session, url, auth_token)
|
||||||
|
|
||||||
async_track_time_interval(hass, update_domain_callback, update_interval)
|
async_track_time_interval(
|
||||||
|
hass, update_domain_callback, update_interval, cancel_on_shutdown=True
|
||||||
|
)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user