Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into add_climate
Browse files Browse the repository at this point in the history
  • Loading branch information
vlebourl committed Jun 18, 2020
2 parents 07776a7 + 2e92c2e commit 9a9df63
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions custom_components/tahoma/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,20 @@ def icon(self):

def open_cover(self, **kwargs):
"""Open the cover."""
self.apply_action("open")

if "open" in self.tahoma_device.command_definitions:
return self.apply_action("open")

if "up" in self.tahoma_device.command_definitions:
return self.apply_action("open")

def close_cover(self, **kwargs):
"""Close the cover."""
self.apply_action("close")
if "close" in self.tahoma_device.command_definitions:
return self.apply_action("close")

if "down" in self.tahoma_device.command_definitions:
return self.apply_action("down")

def stop_cover(self, **kwargs):
"""Stop the cover."""
Expand Down Expand Up @@ -328,7 +337,10 @@ def supported_features(self):
):
supported_features |= SUPPORT_SET_POSITION

if "open" in self.tahoma_device.command_definitions:
if (
"open" in self.tahoma_device.command_definitions
or "up" in self.tahoma_device.command_definitions
):
supported_features |= SUPPORT_OPEN

if (
Expand All @@ -338,7 +350,10 @@ def supported_features(self):
):
supported_features |= SUPPORT_STOP

if "close" in self.tahoma_device.command_definitions:
if (
"close" in self.tahoma_device.command_definitions
or "down" in self.tahoma_device.command_definitions
):
supported_features |= SUPPORT_CLOSE

return supported_features

0 comments on commit 9a9df63

Please sign in to comment.