Fix unifiprotect delaying shutdown if websocket if offline (#116331)

This commit is contained in:
J. Nick Koston 2024-04-28 08:14:04 -05:00 committed by GitHub
parent 3f0c0a72db
commit ce42ad187c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -269,7 +269,12 @@ class ProtectData:
this will be a no-op. If the websocket is disconnected,
this will trigger a reconnect and refresh.
"""
self._hass.async_create_task(self.async_refresh(), eager_start=True)
self._entry.async_create_background_task(
self._hass,
self.async_refresh(),
name=f"{DOMAIN} {self._entry.title} refresh",
eager_start=True,
)
@callback
def async_subscribe_device_id(