Adding support for Lutron covers (#11602)

* Adding support for Lutron Radio RA2 shades as cover components.

* Adding initial version of the Lutron shades component.

* Fixed line-length violation detected by Hound.
This commit is contained in:
Nicko van Someren 2018-01-13 11:11:20 -07:00 committed by Pascal Vizeli
parent 2e08766cb1
commit 3e43f4e58e
2 changed files with 82 additions and 3 deletions

View file

@ -37,7 +37,7 @@ def setup(hass, base_config):
from pylutron import Lutron
hass.data[LUTRON_CONTROLLER] = None
hass.data[LUTRON_DEVICES] = {'light': []}
hass.data[LUTRON_DEVICES] = {'light': [], 'cover': []}
config = base_config.get(DOMAIN)
hass.data[LUTRON_CONTROLLER] = Lutron(
@ -50,9 +50,12 @@ def setup(hass, base_config):
# Sort our devices into types
for area in hass.data[LUTRON_CONTROLLER].areas:
for output in area.outputs:
hass.data[LUTRON_DEVICES]['light'].append((area.name, output))
if output.type == 'SYSTEM_SHADE':
hass.data[LUTRON_DEVICES]['cover'].append((area.name, output))
else:
hass.data[LUTRON_DEVICES]['light'].append((area.name, output))
for component in ('light',):
for component in ('light', 'cover'):
discovery.load_platform(hass, component, DOMAIN, None, base_config)
return True