Enhanced behavior in HomeKit scenes if desired TargetDoorState is already set #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.