mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
only check for devices when not defined in config (#5490)
* only check for devices when not defined in config * lint
This commit is contained in:
parent
74989f7941
commit
a89a4f39dc
@ -22,7 +22,7 @@ DOMAIN = 'switch'
|
|||||||
INSTEON_LOCAL_SWITCH_CONF = 'insteon_local_switch.conf'
|
INSTEON_LOCAL_SWITCH_CONF = 'insteon_local_switch.conf'
|
||||||
|
|
||||||
MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(milliseconds=100)
|
MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(milliseconds=100)
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
@ -36,15 +36,16 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
setup_switch(
|
setup_switch(
|
||||||
device_id, conf_switches[device_id], insteonhub, hass,
|
device_id, conf_switches[device_id], insteonhub, hass,
|
||||||
add_devices)
|
add_devices)
|
||||||
|
else:
|
||||||
|
linked = insteonhub.get_linked()
|
||||||
|
|
||||||
linked = insteonhub.get_linked()
|
for device_id in linked:
|
||||||
|
if linked[device_id]['cat_type'] == 'switch'\
|
||||||
for device_id in linked:
|
and device_id not in conf_switches:
|
||||||
if linked[device_id]['cat_type'] == 'switch'\
|
request_configuration(device_id, insteonhub,
|
||||||
and device_id not in conf_switches:
|
linked[device_id]['model_name'] + ' ' +
|
||||||
request_configuration(device_id, insteonhub,
|
linked[device_id]['sku'],
|
||||||
linked[device_id]['model_name'] + ' ' +
|
hass, add_devices)
|
||||||
linked[device_id]['sku'], hass, add_devices)
|
|
||||||
|
|
||||||
|
|
||||||
def request_configuration(device_id, insteonhub, model, hass,
|
def request_configuration(device_id, insteonhub, model, hass,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user