Make tplink SmartStrip communication more robust (#40281)

This commit is contained in:
Greg Badros 2020-09-18 19:48:19 -07:00 committed by GitHub
parent 052e8f0983
commit 94dfb66824
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,7 +119,14 @@ def get_static_devices(config_data) -> SmartDevices:
elif type_ == CONF_SWITCH:
switches.append(SmartPlug(host))
elif type_ == CONF_STRIP:
for plug in SmartStrip(host).plugs.values():
try:
ss_host = SmartStrip(host)
except SmartDeviceException as sde:
_LOGGER.error(
"Failed to setup SmartStrip at %s: %s; not retrying", host, sde
)
continue
for plug in ss_host.plugs.values():
switches.append(plug)
# Dimmers need to be defined as smart plugs to work correctly.
elif type_ == CONF_DIMMER: