Skip to content

Commit

Permalink
Fix for switching WLED off when in nighttime only mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek committed Dec 11, 2022
1 parent f66d091 commit 6bb1587
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class PIRsensorSwitch : public Usermod
if (offTimerStart > 0 && millis() - offTimerStart > m_switchOffDelay) {
offTimerStart = 0;
if (enabled == true) {
if (!m_mqttOnly && (!m_nightTimeOnly || (m_nightTimeOnly && !isDayTime()))) switchStrip(false);
if (!m_mqttOnly && (!m_nightTimeOnly || (m_nightTimeOnly && !isDayTime()) || PIRtriggered)) switchStrip(false);
else if (NotifyUpdateMode != CALL_MODE_NO_NOTIFY) updateInterfaces(CALL_MODE_WS_SEND);
publishMqtt("off");
}
Expand Down

0 comments on commit 6bb1587

Please sign in to comment.