Skip to content

Commit

Permalink
fix: prepare for event signature changes is 2024.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Mar 20, 2024
1 parent 6be2658 commit 64ee1e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/powercalc/sensor.py
Expand Up @@ -434,9 +434,9 @@ def _filter_entity_id(event: Mapping[str, Any] | Event) -> bool:
if type(event) is Event: # Intentionally avoid `isinstance` because it's slow and we trust `Event` is not subclassed
event = event.data
return (
event.data["action"] == "update"
and "old_entity_id" in event.data
and event.data["old_entity_id"] == source_entity_id
event["action"] == "update"
and "old_entity_id" in event
and event["old_entity_id"] == source_entity_id
)

hass.bus.async_listen(
Expand Down

0 comments on commit 64ee1e6

Please sign in to comment.