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