From eb6017e16c3c24404ca97af29458519c0baed535 Mon Sep 17 00:00:00 2001 From: kfcook <809694+kfcook@users.noreply.github.com> Date: Wed, 9 Aug 2017 00:57:32 -0400 Subject: [PATCH] added support for setting/getting position of lutron caseta covers (#8898) --- homeassistant/components/cover/lutron_caseta.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/cover/lutron_caseta.py b/homeassistant/components/cover/lutron_caseta.py index 6857aaebf9b..648dba98ca6 100644 --- a/homeassistant/components/cover/lutron_caseta.py +++ b/homeassistant/components/cover/lutron_caseta.py @@ -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)