From f9e35370c0e84176b01eeb481fcbf2c640db457b Mon Sep 17 00:00:00 2001 From: Daniel Raper Date: Wed, 27 Dec 2023 23:01:16 +0000 Subject: [PATCH] Fix next slot time showing when no charge in progress --- 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(