parse timeout exception during renewing

This commit is contained in:
Mathieu B 2023-04-06 18:45:56 +02:00
parent 0fab86024f
commit e808608e94

View File

@ -235,14 +235,14 @@ class ComputerSwitch(SwitchEntity):
try: try:
self._connection.open() self._connection.open()
except NoValidConnectionsError and SSHException as error:
_LOGGER.error("Could not connect to %s: %s", self._host, error)
self._state = False
return
except AuthenticationException as error: except AuthenticationException as error:
_LOGGER.error("Could not authenticate to %s: %s", self._host, error) _LOGGER.error("Could not authenticate to %s: %s", self._host, error)
self._state = False self._state = False
return return
except Exception as error:
_LOGGER.error("Could not connect to %s: %s", self._host, error)
self._state = False
return
self._attr_extra_state_attributes = { self._attr_extra_state_attributes = {
"operating_system": utils.get_operating_system(self._connection), "operating_system": utils.get_operating_system(self._connection),