mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Hive add entity categories to entities (#74324)
add enitity categories to entities
This commit is contained in:
parent
647a023776
commit
255c3c5b9a
@ -10,6 +10,7 @@ from homeassistant.components.sensor import (
|
|||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import PERCENTAGE, POWER_KILO_WATT
|
from homeassistant.const import PERCENTAGE, POWER_KILO_WATT
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import HiveEntity
|
from . import HiveEntity
|
||||||
@ -23,12 +24,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
key="Battery",
|
key="Battery",
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
device_class=SensorDeviceClass.BATTERY,
|
device_class=SensorDeviceClass.BATTERY,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="Power",
|
key="Power",
|
||||||
native_unit_of_measurement=POWER_KILO_WATT,
|
native_unit_of_measurement=POWER_KILO_WATT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ from datetime import timedelta
|
|||||||
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.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import HiveEntity, refresh_system
|
from . import HiveEntity, refresh_system
|
||||||
@ -19,7 +20,10 @@ SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
|
|||||||
SwitchEntityDescription(
|
SwitchEntityDescription(
|
||||||
key="activeplug",
|
key="activeplug",
|
||||||
),
|
),
|
||||||
SwitchEntityDescription(key="Heating_Heat_On_Demand"),
|
SwitchEntityDescription(
|
||||||
|
key="Heating_Heat_On_Demand",
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user