Minor final fixes

This commit is contained in:
Pierre Ståhl
2020-10-14 12:39:00 +02:00
committed by rospogrigio
parent b0603313ff
commit 136e44c549
2 changed files with 6 additions and 7 deletions

View File

@@ -150,12 +150,12 @@ class TuyaDevice(pytuya.TuyaListener):
_LOGGER.debug("Retrieving initial state")
status = await self._interface.status()
if status is None:
raise Exception("failed to retrieve status")
raise Exception("Failed to retrieve status")
self.status_updated(status)
self._connection_attempts = 0
except Exception:
_LOGGER.exception("connect failed")
_LOGGER.exception(f"Connect to {self._config_entry[CONF_HOST]} failed")
self._connection_attempts += 1
if self._interface is not None:
self._interface.close()