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

Added support for setting/getting position of Lutron Caseta Covers #8898

Merged
Merged
Changes from all commits
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
10 changes: 7 additions & 3 deletions homeassistant/components/cover/lutron_caseta.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@


from homeassistant.components.cover import (
CoverDevice, SUPPORT_OPEN, SUPPORT_CLOSE)
CoverDevice, SUPPORT_OPEN, SUPPORT_CLOSE, SUPPORT_SET_POSITION)
from homeassistant.components.lutron_caseta import (
LUTRON_CASETA_SMARTBRIDGE, LutronCasetaDevice)


_LOGGER = logging.getLogger(__name__)

DEPENDENCIES = ['lutron_caseta']
Expand All @@ -38,13 +37,18 @@ class LutronCasetaCover(LutronCasetaDevice, CoverDevice):
@property
def supported_features(self):
"""Flag supported features."""
return SUPPORT_OPEN | SUPPORT_CLOSE
return SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_SET_POSITION

@property
def is_closed(self):
"""Return if the cover is closed."""
return self._state["current_state"] < 1

@property
def current_cover_position(self):
"""Return the current position of cover."""
return self._state["current_state"]

def close_cover(self):
"""Close the cover."""
self._smartbridge.set_value(self._device_id, 0)
Expand Down