Async cleanups with new handling and executor (#4234)

This commit is contained in:
Pascal Vizeli 2016-11-06 01:01:03 +01:00 committed by GitHub
parent ad8645baf4
commit 382ac5c3b5
8 changed files with 15 additions and 17 deletions

View file

@ -36,8 +36,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
minimum = config.get(CONF_MINIMUM)
maximum = config.get(CONF_MAXIMUM)
hass.loop.create_task(async_add_devices(
[RandomSensor(name, minimum, maximum)], True))
yield from async_add_devices([RandomSensor(name, minimum, maximum)], True)
return True