Home Assistant Unofficial Reference 2024.12.1
total.py
Go to the documentation of this file.
1 """SunWEG 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 SunWEGSensorEntityDescription
9 
10 TOTAL_SENSOR_TYPES: tuple[SunWEGSensorEntityDescription, ...] = (
12  key="total_money_total",
13  name="Money lifetime",
14  api_variable_key="_saving",
15  icon="mdi:cash",
16  native_unit_of_measurement="R$",
17  suggested_display_precision=2,
18  ),
20  key="total_energy_today",
21  name="Energy Today",
22  api_variable_key="_today_energy",
23  api_variable_unit="_today_energy_metric",
24  native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
25  device_class=SensorDeviceClass.ENERGY,
26  state_class=SensorStateClass.TOTAL_INCREASING,
27  ),
29  key="total_output_power",
30  name="Output Power",
31  api_variable_key="_total_power",
32  native_unit_of_measurement=UnitOfPower.KILO_WATT,
33  device_class=SensorDeviceClass.POWER,
34  ),
36  key="total_energy_output",
37  name="Lifetime energy output",
38  api_variable_key="_total_energy",
39  native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
40  device_class=SensorDeviceClass.ENERGY,
41  state_class=SensorStateClass.TOTAL,
42  never_resets=True,
43  ),
45  key="last_update",
46  name="Last Update",
47  api_variable_key="_last_update",
48  device_class=SensorDeviceClass.DATE,
49  ),
50 )