From 6ede1c08ca6c3964ee907871b768d85be61bfe64 Mon Sep 17 00:00:00 2001 From: "Craig J. Ward" Date: Sat, 28 Jan 2017 01:31:36 -0600 Subject: [PATCH] Insteon config (#5595) * only check for devices when not defined in config * lint * performance fix --- .../components/light/insteon_local.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/light/insteon_local.py b/homeassistant/components/light/insteon_local.py index c6a52be2842..c51c7d9d839 100644 --- a/homeassistant/components/light/insteon_local.py +++ b/homeassistant/components/light/insteon_local.py @@ -38,15 +38,17 @@ def setup_platform(hass, config, add_devices, discovery_info=None): setup_light(device_id, conf_lights[device_id], insteonhub, hass, add_devices) - linked = insteonhub.get_linked() + else: + linked = insteonhub.get_linked() - for device_id in linked: - if (linked[device_id]['cat_type'] == 'dimmer' and - device_id not in conf_lights): - request_configuration(device_id, - insteonhub, - linked[device_id]['model_name'] + ' ' + - linked[device_id]['sku'], hass, add_devices) + for device_id in linked: + if (linked[device_id]['cat_type'] == 'dimmer' and + device_id not in conf_lights): + request_configuration(device_id, + insteonhub, + linked[device_id]['model_name'] + ' ' + + linked[device_id]['sku'], + hass, add_devices) def request_configuration(device_id, insteonhub, model, hass,