Remove unnecessary try-else (1) (#86158)

This commit is contained in:
Marc Mueller
2023-01-18 14:24:52 +01:00
committed by GitHub
parent 6d336ec136
commit 1cc8feabb7
5 changed files with 30 additions and 32 deletions

View File

@@ -285,15 +285,15 @@ class EmonCmsData:
except requests.exceptions.RequestException as exception:
_LOGGER.error(exception)
return
if req.status_code == HTTPStatus.OK:
self.data = req.json()
else:
if req.status_code == HTTPStatus.OK:
self.data = req.json()
else:
_LOGGER.error(
(
"Please verify if the specified configuration value "
"'%s' is correct! (HTTP Status_code = %d)"
),
CONF_URL,
req.status_code,
)
_LOGGER.error(
(
"Please verify if the specified configuration value "
"'%s' is correct! (HTTP Status_code = %d)"
),
CONF_URL,
req.status_code,
)