Pass address rather than device object to platform
parent
6a8936da32
commit
c7c0534dce
|
@ -25,9 +25,11 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
|||
"""Set up the INSTEON PLM device class for the hass platform."""
|
||||
|
||||
state_list = []
|
||||
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
for deviceInfo in discovery_info:
|
||||
device = deviceInfo['device']
|
||||
address = deviceInfo['address']
|
||||
device = plm.devices[address]
|
||||
stateKey = deviceInfo['stateKey']
|
||||
subplatform = deviceInfo['subplatform']
|
||||
newnames = deviceInfo['newnames']
|
||||
|
|
|
@ -74,7 +74,7 @@ def async_setup(hass, config):
|
|||
platform)
|
||||
hass.async_add_job(
|
||||
discovery.async_load_platform(
|
||||
hass, platform, DOMAIN, discovered=[{'device':device,
|
||||
hass, platform, DOMAIN, discovered=[{'address':device.address.hex,
|
||||
'stateKey':stateKey,
|
||||
'subplatform':subplatform,
|
||||
'newnames': use_newnames}],
|
||||
|
|
|
@ -24,9 +24,11 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
|||
"""Set up the Insteon PLM device."""
|
||||
|
||||
state_list = []
|
||||
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
for deviceInfo in discovery_info:
|
||||
device = deviceInfo['device']
|
||||
address = deviceInfo['address']
|
||||
device = plm.devices[address]
|
||||
stateKey = deviceInfo['stateKey']
|
||||
subplatform = deviceInfo['subplatform']
|
||||
newnames = deviceInfo['newnames']
|
||||
|
|
|
@ -21,9 +21,11 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
|||
"""Set up the INSTEON PLM device class for the hass platform."""
|
||||
|
||||
state_list = []
|
||||
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
for deviceInfo in discovery_info:
|
||||
device = deviceInfo['device']
|
||||
address = deviceInfo['address']
|
||||
device = plm.devices[address]
|
||||
stateKey = deviceInfo['stateKey']
|
||||
subplatform = deviceInfo['subplatform']
|
||||
newnames = deviceInfo['newnames']
|
||||
|
|
|
@ -21,9 +21,11 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
|||
"""Set up the INSTEON PLM device class for the hass platform."""
|
||||
|
||||
state_list = []
|
||||
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
for deviceInfo in discovery_info:
|
||||
device = deviceInfo['device']
|
||||
address = deviceInfo['address']
|
||||
device = plm.devices[address]
|
||||
stateKey = deviceInfo['stateKey']
|
||||
subplatform = deviceInfo['subplatform']
|
||||
newnames = deviceInfo['newnames']
|
||||
|
|
Loading…
Reference in New Issue