mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +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"
|
CRY_DETECTION_SWITCH = "cry_detection_switch"
|
||||||
CUP_NUMBER = "cup_number" # NUmber of cups
|
CUP_NUMBER = "cup_number" # NUmber of cups
|
||||||
CUR_CURRENT = "cur_current" # Actual current
|
CUR_CURRENT = "cur_current" # Actual current
|
||||||
|
CUR_NEUTRAL = "cur_neutral" # Total reverse energy
|
||||||
CUR_POWER = "cur_power" # Actual power
|
CUR_POWER = "cur_power" # Actual power
|
||||||
CUR_VOLTAGE = "cur_voltage" # Actual voltage
|
CUR_VOLTAGE = "cur_voltage" # Actual voltage
|
||||||
DECIBEL_SENSITIVITY = "decibel_sensitivity"
|
DECIBEL_SENSITIVITY = "decibel_sensitivity"
|
||||||
@ -444,7 +445,7 @@ UNITS = (
|
|||||||
),
|
),
|
||||||
UnitOfMeasurement(
|
UnitOfMeasurement(
|
||||||
unit=UnitOfEnergy.KILO_WATT_HOUR,
|
unit=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
aliases={"kwh", "kilowatt-hour", "kW·h"},
|
aliases={"kwh", "kilowatt-hour", "kW·h", "kW.h"},
|
||||||
device_classes={SensorDeviceClass.ENERGY},
|
device_classes={SensorDeviceClass.ENERGY},
|
||||||
),
|
),
|
||||||
UnitOfMeasurement(
|
UnitOfMeasurement(
|
||||||
|
@ -778,6 +778,12 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
|||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.CUR_NEUTRAL,
|
||||||
|
translation_key="total_production",
|
||||||
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
),
|
||||||
TuyaSensorEntityDescription(
|
TuyaSensorEntityDescription(
|
||||||
key=DPCode.PHASE_A,
|
key=DPCode.PHASE_A,
|
||||||
translation_key="phase_a_current",
|
translation_key="phase_a_current",
|
||||||
|
@ -517,6 +517,9 @@
|
|||||||
"total_energy": {
|
"total_energy": {
|
||||||
"name": "Total energy"
|
"name": "Total energy"
|
||||||
},
|
},
|
||||||
|
"total_production": {
|
||||||
|
"name": "Total production"
|
||||||
|
},
|
||||||
"phase_a_current": {
|
"phase_a_current": {
|
||||||
"name": "Phase A current"
|
"name": "Phase A current"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user