mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
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
This commit is contained in:
parent
38a93afa66
commit
9c70b00403
@ -107,10 +107,15 @@ async def async_setup_entry(hass, config_entry):
|
|||||||
def _fill_device_lists():
|
def _fill_device_lists():
|
||||||
for dev in devices.values():
|
for dev in devices.values():
|
||||||
if isinstance(dev, SmartPlug):
|
if isinstance(dev, SmartPlug):
|
||||||
if dev.is_dimmable: # Dimmers act as lights
|
try:
|
||||||
lights.append(dev)
|
if dev.is_dimmable: # Dimmers act as lights
|
||||||
else:
|
lights.append(dev)
|
||||||
switches.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):
|
elif isinstance(dev, SmartBulb):
|
||||||
lights.append(dev)
|
lights.append(dev)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user