Remove unnecessary try-else (1) (#86158)
This commit is contained in:
parent
6d336ec136
commit
1cc8feabb7
5 changed files with 30 additions and 32 deletions
|
@ -152,5 +152,5 @@ class AirzoneZoneEntity(AirzoneEntity):
|
|||
raise HomeAssistantError(
|
||||
f"Failed to set zone {self.name}: {error}"
|
||||
) from error
|
||||
else:
|
||||
|
||||
self.coordinator.async_set_updated_data(self.coordinator.airzone.data())
|
||||
|
|
|
@ -76,7 +76,6 @@ class BroadlinkUpdateManager(ABC):
|
|||
)
|
||||
raise UpdateFailed(err) from err
|
||||
|
||||
else:
|
||||
if self.available is False:
|
||||
_LOGGER.warning(
|
||||
"Connected to %s (%s at %s)",
|
||||
|
|
|
@ -747,7 +747,7 @@ class CameraImageView(CameraView):
|
|||
)
|
||||
except (HomeAssistantError, ValueError) as ex:
|
||||
raise web.HTTPInternalServerError() from ex
|
||||
else:
|
||||
|
||||
return web.Response(body=image.content, content_type=image.content_type)
|
||||
|
||||
|
||||
|
|
|
@ -131,7 +131,6 @@ def get_data(hass: HomeAssistant, config: Mapping[str, Any]) -> CO2SignalRespons
|
|||
_LOGGER.exception("Unexpected exception")
|
||||
raise UnknownError from err
|
||||
|
||||
else:
|
||||
if "error" in data:
|
||||
raise UnknownError(data["error"])
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ class EmonCmsData:
|
|||
except requests.exceptions.RequestException as exception:
|
||||
_LOGGER.error(exception)
|
||||
return
|
||||
else:
|
||||
|
||||
if req.status_code == HTTPStatus.OK:
|
||||
self.data = req.json()
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue