mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-23 17:28:51 +02:00
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:
parent
e10ab3e0ee
commit
74a4a367dd
2 changed files with 11 additions and 11 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue