From 9cd2b834223482cbe42b6b14f9e595cc59f6c28b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com> Date: Fri, 21 Oct 2022 10:04:16 +0200 Subject: [PATCH] Add entity_registry_enabled_default and missing EntityCategories in Plugwise (#80629) --- .../components/plugwise/binary_sensor.py | 7 +++++ homeassistant/components/plugwise/sensor.py | 31 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/homeassistant/components/plugwise/binary_sensor.py b/homeassistant/components/plugwise/binary_sensor.py index 6f751b82b35..164135a607b 100644 --- a/homeassistant/components/plugwise/binary_sensor.py +++ b/homeassistant/components/plugwise/binary_sensor.py @@ -29,6 +29,13 @@ class PlugwiseBinarySensorEntityDescription(BinarySensorEntityDescription): BINARY_SENSORS: tuple[PlugwiseBinarySensorEntityDescription, ...] = ( + PlugwiseBinarySensorEntityDescription( + key="compressor_state", + name="Compressor state", + icon="mdi:hvac", + icon_off="mdi:hvac-off", + entity_category=EntityCategory.DIAGNOSTIC, + ), PlugwiseBinarySensorEntityDescription( key="dhw_state", name="DHW state", diff --git a/homeassistant/components/plugwise/sensor.py b/homeassistant/components/plugwise/sensor.py index 0e65f617c25..b6e2a3aa413 100644 --- a/homeassistant/components/plugwise/sensor.py +++ b/homeassistant/components/plugwise/sensor.py @@ -18,6 +18,7 @@ from homeassistant.const import ( VOLUME_CUBIC_METERS, ) from homeassistant.core import HomeAssistant +from homeassistant.helpers.entity import EntityCategory from homeassistant.helpers.entity_platform import AddEntitiesCallback from .const import DOMAIN, UNIT_LUMEN @@ -31,12 +32,30 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( native_unit_of_measurement=TEMP_CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, + ), + SensorEntityDescription( + key="setpoint_high", + name="Cooling setpoint", + native_unit_of_measurement=TEMP_CELSIUS, + device_class=SensorDeviceClass.TEMPERATURE, + state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, + ), + SensorEntityDescription( + key="setpoint_low", + name="Heating setpoint", + native_unit_of_measurement=TEMP_CELSIUS, + device_class=SensorDeviceClass.TEMPERATURE, + state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, ), SensorEntityDescription( key="temperature", name="Temperature", native_unit_of_measurement=TEMP_CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -44,6 +63,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( name="Intended boiler temperature", native_unit_of_measurement=TEMP_CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -51,6 +71,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( name="Temperature difference", native_unit_of_measurement=TEMP_CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -65,6 +86,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( name="Outdoor air temperature", native_unit_of_measurement=TEMP_CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -72,6 +94,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( name="Water temperature", native_unit_of_measurement=TEMP_CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -79,6 +102,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( name="Return temperature", native_unit_of_measurement=TEMP_CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -94,6 +118,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( native_unit_of_measurement=POWER_WATT, device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, + entity_registry_enabled_default=False, ), SensorEntityDescription( key="electricity_consumed_interval", @@ -122,6 +147,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( native_unit_of_measurement=ENERGY_WATT_HOUR, device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL, + entity_registry_enabled_default=False, ), SensorEntityDescription( key="electricity_produced_peak_interval", @@ -226,6 +252,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( name="Battery", native_unit_of_measurement=PERCENTAGE, device_class=SensorDeviceClass.BATTERY, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -240,12 +267,14 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( name="Modulation level", icon="mdi:percent", native_unit_of_measurement=PERCENTAGE, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key="valve_position", name="Valve position", icon="mdi:valve", + entity_category=EntityCategory.DIAGNOSTIC, native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -254,6 +283,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( name="Water pressure", native_unit_of_measurement=PRESSURE_BAR, device_class=SensorDeviceClass.PRESSURE, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -268,6 +298,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = ( name="DHW temperature", native_unit_of_measurement=TEMP_CELSIUS, device_class=SensorDeviceClass.TEMPERATURE, + entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, ), )