Avoid importing counter and proximity integrations in logbook (#112528)

pull/112289/head^2
J. Nick Koston 2024-03-06 11:46:38 -10:00 committed by GitHub
parent 675b1a392b
commit 581a4f82b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 3 deletions

View File

@ -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}