From 72616d23ccb5483dcde28183faebb58808f78df6 Mon Sep 17 00:00:00 2001 From: Seb Ruiz Date: Sun, 13 Feb 2022 09:53:08 +1100 Subject: [PATCH] Fix change mode event mode check --- custom_components/bhyve/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/bhyve/switch.py b/custom_components/bhyve/switch.py index d34a0e1..84754c0 100644 --- a/custom_components/bhyve/switch.py +++ b/custom_components/bhyve/switch.py @@ -482,7 +482,7 @@ def _on_ws_data(self, data): event = data.get("event") if event in (EVENT_DEVICE_IDLE, EVENT_WATERING_COMPLETE) or ( - event == EVENT_CHANGE_MODE and event.get("mode") in ("off", "auto") + event == EVENT_CHANGE_MODE and data.get("mode") in ("off", "auto") ): self._is_on = False self._set_watering_started(None)