mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Use HTTPStatus instead of HTTP_ consts and magic values in comp.../[de]* (#57990)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Support for monitoring emoncms feeds."""
|
||||
from datetime import timedelta
|
||||
from http import HTTPStatus
|
||||
import logging
|
||||
|
||||
import requests
|
||||
@@ -20,7 +21,6 @@ from homeassistant.const import (
|
||||
CONF_VALUE_TEMPLATE,
|
||||
DEVICE_CLASS_ENERGY,
|
||||
DEVICE_CLASS_POWER,
|
||||
HTTP_OK,
|
||||
POWER_WATT,
|
||||
STATE_UNKNOWN,
|
||||
)
|
||||
@@ -256,7 +256,7 @@ class EmonCmsData:
|
||||
_LOGGER.error(exception)
|
||||
return
|
||||
else:
|
||||
if req.status_code == HTTP_OK:
|
||||
if req.status_code == HTTPStatus.OK:
|
||||
self.data = req.json()
|
||||
else:
|
||||
_LOGGER.error(
|
||||
|
||||
Reference in New Issue
Block a user