@@ -328,8 +328,12 @@ def handle_result(
328328 self .on_update (validated )
329329 return
330330
331- class BatteryNotesBatteryLowBaseSensor (BinarySensorEntity , CoordinatorEntity [BatteryNotesCoordinator ]):
331+
332+ class BatteryNotesBatteryLowBaseSensor (
333+ BinarySensorEntity , CoordinatorEntity [BatteryNotesCoordinator ]
334+ ):
332335 """Low battery binary sensor base."""
336+
333337 _unrecorded_attributes = frozenset (
334338 {
335339 ATTR_BATTERY_LOW_THRESHOLD ,
@@ -345,6 +349,7 @@ def extra_state_attributes(self) -> dict[str, Any] | None:
345349
346350 # Battery related attributes
347351 attrs = {
352+ ATTR_BATTERY_LOW_THRESHOLD : self .coordinator .battery_low_threshold ,
348353 ATTR_BATTERY_QUANTITY : self .coordinator .battery_quantity ,
349354 ATTR_BATTERY_TYPE : self .coordinator .battery_type ,
350355 ATTR_BATTERY_TYPE_AND_QUANTITY : self .coordinator .battery_type_and_quantity ,
@@ -355,6 +360,7 @@ def extra_state_attributes(self) -> dict[str, Any] | None:
355360 attrs .update (super_attrs )
356361 return attrs
357362
363+
358364class BatteryNotesBatteryLowTemplateSensor (
359365 BatteryNotesBatteryLowBaseSensor , RestoreEntity
360366):
@@ -746,7 +752,9 @@ async def async_state_changed_listener(
746752 self .async_write_ha_state ()
747753 return
748754
749- self .coordinator .battery_low_binary_state = wrapped_battery_low_state .state == "on"
755+ self .coordinator .battery_low_binary_state = (
756+ wrapped_battery_low_state .state == "on"
757+ )
750758
751759 await self .coordinator .async_request_refresh ()
752760
@@ -764,7 +772,9 @@ async def _register_entity_id_change_listener(
764772 """Listen for battery entity_id changes and update battery_plus."""
765773
766774 @callback
767- async def _entity_rename_listener (event : Event [er .EventEntityRegistryUpdatedData ]) -> None :
775+ async def _entity_rename_listener (
776+ event : Event [er .EventEntityRegistryUpdatedData ],
777+ ) -> None :
768778 """Handle renaming of the entity."""
769779 new_entity_id = event .data ["entity_id" ]
770780 old_entity_id = event .data .get ("old_entity_id" , None )
0 commit comments