Fix issues in 'momentary2nist' and 'toggle2nist' components - #4576
Merged
Merged
Conversation
grandixximo
reviewed
Sep 19, 2026
Sigma1912
force-pushed
the
2nist_comps-fix-issues
branch
from
September 20, 2026 14:56
08c4bb9 to
c3ee68f
Compare
grandixximo
reviewed
Sep 21, 2026
- Both 'momentary2nist' and 'toggle2nist' suffer from a loose pulse_length counter that leads to 'on'-,'off'-signals getting cut short because the counter is not reset properly and counts when idling. Fix: The counter is now reset when the pins are changed and no longer counts when the component is idle. - 'toggle2nist' can endup being desynchronized when the toggle switch is flipped back and forth very fast. Fix: The input pin state is now compared to the state of the device so a switch position disagreeing with the device state will always trigger a change. - Both components now verify a succesful change in the device by comparing to the expected state rather than output pin values that change in idle. - For both components the idle state is now the default branch. - remove unnecessary debounce reset when waiting for device confirmation - set max_pulse_length to a more suitable default value and make it the minimum for toggle2nist - clarification in the description
Sigma1912
force-pushed
the
2nist_comps-fix-issues
branch
from
September 21, 2026 14:24
c3ee68f to
c83e088
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both 'momentary2nist' and 'toggle2nist' suffer from a loose pulse_length counter that leads to 'on'-,'off'-signals getting cut short because the counter is not reset properly and counts when idling. Fix: The counter is now reset when the pins are changed and no longer counts when the component is idle.
'toggle2nist' can endup being desynchronized when the toggle switch is flipped back and forth very fast. Fix: The input pin state is now compared to the state of the device so a switch position disagreeing with the device state will always trigger a change.
Both components now verify a succesful change in the device by comparing to the expected state rather than output pin values that change in idle.
For both components the idle state is now the default branch.