Skip to content

Commit

Permalink
Fix state_class and device_class of Battery total (dis)charge entities
Browse files Browse the repository at this point in the history
Fixes #684
  • Loading branch information
wlcrs committed Apr 16, 2024
1 parent 472a578 commit d4816a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,14 +598,14 @@ def context(self):
icon="mdi:battery-plus-variant",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL,
device_class=SensorDeviceClass.ENERGY,
device_class=SensorDeviceClass.ENERGY_STORAGE,
),
HuaweiSolarSensorEntityDescription(
key=rn.STORAGE_TOTAL_DISCHARGE,
icon="mdi:battery-minus-variant",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL,
device_class=SensorDeviceClass.ENERGY,
device_class=SensorDeviceClass.ENERGY_STORAGE,
),
HuaweiSolarSensorEntityDescription(
key=rn.STORAGE_CURRENT_DAY_CHARGE_CAPACITY,
Expand Down Expand Up @@ -719,7 +719,7 @@ class BatteryTemplateEntityDescription:
translation_key="storage_total_charge",
icon="mdi:battery-plus-variant",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL,
device_class=SensorDeviceClass.ENERGY_STORAGE,
),
BatteryTemplateEntityDescription(
Expand All @@ -728,7 +728,7 @@ class BatteryTemplateEntityDescription:
translation_key="storage_total_discharge",
icon="mdi:battery-minus-variant",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL,
device_class=SensorDeviceClass.ENERGY_STORAGE,
),
BatteryTemplateEntityDescription(
Expand Down

0 comments on commit d4816a0

Please sign in to comment.