From 9c70b00403b17a050975f93237042cbaa79e98c4 Mon Sep 17 00:00:00 2001 From: Leonardo Merza Date: Thu, 7 Mar 2019 04:54:09 -0500 Subject: [PATCH] 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:48 --- homeassistant/components/tplink/__init__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/tplink/__init__.py b/homeassistant/components/tplink/__init__.py index bc285150890..9fc12db0d63 100644 --- a/homeassistant/components/tplink/__init__.py +++ b/homeassistant/components/tplink/__init__.py @@ -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: