File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
custom_components/battery_notes Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 2424 config_validation as cv ,
2525 device_registry as dr ,
2626 entity_registry as er ,
27+ template ,
2728)
2829from homeassistant .helpers .event import (
2930 EventStateChangedData ,
3233 async_track_template_result ,
3334)
3435
35- from homeassistant .helpers import template
3636from homeassistant .helpers .template import (
3737 Template ,
3838 TemplateStateFromEntityId ,
5151 async_track_entity_registry_updated_event ,
5252)
5353from homeassistant .helpers .reload import async_setup_reload_service
54+ from homeassistant .helpers .restore_state import RestoreEntity
5455
5556from homeassistant .const import (
5657 CONF_NAME ,
@@ -313,7 +314,7 @@ def handle_result(
313314
314315
315316class BatteryNotesBatteryLowTemplateSensor (
316- BinarySensorEntity , CoordinatorEntity [BatteryNotesCoordinator ]
317+ BinarySensorEntity , CoordinatorEntity [BatteryNotesCoordinator ], RestoreEntity
317318):
318319 """Represents a low battery threshold binary sensor."""
319320
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ class BatteryNotesCoordinator(DataUpdateCoordinator):
5858 battery_type : str
5959 battery_quantity : int
6060 battery_low_threshold : int
61- battery_low_template : str
61+ battery_low_template : str | None
6262 wrapped_battery : RegistryEntry
6363 _current_battery_level : str = None
6464 enable_replaced : bool = True
You can’t perform that action at this time.
0 commit comments