diff --git a/custom_components/easy_computer_manage/switch.py b/custom_components/easy_computer_manage/switch.py index cb8c3e6..f464198 100644 --- a/custom_components/easy_computer_manage/switch.py +++ b/custom_components/easy_computer_manage/switch.py @@ -235,14 +235,14 @@ class ComputerSwitch(SwitchEntity): try: 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: _LOGGER.error("Could not authenticate to %s: %s", self._host, error) self._state = False 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 = { "operating_system": utils.get_operating_system(self._connection),