From c27a526f5be39efeca94a96f1859d2507adeef81 Mon Sep 17 00:00:00 2001 From: David McNett Date: Mon, 3 Apr 2017 02:01:53 -0500 Subject: [PATCH] Eliminate needless async_add_job invocation of async_add_devices (#6864) --- homeassistant/components/binary_sensor/insteon_plm.py | 2 +- homeassistant/components/light/insteon_plm.py | 2 +- homeassistant/components/light/lifx.py | 2 +- homeassistant/components/switch/insteon_plm.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/binary_sensor/insteon_plm.py b/homeassistant/components/binary_sensor/insteon_plm.py index f6c8d9edbd1..03cc7e6bd9b 100644 --- a/homeassistant/components/binary_sensor/insteon_plm.py +++ b/homeassistant/components/binary_sensor/insteon_plm.py @@ -32,7 +32,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): InsteonPLMBinarySensorDevice(hass, plm, address, name) ) - hass.async_add_job(async_add_devices(device_list)) + async_add_devices(device_list) class InsteonPLMBinarySensorDevice(BinarySensorDevice): diff --git a/homeassistant/components/light/insteon_plm.py b/homeassistant/components/light/insteon_plm.py index 2d043a9f985..2cd22cf6d4d 100644 --- a/homeassistant/components/light/insteon_plm.py +++ b/homeassistant/components/light/insteon_plm.py @@ -36,7 +36,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): InsteonPLMDimmerDevice(hass, plm, address, name, dimmable) ) - hass.async_add_job(async_add_devices(device_list)) + async_add_devices(device_list) class InsteonPLMDimmerDevice(Light): diff --git a/homeassistant/components/light/lifx.py b/homeassistant/components/light/lifx.py index d3b084b3b94..76a2a9e907d 100644 --- a/homeassistant/components/light/lifx.py +++ b/homeassistant/components/light/lifx.py @@ -95,7 +95,7 @@ class LIFXManager(object): entity = LIFXLight(device) _LOGGER.debug("%s register READY", entity.ipaddr) self.entities[device.mac_addr] = entity - self.hass.async_add_job(self.async_add_devices, [entity]) + self.async_add_devices([entity]) @callback def unregister(self, device): diff --git a/homeassistant/components/switch/insteon_plm.py b/homeassistant/components/switch/insteon_plm.py index 646e6d4416b..ee192b82be4 100644 --- a/homeassistant/components/switch/insteon_plm.py +++ b/homeassistant/components/switch/insteon_plm.py @@ -32,7 +32,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): InsteonPLMSwitchDevice(hass, plm, address, name) ) - hass.async_add_job(async_add_devices(device_list)) + async_add_devices(device_list) class InsteonPLMSwitchDevice(SwitchDevice):