-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DetectionSensor: more flexible triggering #4780
DetectionSensor: more flexible triggering #4780
Conversation
f5a5855
to
0a52631
Compare
0a52631
to
be01c18
Compare
Should be ready for some preliminary code review, still needs some testing on my end (ETA: ~24h) |
@augustozanellato looks great! I added some feedback about using the new Throttle utility method for time windowing. Once those changes are in, I think we're good to merge. |
Changes addressed!
|
3b2f488
to
ed4527c
Compare
I missed a |
Failed jobs seem to be caused by ci flakyness (and probably issues on github's end), a restart should fix them |
This PR introduces support for more triggering types in detection sensor, specifically:
LOGIC_LOW
: same as previous behavior withdetection_triggered_high
set to false: a "detection message" is sent everyminimum_broadcast_secs
if pin is low;LOGIC_HIGH
: same as previous behavior withdetection_triggered_high
set to true: a "detection message" is sent everyminimum_broadcast_secs
if pin is high;FALLING_EDGE
: a single "detection message" is sent when pin goes from high to low;RISING_EDGE
: a single "detection message" is sent when pin goes from low to high;EITHER_EDGE_ACTIVE_LOW
: a single "detection message" is sent when pin goes from high to low, another single "state message" is sent when pin goes from low to high;EITHER_EDGE_ACTIVE_HIGH
: a single "detection message" is sent when pin goes from low to high, another single "state message" is sent when pin goes from high to low;Fixes #4753.
Depends on meshtastic/protobufs#582 to be merged first.