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

Enhanced behavior in HomeKit scenes if desired TargetDoorState is already set #29

Merged
merged 2 commits into from
Dec 19, 2022

Conversation

HerrTimD
Copy link
Contributor

I ran into issues using my garage door in HomeKit scenes. Specifically, I noticed that, when the garage door is closed and the scene would call for the garage to be closed, setting the scene would fail and homebridge would log this error:

[18/12/2022, 12:43:53] [Garage] [API] An error occurred sending command CloseDoor to door Garage; Request failed with status code 403

It would appear that the Genie API responds with HTTP/403 when the desired state equals the current state. If API calls fail in the context of a HomeKit scene, the entire scene fails.

This PR proposes testing and logging for this condition when the characteristic is changed from HomeKit, and dropping the request. Bolting from the method early results in the scene to be successfully set.

Bolt from method to change the TargetDoorState characteristic, if and only if current TargetDoorState and requested TargetDoorState are identical.
@derek-miller
Copy link
Owner

You need to run npm run fmt to fix the lint errors before I can merge.

I have seen that failed scene thing and haven't spent the time to figure out why. I hope this fixes mine as well. Thanks!

My bad for not running `npm run fmt`.
@HerrTimD
Copy link
Contributor Author

Crumbs! Ran npm run fmt and committed the changes. Yes, hope this fixes all scenes.

Thanks for maintaining this plugin!

@derek-miller derek-miller merged commit 5fffa7f into derek-miller:master Dec 19, 2022
@derek-miller
Copy link
Owner

Release in v2.5.2

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.

2 participants