Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions custom_components/battery_notes/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def last_reported_level(self, value: float):
self.async_update_device_config(device_id=self.device_id, data=entry)

@property
def battery_low(self) -> bool:
def battery_low(self) -> bool | None:
"""Check if battery low against threshold."""
if self.battery_low_template:
return self.battery_low_template_state
Expand All @@ -725,10 +725,12 @@ def battery_low(self) -> bool:
return bool(
float(self.current_battery_level) < self.battery_low_threshold
)
else:
return None
elif self.wrapped_battery_low:
return self.battery_low_binary_state

return False
return None

@property
def rounded_battery_level(self) -> float:
Expand Down
Loading