Pass address rather than device object to platform

pull/12483/head
Tom Harris 2018-02-02 22:55:56 -05:00
parent 6a8936da32
commit c7c0534dce
5 changed files with 17 additions and 9 deletions

View File

@ -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']

View File

@ -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}],

View File

@ -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']

View File

@ -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']

View File

@ -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']