Skip to content

Commit

Permalink
Fix is_opening/is_closing for RTS covers (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetienne authored Jun 29, 2021
1 parent 60f0766 commit c467aa4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions custom_components/tahoma/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,12 @@ def is_opening(self):
):
return True

is_moving = self.device.states[CORE_MOVING_STATE].value
current_closure = self.device.states[CORE_CLOSURE_STATE]
target_closure = self.device.states[CORE_TARGET_CLOSURE_STATE]
is_moving = self.device.states.get(CORE_MOVING_STATE)
current_closure = self.device.states.get(CORE_CLOSURE_STATE)
target_closure = self.device.states.get(CORE_TARGET_CLOSURE_STATE)
return (
is_moving
and is_moving.value
and current_closure
and target_closure
and current_closure.value > target_closure.value
Expand All @@ -344,11 +345,12 @@ def is_closing(self):
):
return True

is_moving = self.device.states.get(CORE_MOVING_STATE).value
current_closure = self.device.states[CORE_CLOSURE_STATE]
target_closure = self.device.states[CORE_TARGET_CLOSURE_STATE]
is_moving = self.device.states.get(CORE_MOVING_STATE)
current_closure = self.device.states.get(CORE_CLOSURE_STATE)
target_closure = self.device.states.get(CORE_TARGET_CLOSURE_STATE)
return (
is_moving
and is_moving.value
and current_closure
and target_closure
and current_closure.value < target_closure.value
Expand Down

0 comments on commit c467aa4

Please sign in to comment.