Skip to content

Commit

Permalink
Merge pull request wills106#1060 from andbad/main
Browse files Browse the repository at this point in the history
Add "state_class" to "battery_charge_cycle_*"
  • Loading branch information
wills106 authored Sep 19, 2024
2 parents 7e3f27d + 63ad0c6 commit 227144b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions custom_components/solax_modbus/plugin_sofar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2284,6 +2284,7 @@ def value_function_sync_rtc_ymd_sofar(initval, descr, datadict):
SofarModbusSensorEntityDescription(
name = "Battery Charge Cycle 1",
key = "battery_charge_cycle_1",
state_class = SensorStateClass.MEASUREMENT,
register = 0x60A,
allowedtypes = HYBRID,
entity_category = EntityCategory.DIAGNOSTIC,
Expand Down Expand Up @@ -2361,6 +2362,7 @@ def value_function_sync_rtc_ymd_sofar(initval, descr, datadict):
SofarModbusSensorEntityDescription(
name = "Battery Charge Cycle 2",
key = "battery_charge_cycle_2",
state_class = SensorStateClass.MEASUREMENT,
register = 0x611,
entity_registry_enabled_default = False,
allowedtypes = HYBRID,
Expand Down Expand Up @@ -2438,6 +2440,7 @@ def value_function_sync_rtc_ymd_sofar(initval, descr, datadict):
SofarModbusSensorEntityDescription(
name = "Battery Charge Cycle 3",
key = "battery_charge_cycle_3",
state_class = SensorStateClass.MEASUREMENT,
register = 0x618,
entity_registry_enabled_default = False,
allowedtypes = HYBRID | GEN,
Expand Down Expand Up @@ -2515,6 +2518,7 @@ def value_function_sync_rtc_ymd_sofar(initval, descr, datadict):
SofarModbusSensorEntityDescription(
name = "Battery Charge Cycle 4",
key = "battery_charge_cycle_4",
state_class = SensorStateClass.MEASUREMENT,
register = 0x61F,
entity_registry_enabled_default = False,
allowedtypes = HYBRID | GEN,
Expand Down Expand Up @@ -2592,6 +2596,7 @@ def value_function_sync_rtc_ymd_sofar(initval, descr, datadict):
SofarModbusSensorEntityDescription(
name = "Battery Charge Cycle 5",
key = "battery_charge_cycle_5",
state_class = SensorStateClass.MEASUREMENT,
register = 0x626,
entity_registry_enabled_default = False,
allowedtypes = HYBRID | GEN,
Expand Down Expand Up @@ -2669,6 +2674,7 @@ def value_function_sync_rtc_ymd_sofar(initval, descr, datadict):
SofarModbusSensorEntityDescription(
name = "Battery Charge Cycle 6",
key = "battery_charge_cycle_6",
state_class = SensorStateClass.MEASUREMENT,
register = 0x62D,
entity_registry_enabled_default = False,
allowedtypes = HYBRID | GEN,
Expand Down Expand Up @@ -2746,6 +2752,7 @@ def value_function_sync_rtc_ymd_sofar(initval, descr, datadict):
SofarModbusSensorEntityDescription(
name = "Battery Charge Cycle 7",
key = "battery_charge_cycle_7",
state_class = SensorStateClass.MEASUREMENT,
register = 0x634,
entity_registry_enabled_default = False,
allowedtypes = HYBRID | GEN,
Expand Down Expand Up @@ -2823,6 +2830,7 @@ def value_function_sync_rtc_ymd_sofar(initval, descr, datadict):
SofarModbusSensorEntityDescription(
name = "Battery Charge Cycle 8",
key = "battery_charge_cycle_8",
state_class = SensorStateClass.MEASUREMENT,
register = 0x63B,
entity_registry_enabled_default = False,
allowedtypes = HYBRID | GEN,
Expand Down

0 comments on commit 227144b

Please # to comment.