Removing asyncio.coroutine syntax from some components (#12507)

* Removing asyncio.coroutine syntax (first steps)

* merge conflict

* fixed small bug

* pylint
This commit is contained in:
Julius Mittenzwei 2018-02-24 19:24:33 +01:00 committed by Paulus Schoutsen
parent c076b805e7
commit 3713dfe139
17 changed files with 140 additions and 199 deletions

View file

@ -4,7 +4,6 @@ Support for KNX/IP sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.knx/
"""
import asyncio
import voluptuous as vol
@ -28,8 +27,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
async def async_setup_platform(hass, config, async_add_devices,
discovery_info=None):
"""Set up sensor(s) for KNX platform."""
if discovery_info is not None:
async_add_devices_discovery(hass, discovery_info, async_add_devices)
@ -72,11 +71,10 @@ class KNXSensor(Entity):
@callback
def async_register_callbacks(self):
"""Register callbacks to update hass after device was changed."""
@asyncio.coroutine
def after_update_callback(device):
async def after_update_callback(device):
"""Call after device was updated."""
# pylint: disable=unused-argument
yield from self.async_update_ha_state()
await self.async_update_ha_state()
self.device.register_device_updated_cb(after_update_callback)
@property