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:
springstan 2020-09-15 19:01:07 +02:00 committed by GitHub
parent 59d610af17
commit db582bdc1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 137 additions and 58 deletions

View file

@ -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"