Skip to content

Commit e0225bc

Browse files
Fix type comparison for battery state in BatteryNotesBatteryPlusSensor (#4925)
1 parent 41f1dfe commit e0225bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

custom_components/battery_notes/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ async def async_state_reported_listener(
598598
# Don't update if battery level same and it's been < 1 hour
599599
delta = dt_util.utcnow() - self.coordinator.last_wrapped_battery_state_write
600600
if (
601-
self.coordinator.last_reported_level == wrapped_battery_state.state
601+
self.coordinator.last_reported_level == float(wrapped_battery_state.state)
602602
and delta.total_seconds() < STATE_WRITE_INTERVAL_SECONDS
603603
):
604604
self._attr_available = True

0 commit comments

Comments
 (0)