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