Use http.HTTPStatus in components/[wxyz]* (#58330)
This commit is contained in:
parent
1a9bb47f78
commit
0de95610e3
16 changed files with 69 additions and 52 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue