From 581a4f82b29a0b2d70a99c12d1aee274ff209708 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 6 Mar 2024 11:46:38 -1000 Subject: [PATCH] Avoid importing counter and proximity integrations in logbook (#112528) --- homeassistant/components/logbook/const.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/logbook/const.py b/homeassistant/components/logbook/const.py index 2d9911117f9..3d4c0b3615f 100644 --- a/homeassistant/components/logbook/const.py +++ b/homeassistant/components/logbook/const.py @@ -2,14 +2,17 @@ from __future__ import annotations from homeassistant.components.automation import EVENT_AUTOMATION_TRIGGERED -from homeassistant.components.counter import DOMAIN as COUNTER_DOMAIN -from homeassistant.components.proximity import DOMAIN as PROXIMITY_DOMAIN from homeassistant.components.script import EVENT_SCRIPT_STARTED from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.const import EVENT_CALL_SERVICE, EVENT_LOGBOOK_ENTRY +# # Domains that are always continuous -ALWAYS_CONTINUOUS_DOMAINS = {COUNTER_DOMAIN, PROXIMITY_DOMAIN} +# +# These are hard coded here to avoid importing +# the entire counter and proximity integrations +# to get the name of the domain. +ALWAYS_CONTINUOUS_DOMAINS = {"counter", "proximity"} # Domains that are continuous if there is a UOM set on the entity CONDITIONALLY_CONTINUOUS_DOMAINS = {SENSOR_DOMAIN}