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
Add OZW node config parameters websocket commands #40527
Add OZW node config parameters websocket commands #40527
Conversation
Fair, and to be honest I have not talked to cgarwood about this, I assumed it was intended to be added in the future and wanted to give it a headstart so I could learn about the integration. I will pause on this from now until he responds. BTW, I also planned to add API endpoints to set, clear, and get usercodes for locks, but I will hold off until I hear back |
This was next on my list for the config panel but I haven't started on it yet, so having the backend in place already helps a ton 😃 |
Great! I was thinking some more about this and thought maybe we should pull the logic into a single method that then both the service and WS API could call. That should reduce the maintenance required over the backend for this. You ok with me submitting similar changes for usercodes in a separate PR then? I can start working on that after I finish cleaning this one up. |
Yeah, that would be great. We could probably do the same combined logic with the set_usercode function as it makes sense to have it available as a service for automations too. |
…ile references in the right place
01fa8d0
to
48aba1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@cgarwood can we merge here? |
Actually looks like I made a mistake with the BitSet implementation as it expects a bool, not 0 or 1: https://github.com/OpenZWave/qt-openzwave/blob/master/docs/MQTT.md#setvalue. I will pull that out of this PR and submit a fix for |
The BitSet value is also a list/array of dicts. The |
The way I had implemented it, it will support multiple bits as a dict: I can switch this to a list of dicts instead if we want to it to match what qt-openzwave expects, I just thought this implementation was more convenient to use in cases where a user wants to call the service |
Actually I will go ahead and change it to a list of dict's because it makes |
OK. I don't quite understand, but the MQTT value sent to ozwdaemon must be a list/array of dicts, it can't be a single dict. |
Yeah the bitset implementation needs more work |
this has been resolved. I can either wait until the upstream PR (cgarwood/python-openzwave-mqtt#95) gets merged and a new patch version gets released to reintroduce the changes to support BitSet here, or I can submit a separate PR. The only change is adding the bitset value input to the WS API and service call schemas |
Went ahead and re-introduced bitset support since the upstream PR was merged and the version was bumped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Proposed change
I added two new websocket commands that can retrieve and set config parameters for a given node, with the idea being that someone with frontend experience could extend the OZW config panel to include a more friendly UI for displaying the available parameters and updating them as needed.
TODO:
Documentation PR: home-assistant/home-assistant.io#14793
Type of change
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: