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

HomeKit: Ignore Garage state command if target state is current state #17453

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions homeassistant/components/homekit/type_covers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ def __init__(self, *args):

def set_state(self, value):
"""Change garage state if call came from HomeKit."""

adrum marked this conversation as resolved.
Show resolved Hide resolved
# Check to make sure the target state is different than current state
current_value = self.char_current_state.get_value()

if (current_value == value):
# We are already in target state so ignore.
_LOGGER.debug('%s: Ingoring set state to %d. Current state is %d', self.entity_id, value, current_value)
adrum marked this conversation as resolved.
Show resolved Hide resolved
return

adrum marked this conversation as resolved.
Show resolved Hide resolved
_LOGGER.debug('%s: Set state to %d', self.entity_id, value)
self.flag_target_state = True

Expand Down