tplink - catch SmartDeviceException on is_dimmable call ()

* automated commit 06/03/2019 20:49:50

* automated commit 06/03/2019 20:53:13

* automated commit 06/03/2019 20:53:48
pull/21740/head
Leonardo Merza 2019-03-07 04:54:09 -05:00 committed by Teemu R
parent 38a93afa66
commit 9c70b00403
1 changed files with 9 additions and 4 deletions
homeassistant/components/tplink

View File

@ -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: