discover: Catch socket.timeout and debug log it (#34)

Fixes #33
This commit is contained in:
Teemu R 2017-03-17 14:32:50 +01:00 committed by GitHub
parent 5dc94cd5c8
commit 1bada16636

View File

@ -108,6 +108,8 @@ class TPLinkSmartHomeProtocol:
info = json.loads(TPLinkSmartHomeProtocol.decrypt(data)) info = json.loads(TPLinkSmartHomeProtocol.decrypt(data))
devices.append({"ip": ip, "port": port, "sys_info": info}) devices.append({"ip": ip, "port": port, "sys_info": info})
except socket.timeout:
_LOGGER.debug("Got socket timeout, which is okay.")
except Exception as ex: except Exception as ex:
_LOGGER.error("Got exception %s", ex, exc_info=True) _LOGGER.error("Got exception %s", ex, exc_info=True)