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.
This commit is contained in:
guilhermebera 2020-10-14 01:07:20 -03:00 committed by GitHub
parent 13f18492ad
commit fb6b2cbfa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,7 +99,9 @@ class PIRsensorSwitch : public Usermod {
*/ */
bool handleOffTimer() { bool handleOffTimer() {
if (m_offTimerStart > 0 && millis() - m_offTimerStart > m_switchOffDelay) { if (m_offTimerStart > 0 && millis() - m_offTimerStart > m_switchOffDelay) {
if (m_PIRenabled == true){
switchStrip(false); switchStrip(false);
}
m_offTimerStart = 0; m_offTimerStart = 0;
return true; return true;
} }