Async cleanups with new handling and executor (#4234)
This commit is contained in:
parent
ad8645baf4
commit
382ac5c3b5
8 changed files with 15 additions and 17 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue