From 754e93ff6ae11c9457ec98bf665dc24bdccf5639 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 19 Oct 2016 00:35:22 +0200 Subject: [PATCH] Rename add_devices to async_add_devices like dev guide (#3938) --- homeassistant/components/binary_sensor/template.py | 4 ++-- homeassistant/components/sensor/template.py | 4 ++-- homeassistant/components/switch/template.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/binary_sensor/template.py b/homeassistant/components/binary_sensor/template.py index 98d98930c05..365b29eb308 100644 --- a/homeassistant/components/binary_sensor/template.py +++ b/homeassistant/components/binary_sensor/template.py @@ -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 diff --git a/homeassistant/components/sensor/template.py b/homeassistant/components/sensor/template.py index 7e72a2406f6..600d188bdc0 100644 --- a/homeassistant/components/sensor/template.py +++ b/homeassistant/components/sensor/template.py @@ -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 diff --git a/homeassistant/components/switch/template.py b/homeassistant/components/switch/template.py index 75d18a28d53..2bac825b5b4 100644 --- a/homeassistant/components/switch/template.py +++ b/homeassistant/components/switch/template.py @@ -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