From 6fad42c3a4a168185b153b94df2019acf9fc8293 Mon Sep 17 00:00:00 2001 From: Dan Raper Date: Wed, 27 Dec 2023 23:03:49 +0000 Subject: [PATCH] Fix next slot time showing when no charge in progress (#5) --- custom_components/ohme/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ohme/sensor.py b/custom_components/ohme/sensor.py index 6f52f6c..071ffb8 100644 --- a/custom_components/ohme/sensor.py +++ b/custom_components/ohme/sensor.py @@ -157,7 +157,7 @@ def native_value(self): @callback def _handle_coordinator_update(self) -> None: """Calculate next timeslot. This is a bit slow so we only update on coordinator data update.""" - if self.coordinator.data is None: + if self.coordinator.data is None or self.coordinator.data["mode"] == "DISCONNECTED": self._state = None else: self._state = charge_graph_next_slot(