Add entity category to Tractive (#57720)
parent
b0ff28ceb4
commit
e7e88d6a19
|
@ -9,7 +9,7 @@ from homeassistant.components.binary_sensor import (
|
|||
BinarySensorEntityDescription,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ATTR_BATTERY_CHARGING
|
||||
from homeassistant.const import ATTR_BATTERY_CHARGING, ENTITY_CATEGORY_DIAGNOSTIC
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -77,6 +77,7 @@ SENSOR_TYPE = BinarySensorEntityDescription(
|
|||
key=ATTR_BATTERY_CHARGING,
|
||||
name="Battery Charging",
|
||||
device_class=DEVICE_CLASS_BATTERY_CHARGING,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.const import (
|
||||
ATTR_BATTERY_LEVEL,
|
||||
DEVICE_CLASS_BATTERY,
|
||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
PERCENTAGE,
|
||||
TIME_MINUTES,
|
||||
)
|
||||
|
@ -134,6 +135,7 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
|||
native_unit_of_measurement=PERCENTAGE,
|
||||
device_class=DEVICE_CLASS_BATTERY,
|
||||
entity_class=TractiveHardwareSensor,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
),
|
||||
TractiveSensorEntityDescription(
|
||||
key=ATTR_MINUTES_ACTIVE,
|
||||
|
|
|
@ -9,6 +9,7 @@ from aiotractive.exceptions import TractiveError
|
|||
|
||||
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ENTITY_CATEGORY_CONFIG
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -49,18 +50,21 @@ SWITCH_TYPES: tuple[TractiveSwitchEntityDescription, ...] = (
|
|||
name="Tracker Buzzer",
|
||||
icon="mdi:volume-high",
|
||||
method="async_set_buzzer",
|
||||
entity_category=ENTITY_CATEGORY_CONFIG,
|
||||
),
|
||||
TractiveSwitchEntityDescription(
|
||||
key=ATTR_LED,
|
||||
name="Tracker LED",
|
||||
icon="mdi:led-on",
|
||||
method="async_set_led",
|
||||
entity_category=ENTITY_CATEGORY_CONFIG,
|
||||
),
|
||||
TractiveSwitchEntityDescription(
|
||||
key=ATTR_LIVE_TRACKING,
|
||||
name="Live Tracking",
|
||||
icon="mdi:map-marker-path",
|
||||
method="async_set_live_tracking",
|
||||
entity_category=ENTITY_CATEGORY_CONFIG,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue