Add Tuya reverse_energy_total and total_power sensors (#114801)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Michael Oborne 2024-06-22 19:58:54 +10:00 committed by GitHub
parent 03d8f4162e
commit 1bbfe7854f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View File

@ -345,6 +345,7 @@ class DPCode(StrEnum):
TOTAL_FORWARD_ENERGY = "total_forward_energy"
TOTAL_TIME = "total_time"
TOTAL_PM = "total_pm"
TOTAL_POWER = "total_power"
TVOC = "tvoc"
UPPER_TEMP = "upper_temp"
UPPER_TEMP_F = "upper_temp_f"

View File

@ -696,6 +696,20 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
TuyaSensorEntityDescription(
key=DPCode.REVERSE_ENERGY_TOTAL,
translation_key="total_energy",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
TuyaSensorEntityDescription(
key=DPCode.TOTAL_POWER,
translation_key="total_power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
subkey="power",
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_A,
translation_key="phase_a_current",