File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
custom_components/battery_notes Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -339,15 +339,11 @@ async def _register_entity_id_change_listener(
339
339
entity_id : str ,
340
340
source_entity_id : str ,
341
341
) -> 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."""
347
343
348
344
@callback
349
345
async def _entity_rename_listener (event : Event ) -> None :
350
- """Handle renaming of the entity"""
346
+ """Handle renaming of the entity. """
351
347
old_entity_id = event .data ["old_entity_id" ]
352
348
new_entity_id = event .data [CONF_ENTITY_ID ]
353
349
_LOGGER .debug (
@@ -380,7 +376,7 @@ async def _entity_rename_listener(event: Event) -> None:
380
376
381
377
@callback
382
378
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. """
384
380
return (
385
381
event .data ["action" ] == "update"
386
382
and "old_entity_id" in event .data
You can’t perform that action at this time.
0 commit comments