-
Notifications
You must be signed in to change notification settings - Fork 24
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
[v2] Allow immediate response #69
Conversation
Allow immediate responses to google - does not wait for device to enter new state.
Update immediateResponse to require less checks and be easier to remove when response handler is updated with intent response instead of status response.
…abled. Return PENDING instead of SUCCESS if device state does not reach desired value within timeout. Change timeout to 1000 ms when immediate response enabled.
BTW, I tested this with switches, dimmers, locks, fans, and shades. I have a few other device types I can test but the basics seem to work. |
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 for the contribution! These changes look great. I don't think the immediateReponse
setting is necessary, but if you do want to keep it can you add something to README.md describing what it does? Also, can you please update the version number in packageManifest.json to 0.30.0?
…anifest.json to 0.30.0
Looks great. Thanks again for the contribution! |
Rock on! |
The Toggles trait is unique in that its command executor method calls the executeCommand_OnOff method to do its actual work. #69 recently changed the return value of the command executors but missed this one case. This restores Toggles to full functionality.
The Toggles trait is unique in that its command executor method calls the executeCommand_OnOff method to do its actual work. #69 recently changed the return value of the command executors but missed this one case. This restores Toggles to full functionality.
This is an update on top of #42 and includes the commits from that PR in this one.
In this PR, I update each execute handler to return both the attributes to await and the new assumed states of the device.
I also changed the logic to keep the poll for the attributes to await when immediate response is enabled, but shorten the poll from 5000 ms to 1000 ms.
For both immediate response and the previous behavior, we now return
PENDING
instead ofSUCCESS
when the device attributes have not yet all been reached.