Skip to content

Commit

Permalink
Fix is_opening/closing for RTS devices (#464)
Browse files Browse the repository at this point in the history
Co-authored-by: Mick Vleeshouwer <[email protected]>
  • Loading branch information
tetienne and iMicknl authored Jul 14, 2021
1 parent 560db42 commit 847ee29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions custom_components/tahoma/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ async def async_my(self, **_):
@property
def is_opening(self):
"""Return if the cover is opening or not."""

if self.assumed_state:
return None

if any(
execution.get("deviceurl") == self.device.deviceurl
and execution.get("command_name") in COMMANDS_OPEN + COMMANDS_OPEN_TILT
Expand All @@ -338,6 +342,10 @@ def is_opening(self):
@property
def is_closing(self):
"""Return if the cover is closing or not."""

if self.assumed_state:
return None

if any(
execution.get("deviceurl") == self.device.deviceurl
and execution.get("command_name") in COMMANDS_CLOSE + COMMANDS_CLOSE_TILT
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tahoma/tahoma_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def unique_id(self) -> str:
@property
def assumed_state(self) -> bool:
"""Return True if unable to access real state of the entity."""
return self.device.states is None or len(self.device.states) == 0
return not self.device.states

@property
def device_state_attributes(self) -> Dict[str, Any]:
Expand Down

0 comments on commit 847ee29

Please sign in to comment.