diff --git a/custom_components/tibber_local/const.py b/custom_components/tibber_local/const.py index f6815d4..0ec5de1 100644 --- a/custom_components/tibber_local/const.py +++ b/custom_components/tibber_local/const.py @@ -1,12 +1,11 @@ -from typing import Final from dataclasses import dataclass +from typing import Final from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntityDescription, SensorStateClass, ) - from homeassistant.const import ( UnitOfElectricPotential, UnitOfElectricCurrent, @@ -15,7 +14,6 @@ UnitOfPower, DEGREE, ) -from homeassistant.helpers.entity import EntityCategory DOMAIN: Final = "tibber_local" MANUFACTURE: Final = "Tibber" @@ -133,7 +131,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): name="Potential L1", native_unit_of_measurement=UnitOfElectricPotential.VOLT, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), # Spannung L2 @@ -142,7 +140,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): name="Potential L2", native_unit_of_measurement=UnitOfElectricPotential.VOLT, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), # Spannung L3 @@ -151,7 +149,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): name="Potential L3", native_unit_of_measurement=UnitOfElectricPotential.VOLT, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -161,7 +159,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): name="Current L1", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), # Strom L2 @@ -170,7 +168,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): name="Current L2", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), # Strom L3 @@ -179,7 +177,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): name="Current L3", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -200,7 +198,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): suggested_display_precision=1, native_unit_of_measurement=DEGREE, icon="mdi:sine-wave", - device_class=SensorDeviceClass.POWER, + device_class=None, state_class=SensorStateClass.MEASUREMENT, ), # Phasenabweichung Spannungen L1/L3 @@ -210,7 +208,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): suggested_display_precision=1, native_unit_of_measurement=DEGREE, icon="mdi:sine-wave", - device_class=SensorDeviceClass.POWER, + device_class=None, state_class=SensorStateClass.MEASUREMENT, ), @@ -221,7 +219,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): suggested_display_precision=1, native_unit_of_measurement=DEGREE, icon="mdi:sine-wave", - device_class=SensorDeviceClass.ENERGY, + device_class=None, state_class=SensorStateClass.MEASUREMENT, ), # Phasenabweichung Strom/Spannung L2 @@ -231,7 +229,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): suggested_display_precision=1, native_unit_of_measurement=DEGREE, icon="mdi:sine-wave", - device_class=SensorDeviceClass.ENERGY, + device_class=None, state_class=SensorStateClass.MEASUREMENT, ), # Phasenabweichung Strom/Spannung L3 @@ -241,7 +239,7 @@ class ExtSensorEntityDescription(SensorEntityDescription): suggested_display_precision=1, native_unit_of_measurement=DEGREE, icon="mdi:sine-wave", - device_class=SensorDeviceClass.ENERGY, + device_class=None, state_class=SensorStateClass.MEASUREMENT, ), ] diff --git a/custom_components/tibber_local/manifest.json b/custom_components/tibber_local/manifest.json index 5da44ac..c8fca66 100644 --- a/custom_components/tibber_local/manifest.json +++ b/custom_components/tibber_local/manifest.json @@ -10,5 +10,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/marq24/ha-tibber-pulse-local/issues", "requirements": ["smllib==1.4"], - "version": "2024.9.0" + "version": "2024.10.0" }