Skip to content

Commit 26b2d88

Browse files
Fixed floating point decimal issue on Daily energy
1 parent 1bc4894 commit 26b2d88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

custom_components/panasonic_cc/sensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ def name(self):
125125
def state(self):
126126
"""Return the state of the sensor."""
127127
if self._device_attribute == ATTR_DAILY_ENERGY:
128-
return self._api.daily_energy
128+
return round(self._api.daily_energy,2)
129129
if self._device_attribute == ATTR_CURRENT_POWER:
130-
return self._api.current_power
130+
return round(self._api.current_power,2)
131131
return None
132132

133133
@property

0 commit comments

Comments
 (0)