mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +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."""
|
||||
import asyncio
|
||||
from datetime import timedelta
|
||||
from datetime import datetime, timedelta
|
||||
import logging
|
||||
|
||||
import aiohttp
|
||||
@ -53,11 +53,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
if result is False:
|
||||
return False
|
||||
|
||||
async def update_domain_callback(now):
|
||||
async def update_domain_callback(now: datetime) -> None:
|
||||
"""Update the FreeDNS entry."""
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user