Rename add_devices to async_add_devices like dev guide (#3938)
parent
947c1efca2
commit
754e93ff6a
|
@ -36,7 +36,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Setup template binary sensors."""
|
||||
sensors = []
|
||||
|
||||
|
@ -63,7 +63,7 @@ def async_setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
_LOGGER.error('No sensors added')
|
||||
return False
|
||||
|
||||
hass.loop.create_task(add_devices(sensors))
|
||||
hass.loop.create_task(async_add_devices(sensors))
|
||||
return True
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
|
||||
@asyncio.coroutine
|
||||
# pylint: disable=unused-argument
|
||||
def async_setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Setup the template sensors."""
|
||||
sensors = []
|
||||
|
||||
|
@ -61,7 +61,7 @@ def async_setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
_LOGGER.error("No sensors added")
|
||||
return False
|
||||
|
||||
hass.loop.create_task(add_devices(sensors))
|
||||
hass.loop.create_task(async_add_devices(sensors))
|
||||
return True
|
||||
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
|
||||
@asyncio.coroutine
|
||||
# pylint: disable=unused-argument
|
||||
def async_setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Setup the Template switch."""
|
||||
switches = []
|
||||
|
||||
|
@ -70,7 +70,7 @@ def async_setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
_LOGGER.error("No switches added")
|
||||
return False
|
||||
|
||||
hass.loop.create_task(add_devices(switches))
|
||||
hass.loop.create_task(async_add_devices(switches))
|
||||
return True
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue