Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions homeassistant/components/logbook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,11 @@ def humanify(
# Process events
for event in events_batch:
if event.event_type == EVENT_STATE_CHANGED:
if event.domain != SENSOR_DOMAIN:
continue
entity_id = event.entity_id
if entity_id in continuous_sensors:
if (
entity_id in continuous_sensors
or split_entity_id(entity_id)[0] != SENSOR_DOMAIN
):
continue
assert entity_id is not None
continuous_sensors[entity_id] = _is_sensor_continuous(hass, entity_id)
Expand All @@ -378,10 +379,9 @@ def humanify(
for event in events_batch:
if event.event_type == EVENT_STATE_CHANGED:
entity_id = event.entity_id
domain = event.domain
assert entity_id is not None

if domain == SENSOR_DOMAIN and continuous_sensors[entity_id]:
if continuous_sensors.get(entity_id):
# Skip continuous sensors
continue

Expand Down Expand Up @@ -872,14 +872,6 @@ def __init__(
self.time_fired_minute: int = self._row.time_fired.minute
self._event_data_cache = event_data_cache

@property
def domain(self) -> str | None:
"""Return the domain for the state."""
if self._domain is None:
assert self.entity_id is not None
self._domain = split_entity_id(self.entity_id)[0]
return self._domain

@property
def attributes_icon(self) -> str | None:
"""Extract the icon from the decoded attributes or json."""
Expand Down