From 0056fcf904a2f1f340ce65c01bd862a27d6c74f8 Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Mon, 1 Apr 2019 19:01:31 +0200 Subject: [PATCH] Make platform setup a coroutine (#22620) * make setup_platform a coroutine * Update homeassistant/components/tellduslive/sensor.py Co-Authored-By: fredrike --- homeassistant/components/daikin/climate.py | 3 ++- homeassistant/components/daikin/sensor.py | 3 ++- homeassistant/components/daikin/switch.py | 3 ++- homeassistant/components/tellduslive/binary_sensor.py | 3 ++- homeassistant/components/tellduslive/cover.py | 3 ++- homeassistant/components/tellduslive/light.py | 3 ++- homeassistant/components/tellduslive/sensor.py | 3 ++- homeassistant/components/tellduslive/switch.py | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/daikin/climate.py b/homeassistant/components/daikin/climate.py index c42f2785576..f348c88daac 100644 --- a/homeassistant/components/daikin/climate.py +++ b/homeassistant/components/daikin/climate.py @@ -53,7 +53,8 @@ HA_ATTR_TO_DAIKIN = { } -def setup_platform(hass, config, add_entities, discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up the Daikin HVAC platform. Can only be called when a user accidentally mentions the platform in their diff --git a/homeassistant/components/daikin/sensor.py b/homeassistant/components/daikin/sensor.py index 5a005e29989..c4f885f5081 100644 --- a/homeassistant/components/daikin/sensor.py +++ b/homeassistant/components/daikin/sensor.py @@ -13,7 +13,8 @@ from .const import ( _LOGGER = logging.getLogger(__name__) -def setup_platform(hass, config, add_entities, discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up the Daikin sensors. Can only be called when a user accidentally mentions the platform in their diff --git a/homeassistant/components/daikin/switch.py b/homeassistant/components/daikin/switch.py index 29159c60fe9..74d03985478 100644 --- a/homeassistant/components/daikin/switch.py +++ b/homeassistant/components/daikin/switch.py @@ -10,7 +10,8 @@ _LOGGER = logging.getLogger(__name__) ZONE_ICON = 'mdi:home-circle' -def setup_platform(hass, config, add_entities, discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up the platform. Can only be called when a user accidentally mentions the platform in their diff --git a/homeassistant/components/tellduslive/binary_sensor.py b/homeassistant/components/tellduslive/binary_sensor.py index fc13f75838a..1e258b90463 100644 --- a/homeassistant/components/tellduslive/binary_sensor.py +++ b/homeassistant/components/tellduslive/binary_sensor.py @@ -10,7 +10,8 @@ from .entry import TelldusLiveEntity _LOGGER = logging.getLogger(__name__) -def setup_platform(hass, config, add_entities, discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up TelldusLive. Can only be called when a user accidentally mentions the platform in their diff --git a/homeassistant/components/tellduslive/cover.py b/homeassistant/components/tellduslive/cover.py index 6dac00ed7a2..b2cb5d9e62e 100644 --- a/homeassistant/components/tellduslive/cover.py +++ b/homeassistant/components/tellduslive/cover.py @@ -10,7 +10,8 @@ from .entry import TelldusLiveEntity _LOGGER = logging.getLogger(__name__) -def setup_platform(hass, config, add_entities, discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up TelldusLive. Can only be called when a user accidentally mentions the platform in their diff --git a/homeassistant/components/tellduslive/light.py b/homeassistant/components/tellduslive/light.py index 3847c66b6cb..abbfd8ac92e 100644 --- a/homeassistant/components/tellduslive/light.py +++ b/homeassistant/components/tellduslive/light.py @@ -11,7 +11,8 @@ from .entry import TelldusLiveEntity _LOGGER = logging.getLogger(__name__) -def setup_platform(hass, config, add_entities, discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up TelldusLive. Can only be called when a user accidentally mentions the platform in their diff --git a/homeassistant/components/tellduslive/sensor.py b/homeassistant/components/tellduslive/sensor.py index 156c11c95a7..8839337590b 100644 --- a/homeassistant/components/tellduslive/sensor.py +++ b/homeassistant/components/tellduslive/sensor.py @@ -42,7 +42,8 @@ SENSOR_TYPES = { } -def setup_platform(hass, config, add_entities, discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up TelldusLive. Can only be called when a user accidentally mentions the platform in their diff --git a/homeassistant/components/tellduslive/switch.py b/homeassistant/components/tellduslive/switch.py index 55275b5b754..888feff41f8 100644 --- a/homeassistant/components/tellduslive/switch.py +++ b/homeassistant/components/tellduslive/switch.py @@ -10,7 +10,8 @@ from .entry import TelldusLiveEntity _LOGGER = logging.getLogger(__name__) -def setup_platform(hass, config, add_entities, discovery_info=None): +async def async_setup_platform( + hass, config, async_add_entities, discovery_info=None): """Old way of setting up TelldusLive. Can only be called when a user accidentally mentions the platform in their