mirror of
https://github.com/home-assistant/core.git
synced 2025-08-14 01:55:18 +02:00
Change discovered from a list of dict to a dict
This commit is contained in:
@@ -35,9 +35,9 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
entities = []
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
address = device_info['address']
|
||||
address = discovery_info['address']
|
||||
device = plm.devices[address]
|
||||
state_key = device_info['state_key']
|
||||
state_key = discovery_info['state_key']
|
||||
|
||||
entities.append(InsteonPLMFan(device, state_key, SUPPORT_SET_SPEED))
|
||||
|
||||
|
@@ -58,7 +58,7 @@ def async_setup(hass, config):
|
||||
discovery.async_load_platform(
|
||||
hass, platform, DOMAIN,
|
||||
discovered={'address': device.address.hex,
|
||||
'state_key': state_key},
|
||||
'state_key': state_key},
|
||||
hass_config=config))
|
||||
|
||||
_LOGGER.info("Looking for PLM on %s", port)
|
||||
|
@@ -25,12 +25,11 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
entities = []
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
for device_info in discovery_info:
|
||||
address = device_info['address']
|
||||
device = plm.devices[address]
|
||||
state_key = device_info['state_key']
|
||||
address = discovery_info['address']
|
||||
device = plm.devices[address]
|
||||
state_key = discovery_info['state_key']
|
||||
|
||||
entities.append(InsteonPLMDimmerDevice(device, state_key))
|
||||
entities.append(InsteonPLMDimmerDevice(device, state_key))
|
||||
|
||||
async_add_devices(entities)
|
||||
|
||||
|
@@ -22,12 +22,11 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
entities = []
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
for device_info in discovery_info:
|
||||
address = device_info['address']
|
||||
device = plm.devices[address]
|
||||
state_key = device_info['state_key']
|
||||
address = discovery_info['address']
|
||||
device = plm.devices[address]
|
||||
state_key = discovery_info['state_key']
|
||||
|
||||
entities.append(InsteonPLMSensorDevice(device, state_key))
|
||||
entities.append(InsteonPLMSensorDevice(device, state_key))
|
||||
|
||||
async_add_devices(entities)
|
||||
|
||||
|
Reference in New Issue
Block a user