Async syntax 5, light & lock & remote & scene & telegram & helpers (#17019)

This commit is contained in:
cdce8p 2018-10-01 08:56:50 +02:00 committed by Paulus Schoutsen
parent 9e4c8f45d6
commit 3b5e5cbcd6
28 changed files with 112 additions and 195 deletions

View file

@ -4,7 +4,6 @@ Support for Insteon lights via PowerLinc Modem.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/light.insteon/
"""
import asyncio
import logging
from homeassistant.components.insteon import InsteonEntity
@ -18,9 +17,8 @@ DEPENDENCIES = ['insteon']
MAX_BRIGHTNESS = 255
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the Insteon component."""
insteon_modem = hass.data['insteon'].get('modem')
@ -55,8 +53,7 @@ class InsteonDimmerDevice(InsteonEntity, Light):
"""Flag supported features."""
return SUPPORT_BRIGHTNESS
@asyncio.coroutine
def async_turn_on(self, **kwargs):
async def async_turn_on(self, **kwargs):
"""Turn device on."""
if ATTR_BRIGHTNESS in kwargs:
brightness = int(kwargs[ATTR_BRIGHTNESS])
@ -64,7 +61,6 @@ class InsteonDimmerDevice(InsteonEntity, Light):
else:
self._insteon_device_state.on()
@asyncio.coroutine
def async_turn_off(self, **kwargs):
async def async_turn_off(self, **kwargs):
"""Turn device off."""
self._insteon_device_state.off()