Skip to content

Commit 13202a6

Browse files
Merge branch 'hidden-fix'
# Conflicts: # custom_components/battery_notes/sensor.py
2 parents 52ddc2e + 0787a44 commit 13202a6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

custom_components/battery_notes/sensor.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,11 @@ async def _register_entity_id_change_listener(
339339
entity_id: str,
340340
source_entity_id: str,
341341
) -> None:
342-
"""
343-
When the user changes the entity id of the source entity,
344-
we also need to change the battery notes plus config entry to reflect these changes
345-
This method adds the necessary listener and handler to facilitate this
346-
"""
342+
"""Listen for battery entity_id changes and update battery_plus."""
347343

348344
@callback
349345
async def _entity_rename_listener(event: Event) -> None:
350-
"""Handle renaming of the entity"""
346+
"""Handle renaming of the entity."""
351347
old_entity_id = event.data["old_entity_id"]
352348
new_entity_id = event.data[CONF_ENTITY_ID]
353349
_LOGGER.debug(
@@ -380,7 +376,7 @@ async def _entity_rename_listener(event: Event) -> None:
380376

381377
@callback
382378
def _filter_entity_id(event: Event) -> bool:
383-
"""Only dispatch the listener for update events concerning the source entity"""
379+
"""Only dispatch the listener for update events concerning the source entity."""
384380
return (
385381
event.data["action"] == "update"
386382
and "old_entity_id" in event.data

0 commit comments

Comments
 (0)