Skip to content

Commit

Permalink
Fix HCSR501 not logging (#1897)
Browse files Browse the repository at this point in the history
When we move HCSR501data["origin"] = subjectHCSR501toMQTT; to inside the if we must adjust the size check ;-)
  • Loading branch information
diepeterpan committed Feb 15, 2024
1 parent 91b7d53 commit 46160c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main/ZsensorHCSR501.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void MeasureHCSR501() {
# ifdef HCSR501_LED_NOTIFY_GPIO
digitalWrite(HCSR501_LED_NOTIFY_GPIO, pirState == HCSR501_LED_ON);
# endif
if (HCSR501data.size() > 1) {
if (HCSR501data.size() > 0) {
HCSR501data["origin"] = subjectHCSR501toMQTT;
handleJsonEnqueue(HCSR501data);
}
Expand Down

0 comments on commit 46160c6

Please sign in to comment.