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

[v2] Allow immediate response #69

Merged
merged 4 commits into from
May 8, 2021

Conversation

bhamiltoncx
Copy link
Contributor

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 of SUCCESS when the device attributes have not yet all been reached.

Raghnall and others added 3 commits May 6, 2021 21:13
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.
@bhamiltoncx
Copy link
Contributor Author

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.

Copy link
Owner

@mbudnek mbudnek left a 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?

google-home-community.groovy Outdated Show resolved Hide resolved
@mbudnek
Copy link
Owner

mbudnek commented May 8, 2021

Looks great. Thanks again for the contribution!

@mbudnek mbudnek merged commit 25bccf5 into mbudnek:master May 8, 2021
@bhamiltoncx bhamiltoncx deleted the immediate-response branch May 8, 2021 02:21
@bhamiltoncx
Copy link
Contributor Author

Rock on!

mbudnek added a commit that referenced this pull request May 8, 2021
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.
mbudnek added a commit that referenced this pull request May 8, 2021
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.
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.

None yet

3 participants