Home Assistant Unofficial Reference 2024.12.1
total.py
Go to the documentation of this file.
1 """Growatt Sensor definitions for Totals."""
2 
3 from __future__ import annotations
4 
5 from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
6 from homeassistant.const import UnitOfEnergy, UnitOfPower
7 
8 from .sensor_entity_description import GrowattSensorEntityDescription
9 
10 TOTAL_SENSOR_TYPES: tuple[GrowattSensorEntityDescription, ...] = (
12  key="total_money_today",
13  translation_key="total_money_today",
14  api_key="plantMoneyText",
15  currency=True,
16  ),
18  key="total_money_total",
19  translation_key="total_money_total",
20  api_key="totalMoneyText",
21  currency=True,
22  ),
24  key="total_energy_today",
25  translation_key="total_energy_today",
26  api_key="todayEnergy",
27  native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
28  device_class=SensorDeviceClass.ENERGY,
29  ),
31  key="total_output_power",
32  translation_key="total_output_power",
33  api_key="invTodayPpv",
34  native_unit_of_measurement=UnitOfPower.WATT,
35  device_class=SensorDeviceClass.POWER,
36  ),
38  key="total_energy_output",
39  translation_key="total_energy_output",
40  api_key="totalEnergy",
41  native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
42  device_class=SensorDeviceClass.ENERGY,
43  state_class=SensorStateClass.TOTAL,
44  ),
46  key="total_maximum_output",
47  translation_key="total_maximum_output",
48  api_key="nominalPower",
49  native_unit_of_measurement=UnitOfPower.WATT,
50  device_class=SensorDeviceClass.POWER,
51  ),
52 )