Use http.HTTPStatus in components/[wxyz]* (#58330)

This commit is contained in:
Ville Skyttä 2021-10-24 18:25:01 +03:00 committed by GitHub
parent 1a9bb47f78
commit 0de95610e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 69 additions and 52 deletions

View file

@ -7,6 +7,7 @@ from dataclasses import dataclass
import datetime
from datetime import timedelta
from enum import Enum, IntEnum
from http import HTTPStatus
import logging
import re
from typing import Any, Dict
@ -32,7 +33,6 @@ from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntry
from homeassistant.const import (
CONF_WEBHOOK_ID,
HTTP_UNAUTHORIZED,
MASS_KILOGRAMS,
PERCENTAGE,
SPEED_METERS_PER_SECOND,
@ -58,7 +58,7 @@ from .const import Measurement
_LOGGER = logging.getLogger(const.LOG_NAMESPACE)
NOT_AUTHENTICATED_ERROR = re.compile(
f"^{HTTP_UNAUTHORIZED},.*",
f"^{HTTPStatus.UNAUTHORIZED},.*",
re.IGNORECASE,
)
DATA_UPDATED_SIGNAL = "withings_entity_state_updated"