From f35c7be91709b39e1d57afa730509cdecf20cdf2 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 19 Aug 2023 09:45:48 -0500 Subject: [PATCH] Just putting back DELAYED_INTERVAL for reliability. Ran into problems --- src/modules/DetectionSensorModule.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/modules/DetectionSensorModule.cpp b/src/modules/DetectionSensorModule.cpp index c8eb7793b..f1fc26244 100644 --- a/src/modules/DetectionSensorModule.cpp +++ b/src/modules/DetectionSensorModule.cpp @@ -46,10 +46,7 @@ int32_t DetectionSensorModule::runOnce() if ((millis() - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.detection_sensor.minimum_broadcast_secs) && hasDetectionEvent()) { sendDetectionMessage(); - return getConfiguredOrDefaultMs(moduleConfig.detection_sensor.minimum_broadcast_secs < - moduleConfig.detection_sensor.state_broadcast_secs - ? moduleConfig.detection_sensor.minimum_broadcast_secs - : moduleConfig.detection_sensor.state_broadcast_secs); + return DELAYED_INTERVAL; } // Even if we haven't detected an event, broadcast our current state to the mesh on the scheduled interval as a sort // of heartbeat. We only do this if the minimum broadcast interval is greater than zero, otherwise we'll only broadcast state @@ -57,10 +54,7 @@ int32_t DetectionSensorModule::runOnce() else if (moduleConfig.detection_sensor.state_broadcast_secs > 0 && (millis() - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.detection_sensor.state_broadcast_secs)) { sendCurrentStateMessage(); - return getConfiguredOrDefaultMs(moduleConfig.detection_sensor.minimum_broadcast_secs < - moduleConfig.detection_sensor.state_broadcast_secs - ? moduleConfig.detection_sensor.minimum_broadcast_secs - : moduleConfig.detection_sensor.state_broadcast_secs); + return DELAYED_INTERVAL; } return GPIO_POLLING_INTERVAL; }