From a1d4dcf643c36cf37c04c7715a667785aa66732a Mon Sep 17 00:00:00 2001 From: "Brian (bex) Exelbierd" Date: Thu, 13 Nov 2025 09:57:57 +0100 Subject: [PATCH 1/2] Fix Unknown battery_low attribute as false This fix aligns the actual return values from querying the battery_low atribute with the UI display --- custom_components/battery_notes/coordinator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/battery_notes/coordinator.py b/custom_components/battery_notes/coordinator.py index 85220952..fd50d35c 100644 --- a/custom_components/battery_notes/coordinator.py +++ b/custom_components/battery_notes/coordinator.py @@ -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: From c3edabc1b5b4d9dec6a72503d26b5d00d561097a Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Thu, 13 Nov 2025 10:36:46 +0000 Subject: [PATCH 2/2] Update battery_low property to allow None type --- custom_components/battery_notes/coordinator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/battery_notes/coordinator.py b/custom_components/battery_notes/coordinator.py index fd50d35c..dd58db5a 100644 --- a/custom_components/battery_notes/coordinator.py +++ b/custom_components/battery_notes/coordinator.py @@ -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