From ce42ad187c169a81d45b77edf7515b59e657862a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 28 Apr 2024 08:14:04 -0500 Subject: [PATCH] Fix unifiprotect delaying shutdown if websocket if offline (#116331) --- homeassistant/components/unifiprotect/data.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/unifiprotect/data.py b/homeassistant/components/unifiprotect/data.py index c0a6d65ff7a..55ddf91d3cb 100644 --- a/homeassistant/components/unifiprotect/data.py +++ b/homeassistant/components/unifiprotect/data.py @@ -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(