The use of the DEVICE_CLASS_* constants and DEVICE_CLASSES constants in all entity platforms, has now been depreacted. Instead, use the equavalent DeviceClass StrEnum provided by each platform.

This commit is contained in:
tomaae 2021-12-13 11:42:55 +01:00
parent e10ab3e0ee
commit 74a4a367dd
2 changed files with 11 additions and 11 deletions

View file

@ -3,9 +3,10 @@
import logging
from typing import Any, Dict, Optional
from homeassistant.components.binary_sensor import (
BinarySensorEntity,
DEVICE_CLASS_CONNECTIVITY,
BinarySensorDeviceClass,
)
from homeassistant.const import (
CONF_NAME,
@ -332,7 +333,7 @@ class MikrotikControllerPPPSecretBinarySensor(MikrotikControllerBinarySensor):
@property
def device_class(self) -> Optional[str]:
"""Return the device class."""
return DEVICE_CLASS_CONNECTIVITY
return BinarySensorDeviceClass.CONNECTIVITY
@property
def available(self) -> bool:
@ -426,7 +427,7 @@ class MikrotikControllerPortBinarySensor(MikrotikControllerBinarySensor):
@property
def device_class(self) -> Optional[str]:
"""Return the device class."""
return DEVICE_CLASS_CONNECTIVITY
return BinarySensorDeviceClass.CONNECTIVITY
@property
def available(self) -> bool: