Fix dhcp delaying shutdown (#112670)

This commit is contained in:
J. Nick Koston 2024-03-07 18:37:43 -10:00 committed by GitHub
parent c101eb5001
commit d40bd0f6c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -316,7 +316,9 @@ class NetworkWatcher(WatcherBase):
"""Start a new discovery task if one is not running."""
if self._discover_task and not self._discover_task.done():
return
self._discover_task = self.hass.async_create_task(self.async_discover())
self._discover_task = self.hass.async_create_background_task(
self.async_discover(), name="dhcp discovery", eager_start=True
)
async def async_discover(self) -> None:
"""Process discovery."""