Use http status constants more, add HTTP_ACCEPTED and HTTP_BAD_GATEWAY (#39993)
* Use http status codes and add HTTP_BAD_GATEWAY constant * Address review comments: - using constants in tado integration - using constant in media_player init.py * Add and use HTTP_ACCEPTED constant
This commit is contained in:
parent
59d610af17
commit
db582bdc1b
32 changed files with 137 additions and 58 deletions
|
@ -29,6 +29,7 @@ from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
|||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
CONF_WEBHOOK_ID,
|
||||
HTTP_UNAUTHORIZED,
|
||||
MASS_KILOGRAMS,
|
||||
PERCENTAGE,
|
||||
SPEED_METERS_PER_SECOND,
|
||||
|
@ -54,7 +55,7 @@ from .const import Measurement
|
|||
|
||||
_LOGGER = logging.getLogger(const.LOG_NAMESPACE)
|
||||
NOT_AUTHENTICATED_ERROR = re.compile(
|
||||
"^401,.*",
|
||||
f"^{HTTP_UNAUTHORIZED},.*",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
DATA_UPDATED_SIGNAL = "withings_entity_state_updated"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue