Add sensor DEVICE_CLASS_* to deprecated imports (#69243)
This commit is contained in:
parent
fb23843e63
commit
d0288f14f0
2 changed files with 9 additions and 1 deletions
|
@ -13,7 +13,7 @@ import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.backports.enum import StrEnum
|
from homeassistant.backports.enum import StrEnum
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ( # noqa: F401
|
from homeassistant.const import ( # noqa: F401, pylint: disable=[hass-deprecated-import]
|
||||||
CONF_UNIT_OF_MEASUREMENT,
|
CONF_UNIT_OF_MEASUREMENT,
|
||||||
DEVICE_CLASS_AQI,
|
DEVICE_CLASS_AQI,
|
||||||
DEVICE_CLASS_BATTERY,
|
DEVICE_CLASS_BATTERY,
|
||||||
|
|
|
@ -50,6 +50,10 @@ _OBSOLETE_IMPORT: dict[str, list[ObsoleteImportMatch]] = {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
"homeassistant.components.sensor": [
|
"homeassistant.components.sensor": [
|
||||||
|
ObsoleteImportMatch(
|
||||||
|
reason="replaced by SensorDeviceClass enum",
|
||||||
|
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
|
||||||
|
),
|
||||||
ObsoleteImportMatch(
|
ObsoleteImportMatch(
|
||||||
reason="replaced by SensorStateClass enum",
|
reason="replaced by SensorStateClass enum",
|
||||||
constant=re.compile(r"^STATE_CLASS_(\w*)$"),
|
constant=re.compile(r"^STATE_CLASS_(\w*)$"),
|
||||||
|
@ -68,6 +72,10 @@ _OBSOLETE_IMPORT: dict[str, list[ObsoleteImportMatch]] = {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
"homeassistant.const": [
|
"homeassistant.const": [
|
||||||
|
ObsoleteImportMatch(
|
||||||
|
reason="replaced by SensorDeviceClass enum",
|
||||||
|
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
|
||||||
|
),
|
||||||
ObsoleteImportMatch(
|
ObsoleteImportMatch(
|
||||||
reason="replaced by EntityCategory enum",
|
reason="replaced by EntityCategory enum",
|
||||||
constant=re.compile(r"^(ENTITY_CATEGORY_(\w*))|(ENTITY_CATEGORIES)$"),
|
constant=re.compile(r"^(ENTITY_CATEGORY_(\w*))|(ENTITY_CATEGORIES)$"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue