mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add sensor total production energy for Tuya (#113565)
This commit is contained in:
parent
ed2ad5ceaa
commit
03d8f4162e
@ -166,6 +166,7 @@ class DPCode(StrEnum):
|
||||
CRY_DETECTION_SWITCH = "cry_detection_switch"
|
||||
CUP_NUMBER = "cup_number" # NUmber of cups
|
||||
CUR_CURRENT = "cur_current" # Actual current
|
||||
CUR_NEUTRAL = "cur_neutral" # Total reverse energy
|
||||
CUR_POWER = "cur_power" # Actual power
|
||||
CUR_VOLTAGE = "cur_voltage" # Actual voltage
|
||||
DECIBEL_SENSITIVITY = "decibel_sensitivity"
|
||||
@ -444,7 +445,7 @@ UNITS = (
|
||||
),
|
||||
UnitOfMeasurement(
|
||||
unit=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
aliases={"kwh", "kilowatt-hour", "kW·h"},
|
||||
aliases={"kwh", "kilowatt-hour", "kW·h", "kW.h"},
|
||||
device_classes={SensorDeviceClass.ENERGY},
|
||||
),
|
||||
UnitOfMeasurement(
|
||||
|
@ -778,6 +778,12 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
),
|
||||
TuyaSensorEntityDescription(
|
||||
key=DPCode.CUR_NEUTRAL,
|
||||
translation_key="total_production",
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
),
|
||||
TuyaSensorEntityDescription(
|
||||
key=DPCode.PHASE_A,
|
||||
translation_key="phase_a_current",
|
||||
|
@ -517,6 +517,9 @@
|
||||
"total_energy": {
|
||||
"name": "Total energy"
|
||||
},
|
||||
"total_production": {
|
||||
"name": "Total production"
|
||||
},
|
||||
"phase_a_current": {
|
||||
"name": "Phase A current"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user