Add separate command and state topics for mqtt lock#29808
Conversation
Allow different command and state topic + different command and state values.
|
Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration ( |
|
Please write the breaking change paragraph so we can copy it directly to the release notes. Briefly describe what has changed and what the user needs to do to cope with the breaking change. |
|
Tests need to be updated and the new config options tested. |
|
I am just looking at this and hope to fix it quickly, thanks for looking at it so quickly |
|
@MartinHjelmare I have updated the breaking change documentation and hope it works as expected, also the pipelines complete now, test cases were updated to reflect the new configuration options and abbreviations for the properties state_locked and state_unlocked were added. Anything else that needs to be done? |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Looks good! One comment.
Allow different command and state topic + different command and state values.
Breaking Change:
Two new properties were introduced with state_locked (default: LOCKED) and state_unlocked (default: UNLOCKED). If you were using the same topic as state_topic as for the command_topic you can reestablish the old behaviour by setting state_locked to LOCK and state_unlocked to UNLOCK.
Effectively this change allows you to distinguish commands and states in two topics with different values.
Description:
Allows to separate command and state topics effectively. The configuration.yaml below results in action payloads to be LOCK / UNLOCK and expects a JSON in the state topic that contains at least a state field, e.g.:
{ "state": "locked" }Related issue (if applicable): fixes #
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#11420
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest.requirements_all.txtby runningpython3 -m script.gen_requirements_all..coveragerc.If the code does not interact with devices: