File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
custom_components/battery_notes Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ async def async_state_changed_listener(
272
272
273
273
if isfloat (wrapped_battery_state .state ):
274
274
if self .round_battery :
275
- battery_level = int ( wrapped_battery_state .state )
275
+ battery_level = round ( float ( wrapped_battery_state .state ), 0 )
276
276
else :
277
277
battery_level = round (float (wrapped_battery_state .state ), 1 )
278
278
else :
Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ def async_state_changed_listener(
321
321
self ._attr_available = True
322
322
323
323
if self .round_battery :
324
- self ._attr_native_value = int ( wrapped_battery_state .state )
324
+ self ._attr_native_value = round ( float ( wrapped_battery_state .state ), 0 )
325
325
else :
326
326
self ._attr_native_value = round (float (wrapped_battery_state .state ), 1 )
327
327
You can’t perform that action at this time.
0 commit comments