Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lingering timer in freedns #92572

Merged
merged 2 commits into from
May 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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

Expand Down