added support for setting/getting position of lutron caseta covers (#8898)

This commit is contained in:
kfcook 2017-08-09 00:57:32 -04:00 committed by Pascal Vizeli
parent 19ee3c42b6
commit eb6017e16c

View File

@ -8,11 +8,10 @@ import logging
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']
@ -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)