New detection sensor trigger type value

This commit is contained in:
Ben Meadors 2024-09-25 07:01:15 -05:00
parent d1138d51e5
commit a7c379961a
2 changed files with 2 additions and 2 deletions

View File

@ -472,7 +472,7 @@ void NodeDB::installDefaultModuleConfig()
moduleConfig.has_detection_sensor = true;
moduleConfig.detection_sensor.enabled = false;
moduleConfig.detection_sensor.detection_triggered_high = true;
moduleConfig.detection_sensor.detection_trigger_type = meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_LOGIC_HIGH;
moduleConfig.detection_sensor.minimum_broadcast_secs = 45;
moduleConfig.has_ambient_lighting = true;

View File

@ -108,5 +108,5 @@ bool DetectionSensorModule::hasDetectionEvent()
{
bool currentState = digitalRead(moduleConfig.detection_sensor.monitor_pin);
// LOG_DEBUG("Detection Sensor Module: Current state: %i\n", currentState);
return moduleConfig.detection_sensor.detection_triggered_high ? currentState : !currentState;
return moduleConfig.detection_sensor.detection_trigger_type ? currentState : !currentState;
}