mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 04:50:17 +00:00
Remove unnecessary try-else (1) (#86158)
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user