Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix logic/syntax bugs with switch statements matching multiple values #24

Merged
merged 1 commit into from
Sep 12, 2021

Conversation

drakkhen
Copy link
Contributor

After a bit of tinkering, I figured out the cause of Issues #18, #22, and #23. The OR (||)
conditional for multiple case values was not working as intended -- they only matched the first
value in each case instead of any of the values separated by ||.

Converting those to use the fall-through feature of the switch statement resolved the problems.

After a bit of tinkering, I figured out the cause of Issues trympet#18, trympet#22, and trympet#23.  The OR (||)
conditional for multiple case values was not working as intended -- they only matched the first
value in each case instead of any of the values separated by ||.

Converting those to use the fall-through feature of the switch statement resolved the problems.
@trympet
Copy link
Owner

trympet commented Sep 12, 2021

Good observation. Thanks for the PR!

@trympet trympet merged commit 8dfebdf into trympet:master Sep 12, 2021
@drakkhen drakkhen deleted the fix-broken-switch-cases branch September 12, 2021 20:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contact Sensor State Characteristic Warnings (keeps coming in my log file) contact sensor state
2 participants