From ee3b48adbae16657440f72a246fa21b67addd1fb Mon Sep 17 00:00:00 2001 From: flauteps Date: Sat, 5 Oct 2024 16:45:11 +0200 Subject: [PATCH] [fix] device_class (#94) Change to fix device_class in agreement with https://www.home-assistant.io/docs/energy/faq/#troubleshooting-missing-entities --- custom_components/saj_esolar/sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/saj_esolar/sensor.py b/custom_components/saj_esolar/sensor.py index d9eb8a4..d4806b2 100644 --- a/custom_components/saj_esolar/sensor.py +++ b/custom_components/saj_esolar/sensor.py @@ -141,7 +141,7 @@ def add_years(d, years): name="nowPower", icon="mdi:solar-power", native_unit_of_measurement=UnitOfPower.WATT, - device_class=SensorDeviceClass.POWER, + device_class=SensorDeviceClass.ENERGY, ), SensorEntityDescription( key="runningState", @@ -275,14 +275,14 @@ def add_years(d, years): name="peakPower", icon="mdi:solar-panel", native_unit_of_measurement=UnitOfPower.WATT, - device_class=SensorDeviceClass.POWER, + device_class=SensorDeviceClass.ENERGY, ), SensorEntityDescription( key="systemPower", name="systemPower", icon="mdi:solar-panel", native_unit_of_measurement=UnitOfPower.WATT, - device_class=SensorDeviceClass.POWER, + device_class=SensorDeviceClass.ENERGY, ), SensorEntityDescription( key="pvElec", @@ -370,7 +370,7 @@ def add_years(d, years): name="totalLoadPower", icon="mdi:solar-panel", native_unit_of_measurement=UnitOfPower.WATT, - device_class=SensorDeviceClass.POWER, + device_class=SensorDeviceClass.ENERGY, ), SensorEntityDescription( key="totalPvgenPower",