From a2d02574103f03e0a48d8b02b993690a587d6cd4 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Tue, 18 Apr 2023 23:44:23 +0200 Subject: [PATCH] Add more sensors for #22 --- custom_components/hon/binary_sensor.py | 3 +++ custom_components/hon/sensor.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/custom_components/hon/binary_sensor.py b/custom_components/hon/binary_sensor.py index 9b3202c..725259c 100644 --- a/custom_components/hon/binary_sensor.py +++ b/custom_components/hon/binary_sensor.py @@ -152,6 +152,9 @@ BINARY_SENSORS: dict[str, tuple[HonBinarySensorEntityDescription, ...]] = { device_class=BinarySensorDeviceClass.HEAT, on_value="1", ), + HonBinarySensorEntityDescription( + key="panStatus", name="Pan Status", on_value="1", icon="mdi:pot-mix" + ), HonBinarySensorEntityDescription( key="hobLockStatus", name="Hob Lock", diff --git a/custom_components/hon/sensor.py b/custom_components/hon/sensor.py index ad2dcad..32d7aee 100644 --- a/custom_components/hon/sensor.py +++ b/custom_components/hon/sensor.py @@ -55,7 +55,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { name="Current Electricity Used", state_class=SensorStateClass.MEASUREMENT, device_class=SensorDeviceClass.POWER, - native_unit_of_measurement=UnitOfPower.KILO_WATT_HOUR, + native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, icon="mdi:lightning-bolt", ), SensorEntityDescription( @@ -171,7 +171,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { name="Current Electricity Used", state_class=SensorStateClass.MEASUREMENT, device_class=SensorDeviceClass.POWER, - native_unit_of_measurement=UnitOfPower.KILO_WATT_HOUR, + native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, icon="mdi:lightning-bolt", ), SensorEntityDescription( @@ -279,6 +279,12 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { native_unit_of_measurement=UnitOfTemperature.CELSIUS, ), SensorEntityDescription(key="errors", name="Error", icon="mdi:math-log"), + SensorEntityDescription( + key="power", + name="Power", + icon="mdi:lightning-bolt", + state_class=SensorStateClass.MEASUREMENT, + ), ), "DW": ( SensorEntityDescription(