Rename add_devices to async_add_devices like dev guide (#3938)

pull/3940/head
Pascal Vizeli 2016-10-19 00:35:22 +02:00 committed by GitHub
parent 947c1efca2
commit 754e93ff6a
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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