Use BinarySensorDeviceClass instead of deprecated constants (#76830)

pull/76841/head
Marc Mueller 2022-08-16 07:40:33 +02:00 committed by GitHub
parent b43242ef0d
commit b8f83f6c70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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",

View File

@ -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

View File

@ -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*)$"),