Enable ruff TRY401 (#114395)

* Enable ruff TRY401

* fix tests
This commit is contained in:
Sid 2024-03-29 07:20:36 +01:00 committed by GitHub
parent 530552b4f5
commit a5b609f081
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 159 additions and 182 deletions

View file

@ -219,8 +219,8 @@ class RestSwitch(ManualTriggerEntity, SwitchEntity):
req = await self.get_device_state(self.hass)
except (TimeoutError, httpx.TimeoutException):
_LOGGER.exception("Timed out while fetching data")
except httpx.RequestError as err:
_LOGGER.exception("Error while fetching data: %s", err)
except httpx.RequestError:
_LOGGER.exception("Error while fetching data")
if req:
self._process_manual_data(req.text)