mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Define state_class for Growatt inverter entities (#121516)
This commit is contained in:
parent
5f909d0c52
commit
3e8335f61b
@ -21,6 +21,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="powerToday",
|
api_key="powerToday",
|
||||||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -38,6 +39,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="vpv1",
|
api_key="vpv1",
|
||||||
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||||
device_class=SensorDeviceClass.VOLTAGE,
|
device_class=SensorDeviceClass.VOLTAGE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=2,
|
precision=2,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -46,6 +48,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="ipv1",
|
api_key="ipv1",
|
||||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||||
device_class=SensorDeviceClass.CURRENT,
|
device_class=SensorDeviceClass.CURRENT,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -54,6 +57,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="ppv1",
|
api_key="ppv1",
|
||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -62,6 +66,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="vpv2",
|
api_key="vpv2",
|
||||||
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||||
device_class=SensorDeviceClass.VOLTAGE,
|
device_class=SensorDeviceClass.VOLTAGE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -70,6 +75,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="ipv2",
|
api_key="ipv2",
|
||||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||||
device_class=SensorDeviceClass.CURRENT,
|
device_class=SensorDeviceClass.CURRENT,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -78,6 +84,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="ppv2",
|
api_key="ppv2",
|
||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -86,6 +93,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="vpv3",
|
api_key="vpv3",
|
||||||
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||||
device_class=SensorDeviceClass.VOLTAGE,
|
device_class=SensorDeviceClass.VOLTAGE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -94,6 +102,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="ipv3",
|
api_key="ipv3",
|
||||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||||
device_class=SensorDeviceClass.CURRENT,
|
device_class=SensorDeviceClass.CURRENT,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -102,6 +111,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="ppv3",
|
api_key="ppv3",
|
||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -110,6 +120,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="ppv",
|
api_key="ppv",
|
||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -118,6 +129,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="vacr",
|
api_key="vacr",
|
||||||
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||||
device_class=SensorDeviceClass.VOLTAGE,
|
device_class=SensorDeviceClass.VOLTAGE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -126,6 +138,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="iacr",
|
api_key="iacr",
|
||||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||||
device_class=SensorDeviceClass.CURRENT,
|
device_class=SensorDeviceClass.CURRENT,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -134,6 +147,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="fac",
|
api_key="fac",
|
||||||
native_unit_of_measurement=UnitOfFrequency.HERTZ,
|
native_unit_of_measurement=UnitOfFrequency.HERTZ,
|
||||||
device_class=SensorDeviceClass.FREQUENCY,
|
device_class=SensorDeviceClass.FREQUENCY,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -142,6 +156,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="pac",
|
api_key="pac",
|
||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -150,6 +165,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="pacr",
|
api_key="pacr",
|
||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -158,6 +174,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="ipmTemperature",
|
api_key="ipmTemperature",
|
||||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
GrowattSensorEntityDescription(
|
GrowattSensorEntityDescription(
|
||||||
@ -166,6 +183,7 @@ INVERTER_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
|
|||||||
api_key="temperature",
|
api_key="temperature",
|
||||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user