Add more constants to deprecated imports (#69253)
* Add core ENTITY_CATEGORY_* to deprecated imports * Alphabetical order * Add core SOURCE_* to deprecated imports * Add switch DEVICE_CLASS_* to deprecated imports * Add binary_sensor DEVICE_CLASS_* to deprecated imports * Add humidifier DEVICE_CLASS_* to deprecated imports * Add config_entries.DISABLED_*** * Add device_registry.DISABLED_*** * Add humidifier.const * Add media_player DEVICE_CLASS_* * Add cover DEVICE_CLASS_*
This commit is contained in:
parent
9cd83c8b48
commit
9ef67c4b4c
1 changed files with 60 additions and 0 deletions
|
@ -19,12 +19,72 @@ class ObsoleteImportMatch:
|
|||
|
||||
|
||||
_OBSOLETE_IMPORT: dict[str, list[ObsoleteImportMatch]] = {
|
||||
"homeassistant.components.binarysensor": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by BinarySensorDeviceClass enum",
|
||||
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.components.cover": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by CoverDeviceClass enum",
|
||||
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.components.humidifier": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by HumidifierDeviceClass enum",
|
||||
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.components.humidifier.const": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by HumidifierDeviceClass enum",
|
||||
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.components.media_player": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by MediaPlayerDeviceClass enum",
|
||||
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.components.sensor": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by SensorStateClass enum",
|
||||
constant=re.compile(r"^STATE_CLASS_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.components.switch": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by SwitchDeviceClass enum",
|
||||
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.config_entries": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by ConfigEntryDisabler enum",
|
||||
constant=re.compile(r"^DISABLED_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.const": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by EntityCategory enum",
|
||||
constant=re.compile(r"^(ENTITY_CATEGORY_(\w*))|(ENTITY_CATEGORIES)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.core": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by ConfigSource enum",
|
||||
constant=re.compile(r"^SOURCE_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.helpers.device_registry": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by DeviceEntryDisabler enum",
|
||||
constant=re.compile(r"^DISABLED_(\w*)$"),
|
||||
),
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue