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 Paulus Schoutsen
parent 624eed4b83
commit 1309fc5eda

View File

@ -269,7 +269,12 @@ class ProtectData:
this will be a no-op. If the websocket is disconnected, this will be a no-op. If the websocket is disconnected,
this will trigger a reconnect and refresh. 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 @callback
def async_subscribe_device_id( def async_subscribe_device_id(