Skip to content

Commit

Permalink
Merge branch 'hidden-fix'
Browse files Browse the repository at this point in the history
# Conflicts:
#	custom_components/battery_notes/sensor.py
  • Loading branch information
andrew-codechimp committed Feb 9, 2024
2 parents 52ddc2e + 0787a44 commit 13202a6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions custom_components/battery_notes/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,11 @@ async def _register_entity_id_change_listener(
entity_id: str,
source_entity_id: str,
) -> None:
"""
When the user changes the entity id of the source entity,
we also need to change the battery notes plus config entry to reflect these changes
This method adds the necessary listener and handler to facilitate this
"""
"""Listen for battery entity_id changes and update battery_plus."""

@callback
async def _entity_rename_listener(event: Event) -> None:
"""Handle renaming of the entity"""
"""Handle renaming of the entity."""
old_entity_id = event.data["old_entity_id"]
new_entity_id = event.data[CONF_ENTITY_ID]
_LOGGER.debug(
Expand Down Expand Up @@ -380,7 +376,7 @@ async def _entity_rename_listener(event: Event) -> None:

@callback
def _filter_entity_id(event: Event) -> bool:
"""Only dispatch the listener for update events concerning the source entity"""
"""Only dispatch the listener for update events concerning the source entity."""
return (
event.data["action"] == "update"
and "old_entity_id" in event.data
Expand Down

0 comments on commit 13202a6

Please sign in to comment.