Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit e218f8b

Browse files
committed
Fix none issue with session energy usage
1 parent 13b60d0 commit e218f8b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

custom_components/ohme/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Component constants"""
22
DOMAIN = "ohme"
33
USER_AGENT = "dan-r-homeassistant-ohme"
4-
INTEGRATION_VERSION = "0.6.1"
4+
INTEGRATION_VERSION = "0.6.2"
55
CONFIG_VERSION = 1
66
ENTITY_TYPES = ["sensor", "binary_sensor", "switch", "button", "number", "time"]
77

custom_components/ohme/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def _handle_coordinator_update(self) -> None:
293293
new_state = self.coordinator.data['batterySoc']['wh']
294294

295295
# Let the state reset to 0, but not drop otherwise
296-
if new_state <= 0:
296+
if not new_state or new_state <= 0:
297297
self._state = 0
298298
else:
299299
self._state = max(0, self._state or 0, new_state)

0 commit comments

Comments
 (0)