Fix HCSR501 not logging (#1897)

When we move HCSR501data["origin"] = subjectHCSR501toMQTT; to inside the if we must adjust the size check ;-)
This commit is contained in:
Die Peter Pan authored and GitHub committed 2024-02-14 19:08:31 -06:00
1 parent 91b7d53cdd
commit 46160c64d0
1 file changed
+1 -1
+1 -1
View File
@@ -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);
}