Skip to content

Commit a3c5b68

Browse files
Fix rounding
1 parent d83e988 commit a3c5b68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

custom_components/battery_notes/coordinator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def rounded_battery_level(self) -> float:
219219
def _rounded_level(self, value) -> float:
220220
"""Round the level, if preferred."""
221221
if isfloat(value):
222-
return round(float(value), 0 if value else 1)
222+
return round(float(value), None if self._round_battery else 1)
223223
else:
224224
return value
225225

0 commit comments

Comments
 (0)