Expose DEVICE_CLASS_STATE_CLASSES sensor constant (#88172)

This commit is contained in:
epenet 2023-02-15 14:48:27 +01:00 committed by GitHub
parent f67ebcade1
commit ccf44d58cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -99,6 +99,7 @@ __all__ = [
"ATTR_OPTIONS",
"ATTR_STATE_CLASS",
"CONF_STATE_CLASS",
"DEVICE_CLASS_STATE_CLASSES",
"DOMAIN",
"PLATFORM_SCHEMA_BASE",
"PLATFORM_SCHEMA",

View File

@ -13,7 +13,7 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.recorder import get_instance, history
from homeassistant.components.sensor import ( # pylint: disable=hass-deprecated-import
from homeassistant.components.sensor import (
DEVICE_CLASS_STATE_CLASSES,
PLATFORM_SCHEMA,
SensorDeviceClass,

View File

@ -215,7 +215,7 @@ _OBSOLETE_IMPORT: dict[str, list[ObsoleteImportMatch]] = {
"homeassistant.components.sensor": [
ObsoleteImportMatch(
reason="replaced by SensorDeviceClass enum",
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
constant=re.compile(r"^DEVICE_CLASS_(?!STATE_CLASSES)$"),
),
ObsoleteImportMatch(
reason="replaced by SensorStateClass enum",