Skip to content
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

[mqtt.homeassistant] Avoid improperly delivered triggers #17584

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Oct 17, 2024

If multiple DeviceTrigger components share a topic, and each has a payload value configured, only messages matching that payload should be delivered to the corresponding channel.

The DeviceTrigger already sets up the TextValue with the appropriate (single) enumeration of allowed value(s). But the mqtt.generic binding processes trigger before any value processing is done. So do the most basic of processing, to make sure the value is pertinent.

if multiple DeviceTrigger components share a topic, and each
has a payload value configured, only messages matching that
payload should be delivered to the corresponding channel

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@ccutrer ccutrer requested a review from antroids as a code owner October 17, 2024 22:59
@ccutrer ccutrer added the bug An unexpected problem or unintended behavior of an add-on label Oct 17, 2024
@ccutrer ccutrer requested a review from lsiepel October 17, 2024 23:21
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@lsiepel lsiepel changed the title [mqtt.homeassistant] avoid improperly delivered triggers [mqtt.homeassistant] Avoid improperly delivered triggers Oct 18, 2024
@lsiepel lsiepel merged commit 5cd76ee into openhab:main Oct 18, 2024
5 checks passed
@lsiepel lsiepel added this to the 4.3 milestone Oct 18, 2024
@ccutrer ccutrer deleted the mqtt-homeassistant-spurious-device_trigger-triggers branch October 18, 2024 13:31
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Oct 18, 2024
if multiple DeviceTrigger components share a topic, and each
has a payload value configured, only messages matching that
payload should be delivered to the corresponding channel

Signed-off-by: Cody Cutrer <cody@cutrer.us>
KaaNee pushed a commit to KaaNee/openhab-addons that referenced this pull request Nov 8, 2024
if multiple DeviceTrigger components share a topic, and each
has a payload value configured, only messages matching that
payload should be delivered to the corresponding channel

Signed-off-by: Cody Cutrer <cody@cutrer.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants