tplink - catch SmartDeviceException on is_dimmable call (#21726)
* automated commit 06/03/2019 20:49:50 * automated commit 06/03/2019 20:53:13 * automated commit 06/03/2019 20:53:48pull/21740/head
parent
38a93afa66
commit
9c70b00403
homeassistant/components/tplink
|
@ -107,10 +107,15 @@ async def async_setup_entry(hass, config_entry):
|
|||
def _fill_device_lists():
|
||||
for dev in devices.values():
|
||||
if isinstance(dev, SmartPlug):
|
||||
if dev.is_dimmable: # Dimmers act as lights
|
||||
lights.append(dev)
|
||||
else:
|
||||
switches.append(dev)
|
||||
try:
|
||||
if dev.is_dimmable: # Dimmers act as lights
|
||||
lights.append(dev)
|
||||
else:
|
||||
switches.append(dev)
|
||||
except SmartDeviceException as ex:
|
||||
_LOGGER.error("Unable to connect to device %s: %s",
|
||||
dev.host, ex)
|
||||
|
||||
elif isinstance(dev, SmartBulb):
|
||||
lights.append(dev)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue