From fb6b2cbfa25932d60e6c3ed31fbd1db707cc303b Mon Sep 17 00:00:00 2001 From: guilhermebera <62566010+guilhermebera@users.noreply.github.com> Date: Wed, 14 Oct 2020 01:07:20 -0300 Subject: [PATCH] Update usermod_PIR_sensor_switch.h Current: If I disable PIR after it switch strip on, it'll switch off by timer. Update: If I disable PIR after it switch strip on, it'll keep strip on. --- usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h | 4 +++- 1 file changed, 3 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 6d71a426..e87147a1 100644 --- a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h +++ b/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h @@ -99,7 +99,9 @@ class PIRsensorSwitch : public Usermod { */ bool handleOffTimer() { if (m_offTimerStart > 0 && millis() - m_offTimerStart > m_switchOffDelay) { - switchStrip(false); + if (m_PIRenabled == true){ + switchStrip(false); + } m_offTimerStart = 0; return true; }