Skip to content

Commit

Permalink
Merge pull request #71 from iMicknl/cover-up-down
Browse files Browse the repository at this point in the history
up/down as alternatives to open/close
  • Loading branch information
vlebourl authored Jun 18, 2020
2 parents 80ceeea + da3cb20 commit 2e92c2e
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 2e92c2e

Please sign in to comment.