Use BinarySensorDeviceClass instead of deprecated constants (#76830)
parent
b43242ef0d
commit
b8f83f6c70
|
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|||
from devolo_plc_api.device import Device
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_PLUG,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
BinarySensorEntityDescription,
|
||||
)
|
||||
|
@ -47,7 +47,7 @@ class DevoloBinarySensorEntityDescription(
|
|||
SENSOR_TYPES: dict[str, DevoloBinarySensorEntityDescription] = {
|
||||
CONNECTED_TO_ROUTER: DevoloBinarySensorEntityDescription(
|
||||
key=CONNECTED_TO_ROUTER,
|
||||
device_class=DEVICE_CLASS_PLUG,
|
||||
device_class=BinarySensorDeviceClass.PLUG,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
entity_registry_enabled_default=False,
|
||||
icon="mdi:router-network",
|
||||
|
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||
from zwave_me_ws import ZWaveMeData
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_MOTION,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
BinarySensorEntityDescription,
|
||||
)
|
||||
|
@ -22,7 +22,7 @@ BINARY_SENSORS_MAP: dict[str, BinarySensorEntityDescription] = {
|
|||
),
|
||||
"motion": BinarySensorEntityDescription(
|
||||
key="motion",
|
||||
device_class=DEVICE_CLASS_MOTION,
|
||||
device_class=BinarySensorDeviceClass.MOTION,
|
||||
),
|
||||
}
|
||||
DEVICE_NAME = ZWaveMePlatform.BINARY_SENSOR
|
||||
|
|
|
@ -38,7 +38,7 @@ _OBSOLETE_IMPORT: dict[str, list[ObsoleteImportMatch]] = {
|
|||
constant=re.compile(r"^FORMAT_(\w*)$"),
|
||||
),
|
||||
],
|
||||
"homeassistant.components.binarysensor": [
|
||||
"homeassistant.components.binary_sensor": [
|
||||
ObsoleteImportMatch(
|
||||
reason="replaced by BinarySensorDeviceClass enum",
|
||||
constant=re.compile(r"^DEVICE_CLASS_(\w*)$"),
|
||||
|
|
Loading…
Reference in New Issue