Skip to content

Commit

Permalink
Remove deprecated filter code
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Oct 9, 2024
1 parent 0d780aa commit 3aa171a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions custom_components/battery_notes/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,13 +432,9 @@ async def _entity_rename_listener(event: Event) -> None:
)

@callback
def _filter_entity_id(event_data: Mapping[str, Any] | Event) -> bool:
def _filter_entity_id(event_data: Mapping[str, Any]) -> bool:
"""Only dispatch the listener for update events concerning the source entity."""

# Breaking change in 2024.4.0, check for Event for versions prior to this
if type(event_data) is Event: # pylint: disable=unidiomatic-typecheck
event_data = event_data.data

return (
event_data["action"] == "update"
and "old_entity_id" in event_data
Expand Down

0 comments on commit 3aa171a

Please sign in to comment.