upgrade to new pylutron_caseta with TLS (#10286)
* upgrade to new pylutron with TLS * rename configuration options * change more methods to coroutines * use async_add_devices
This commit is contained in:
1 parent
9bfdff0be1
commit
e7dc96397c
6 files changed
+63
-34
No files matched your search
@@ -4,6 +4,7 @@ Support for Lutron Caseta scenes.
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/scene.lutron_caseta/
|
||||
"""
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from homeassistant.components.lutron_caseta import LUTRON_CASETA_SMARTBRIDGE
|
||||
@@ -14,7 +15,8 @@ _LOGGER = logging.getLogger(__name__)
|
||||
DEPENDENCIES = ['lutron_caseta']
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the Lutron Caseta lights."""
|
||||
devs = []
|
||||
bridge = hass.data[LUTRON_CASETA_SMARTBRIDGE]
|
||||
@@ -23,7 +25,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
dev = LutronCasetaScene(scenes[scene], bridge)
|
||||
devs.append(dev)
|
||||
|
||||
add_devices(devs, True)
|
||||
async_add_devices(devs, True)
|
||||
|
||||
|
||||
class LutronCasetaScene(Scene):
|
||||
@@ -50,6 +52,7 @@ class LutronCasetaScene(Scene):
|
||||
"""There is no way of detecting if a scene is active (yet)."""
|
||||
return False
|
||||
|
||||
def activate(self, **kwargs):
|
||||
@asyncio.coroutine
|
||||
def async_activate(self, **kwargs):
|
||||
"""Activate the scene."""
|
||||
self._bridge.activate_scene(self._scene_id)
|
||||
Reference in new issue
Block a user