Use new EntityCategory enum in Surepetcare (#61282)
This commit is contained in:
parent
c05eca1c82
commit
1990b5b608
2 changed files with 6 additions and 10 deletions
|
@ -12,8 +12,8 @@ from homeassistant.components.binary_sensor import (
|
|||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import SurePetcareDataCoordinator
|
||||
|
@ -67,7 +67,7 @@ class Hub(SurePetcareBinarySensor):
|
|||
"""Sure Petcare Hub."""
|
||||
|
||||
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
|
||||
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
|
||||
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
|
@ -117,7 +117,7 @@ class DeviceConnectivity(SurePetcareBinarySensor):
|
|||
"""Sure Petcare Device."""
|
||||
|
||||
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
|
||||
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
|
||||
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
|
|
@ -9,13 +9,9 @@ from surepy.enums import EntityType
|
|||
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
ATTR_VOLTAGE,
|
||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
PERCENTAGE,
|
||||
VOLUME_MILLILITERS,
|
||||
)
|
||||
from homeassistant.const import ATTR_VOLTAGE, PERCENTAGE, VOLUME_MILLILITERS
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import SurePetcareDataCoordinator
|
||||
|
@ -52,7 +48,7 @@ class SureBattery(SurePetcareEntity, SensorEntity):
|
|||
"""A sensor implementation for Sure Petcare batteries."""
|
||||
|
||||
_attr_device_class = SensorDeviceClass.BATTERY
|
||||
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
|
||||
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||
_attr_native_unit_of_measurement = PERCENTAGE
|
||||
|
||||
def __init__(
|
||||
|
|
Loading…
Add table
Reference in a new issue