From 255c3c5b9a82639cf7807e76abb59657cb3569d1 Mon Sep 17 00:00:00 2001 From: Khole Date: Sat, 2 Jul 2022 13:33:10 +0100 Subject: [PATCH] Hive add entity categories to entities (#74324) add enitity categories to entities --- homeassistant/components/hive/sensor.py | 3 +++ homeassistant/components/hive/switch.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/hive/sensor.py b/homeassistant/components/hive/sensor.py index 5bac23fdb3d..d224ec085f3 100644 --- a/homeassistant/components/hive/sensor.py +++ b/homeassistant/components/hive/sensor.py @@ -10,6 +10,7 @@ from homeassistant.components.sensor import ( from homeassistant.config_entries import ConfigEntry from homeassistant.const import PERCENTAGE, POWER_KILO_WATT from homeassistant.core import HomeAssistant +from homeassistant.helpers.entity import EntityCategory from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import HiveEntity @@ -23,12 +24,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( key="Battery", native_unit_of_measurement=PERCENTAGE, device_class=SensorDeviceClass.BATTERY, + entity_category=EntityCategory.DIAGNOSTIC, ), SensorEntityDescription( key="Power", native_unit_of_measurement=POWER_KILO_WATT, state_class=SensorStateClass.MEASUREMENT, device_class=SensorDeviceClass.POWER, + entity_category=EntityCategory.DIAGNOSTIC, ), ) diff --git a/homeassistant/components/hive/switch.py b/homeassistant/components/hive/switch.py index 64a8276521a..f72f228c595 100644 --- a/homeassistant/components/hive/switch.py +++ b/homeassistant/components/hive/switch.py @@ -6,6 +6,7 @@ from datetime import timedelta from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant +from homeassistant.helpers.entity import EntityCategory from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import HiveEntity, refresh_system @@ -19,7 +20,10 @@ SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = ( SwitchEntityDescription( key="activeplug", ), - SwitchEntityDescription(key="Heating_Heat_On_Demand"), + SwitchEntityDescription( + key="Heating_Heat_On_Demand", + entity_category=EntityCategory.CONFIG, + ), )