diff --git a/custom_components/openevse/sensor.py b/custom_components/openevse/sensor.py index 687b148..2eec261 100644 --- a/custom_components/openevse/sensor.py +++ b/custom_components/openevse/sensor.py @@ -71,17 +71,17 @@ def native_value(self) -> Any: self._state = None if self._type in data.keys(): if self._type == "charge_time_elapsed": - self._state = round(data[self._type] / 60, 2) + self._state = data[self._type] / 60 elif self._type == "usage_total" and isinstance(data[self._type], int): - self._state = round(data[self._type] / 1000, 2) + self._state = data[self._type] / 1000 elif self._type in [ "usage_session", "charging_current", "charging_power", ]: - self._state = round(data[self._type] / 1000, 2) + self._state = data[self._type] / 1000 elif self._type == "charging_voltage": - self._state = round(data[self._type], 0) + self._state = data[self._type] else: self._state = data[self._type] diff --git a/tests/test_sensor.py b/tests/test_sensor.py index dd07b2f..a6e7d4c 100644 --- a/tests/test_sensor.py +++ b/tests/test_sensor.py @@ -46,3 +46,6 @@ async def test_sensors(hass, test_charger, mock_ws_start): state = hass.states.get("sensor.openevse_charge_time_elapsed") assert state assert state.state == "4.1" + state = hass.states.get("sensor.openevse_total_usage") + assert state + assert state.state == "64.582"