From 85ec48ff31a06931b48790bcc6f82c0ca5a99e96 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 2 Mar 2024 11:08:22 -1000 Subject: [PATCH] Import anonymize_data in unifiprotect init to avoid it being imported in the event loop (#112052) Improve anonymize_data in unifiprotect init to avoid it being imported in the event loop --- homeassistant/components/unifiprotect/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/unifiprotect/__init__.py b/homeassistant/components/unifiprotect/__init__.py index 94bd3722cfa..942c533b59e 100644 --- a/homeassistant/components/unifiprotect/__init__.py +++ b/homeassistant/components/unifiprotect/__init__.py @@ -7,6 +7,11 @@ import logging from aiohttp.client_exceptions import ServerDisconnectedError from pyunifiprotect.exceptions import ClientError, NotAuthorized +# Import the test_util.anonymize module from the pyunifiprotect package +# in __init__ to ensure it gets imported in the executor since the +# diagnostics module will not be imported in the executor. +from pyunifiprotect.test_util.anonymize import anonymize_data # noqa: F401 + from homeassistant.config_entries import ConfigEntry from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.core import HomeAssistant