From 73f99b5e22b5283b9874537ea98a63ec7c065562 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Mon, 27 Dec 2021 16:13:59 +0100 Subject: [PATCH] Bugfix for restoring previous LED state. --- usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h b/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h index 4846c2fe4..99ce209ad 100644 --- a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h +++ b/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h @@ -118,7 +118,8 @@ private: */ void switchStrip(bool switchOn) { - if (m_offOnly && bri && (switchOn || (!PIRtriggered && !switchOn))) return; + if (m_offOnly && bri && (switchOn || (!PIRtriggered && !switchOn))) return; //if lights on and off only, do nothing + if (PIRtriggered && switchOn) return; //if already on and triggered before, do nothing PIRtriggered = switchOn; if (switchOn) { if (m_onPreset) {