Skip to content

Return command status when setting a config parameter#177

Merged
MartinHjelmare merged 8 commits into
home-assistant-libs:masterfrom
raman325:return_status
Mar 25, 2021
Merged

Return command status when setting a config parameter#177
MartinHjelmare merged 8 commits into
home-assistant-libs:masterfrom
raman325:return_status

Conversation

@raman325
Copy link
Copy Markdown
Contributor

@raman325 raman325 commented Mar 23, 2021

@cgarwood has requested that we have a way to know whether the command failed, was accepted, or was queued when setting a config parameter. This PR adds a status to the return which can be used in HA to get the status.

This should follow #176 so we can apply this to both utility functions

Comment thread zwave_js_server/util/node.py Outdated
Comment thread zwave_js_server/util/node.py
@raman325 raman325 force-pushed the return_status branch 3 times, most recently from 4589b38 to 090fa14 Compare March 24, 2021 16:20
Comment thread test/util/test_node.py Outdated
Comment thread test/util/test_node.py Outdated
Comment thread zwave_js_server/const.py Outdated

ACCEPTED = "accepted"
QUEUED = "queued"
FAILED = "failed"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't seem to use the FAILED enum. Do we still need it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can remove it. I was thinking it would be nice in the future if, for queued messages, we could support an optional callback in the future that returned the result once the message was processed which is why I had added this. But I will remove it for now and we can discuss that separately

raman325 and others added 4 commits March 25, 2021 10:18
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Copy link
Copy Markdown
Contributor

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Looks good!

@MartinHjelmare MartinHjelmare merged commit 8212e1a into home-assistant-libs:master Mar 25, 2021
@raman325 raman325 deleted the return_status branch March 25, 2021 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants