mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use new EntityCategory in Tractive (#61289)
This commit is contained in:
parent
d817b4c7ea
commit
d6725715a1
@ -9,9 +9,10 @@ from homeassistant.components.binary_sensor import (
|
|||||||
BinarySensorEntityDescription,
|
BinarySensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_BATTERY_CHARGING, ENTITY_CATEGORY_DIAGNOSTIC
|
from homeassistant.const import ATTR_BATTERY_CHARGING
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import Trackables
|
from . import Trackables
|
||||||
@ -77,7 +78,7 @@ SENSOR_TYPE = BinarySensorEntityDescription(
|
|||||||
key=ATTR_BATTERY_CHARGING,
|
key=ATTR_BATTERY_CHARGING,
|
||||||
name="Battery Charging",
|
name="Battery Charging",
|
||||||
device_class=BinarySensorDeviceClass.BATTERY_CHARGING,
|
device_class=BinarySensorDeviceClass.BATTERY_CHARGING,
|
||||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,14 +10,10 @@ from homeassistant.components.sensor import (
|
|||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_BATTERY_LEVEL, PERCENTAGE, TIME_MINUTES
|
||||||
ATTR_BATTERY_LEVEL,
|
|
||||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
|
||||||
PERCENTAGE,
|
|
||||||
TIME_MINUTES,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import Trackables
|
from . import Trackables
|
||||||
@ -141,7 +137,7 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
|||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
device_class=SensorDeviceClass.BATTERY,
|
device_class=SensorDeviceClass.BATTERY,
|
||||||
entity_class=TractiveHardwareSensor,
|
entity_class=TractiveHardwareSensor,
|
||||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
),
|
),
|
||||||
TractiveSensorEntityDescription(
|
TractiveSensorEntityDescription(
|
||||||
# Currently, only state operational and not_reporting are used
|
# Currently, only state operational and not_reporting are used
|
||||||
|
Loading…
x
Reference in New Issue
Block a user