Add entity translations to Tuya (#96842)

This commit is contained in:
Joost Lekkerkerker 2023-07-19 12:43:15 +02:00 committed by GitHub
parent 6ffb1c3c2d
commit efbd82b5fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 912 additions and 379 deletions

View file

@ -49,7 +49,7 @@ class TuyaSensorEntityDescription(SensorEntityDescription):
BATTERY_SENSORS: tuple[TuyaSensorEntityDescription, ...] = (
TuyaSensorEntityDescription(
key=DPCode.BATTERY_PERCENTAGE,
name="Battery",
translation_key="battery",
native_unit_of_measurement=PERCENTAGE,
device_class=SensorDeviceClass.BATTERY,
state_class=SensorStateClass.MEASUREMENT,
@ -57,20 +57,20 @@ BATTERY_SENSORS: tuple[TuyaSensorEntityDescription, ...] = (
),
TuyaSensorEntityDescription(
key=DPCode.BATTERY_STATE,
name="Battery state",
translation_key="battery_state",
icon="mdi:battery",
entity_category=EntityCategory.DIAGNOSTIC,
),
TuyaSensorEntityDescription(
key=DPCode.BATTERY_VALUE,
name="Battery",
translation_key="battery",
device_class=SensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VA_BATTERY,
name="Battery",
translation_key="battery",
device_class=SensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
@ -87,73 +87,74 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"dgnbj": (
TuyaSensorEntityDescription(
key=DPCode.GAS_SENSOR_VALUE,
name="Gas",
translation_key="gas",
icon="mdi:gas-cylinder",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CH4_SENSOR_VALUE,
translation_key="gas",
name="Methane",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE,
name="Volatile organic compound",
translation_key="voc",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE,
name="Particulate matter 2.5 µm",
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CO_VALUE,
name="Carbon monoxide",
translation_key="carbon_monoxide",
icon="mdi:molecule-co",
device_class=SensorDeviceClass.CO,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE,
name="Carbon dioxide",
translation_key="carbon_dioxide",
icon="mdi:molecule-co2",
device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CH2O_VALUE,
name="Formaldehyde",
translation_key="formaldehyde",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.BRIGHT_STATE,
name="Luminosity",
translation_key="luminosity",
icon="mdi:brightness-6",
),
TuyaSensorEntityDescription(
key=DPCode.BRIGHT_VALUE,
name="Luminosity",
translation_key="illuminance",
icon="mdi:brightness-6",
device_class=SensorDeviceClass.ILLUMINANCE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_VALUE,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.SMOKE_SENSOR_VALUE,
name="Smoke amount",
translation_key="smoke_amount",
icon="mdi:smoke-detector",
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
@ -165,19 +166,19 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"bh": (
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Current temperature",
translation_key="current_temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT_F,
name="Current temperature",
translation_key="current_temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.STATUS,
name="Status",
translation_key="status",
),
),
# CO2 Detector
@ -185,19 +186,19 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"co2bj": (
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_VALUE,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE,
name="Carbon dioxide",
translation_key="carbon_dioxide",
device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT,
),
@ -209,13 +210,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"wkcz": (
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_VALUE,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
@ -225,7 +226,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"cobj": (
TuyaSensorEntityDescription(
key=DPCode.CO_VALUE,
name="Carbon monoxide",
translation_key="carbon_monoxide",
device_class=SensorDeviceClass.CO,
state_class=SensorStateClass.MEASUREMENT,
),
@ -236,7 +237,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"cwwsq": (
TuyaSensorEntityDescription(
key=DPCode.FEED_REPORT,
name="Last amount",
translation_key="last_amount",
icon="mdi:counter",
state_class=SensorStateClass.MEASUREMENT,
),
@ -246,36 +247,36 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"hjjcy": (
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_VALUE,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE,
name="Carbon dioxide",
translation_key="carbon_dioxide",
device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CH2O_VALUE,
name="Formaldehyde",
translation_key="formaldehyde",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE,
name="Volatile organic compound",
translation_key="voc",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE,
name="Particulate matter 2.5 µm",
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT,
),
@ -285,37 +286,37 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"jqbj": (
TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE,
name="Carbon dioxide",
translation_key="carbon_dioxide",
device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE,
name="Volatile organic compound",
translation_key="voc",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE,
name="Particulate matter 2.5 µm",
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VA_HUMIDITY,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VA_TEMPERATURE,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CH2O_VALUE,
name="Formaldehyde",
translation_key="formaldehyde",
state_class=SensorStateClass.MEASUREMENT,
),
*BATTERY_SENSORS,
@ -325,7 +326,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"jwbj": (
TuyaSensorEntityDescription(
key=DPCode.CH4_SENSOR_VALUE,
name="Methane",
translation_key="methane",
state_class=SensorStateClass.MEASUREMENT,
),
*BATTERY_SENSORS,
@ -335,21 +336,21 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"kg": (
TuyaSensorEntityDescription(
key=DPCode.CUR_CURRENT,
name="Current",
translation_key="current",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
TuyaSensorEntityDescription(
key=DPCode.CUR_POWER,
name="Power",
translation_key="power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
TuyaSensorEntityDescription(
key=DPCode.CUR_VOLTAGE,
name="Voltage",
translation_key="voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
@ -360,21 +361,21 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"tdq": (
TuyaSensorEntityDescription(
key=DPCode.CUR_CURRENT,
name="Current",
translation_key="current",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
TuyaSensorEntityDescription(
key=DPCode.CUR_POWER,
name="Power",
translation_key="power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
TuyaSensorEntityDescription(
key=DPCode.CUR_VOLTAGE,
name="Voltage",
translation_key="voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
@ -385,30 +386,30 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"ldcg": (
TuyaSensorEntityDescription(
key=DPCode.BRIGHT_STATE,
name="Luminosity",
translation_key="luminosity",
icon="mdi:brightness-6",
),
TuyaSensorEntityDescription(
key=DPCode.BRIGHT_VALUE,
name="Luminosity",
translation_key="illuminance",
device_class=SensorDeviceClass.ILLUMINANCE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_VALUE,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE,
name="Carbon dioxide",
translation_key="carbon_dioxide",
device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT,
),
@ -425,18 +426,17 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"mzj": (
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Current temperature",
translation_key="current_temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.STATUS,
name="Status",
translation_key="status",
translation_key="sous_vide_status",
),
TuyaSensorEntityDescription(
key=DPCode.REMAIN_TIME,
name="Remaining time",
translation_key="remaining_time",
native_unit_of_measurement=UnitOfTime.MINUTES,
icon="mdi:timer",
),
@ -449,48 +449,48 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"pm2.5": (
TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE,
name="Particulate matter 2.5 µm",
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CH2O_VALUE,
name="Formaldehyde",
translation_key="formaldehyde",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE,
name="Volatile organic compound",
translation_key="voc",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE,
name="Carbon dioxide",
translation_key="carbon_dioxide",
device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_VALUE,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.PM1,
name="Particulate matter 1.0 µm",
translation_key="pm1",
device_class=SensorDeviceClass.PM1,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.PM10,
name="Particulate matter 10.0 µm",
translation_key="pm10",
device_class=SensorDeviceClass.PM10,
state_class=SensorStateClass.MEASUREMENT,
),
@ -501,7 +501,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"qn": (
TuyaSensorEntityDescription(
key=DPCode.WORK_POWER,
name="Power",
translation_key="power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
@ -528,19 +528,19 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"sp": (
TuyaSensorEntityDescription(
key=DPCode.SENSOR_TEMPERATURE,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.SENSOR_HUMIDITY,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.WIRELESS_ELECTRICITY,
name="Battery",
translation_key="battery",
device_class=SensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
@ -556,36 +556,36 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"voc": (
TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE,
name="Carbon dioxide",
translation_key="carbon_dioxide",
device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE,
name="Particulate matter 2.5 µm",
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CH2O_VALUE,
name="Formaldehyde",
translation_key="formaldehyde",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_VALUE,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE,
name="Volatile organic compound",
translation_key="voc",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT,
),
@ -599,31 +599,31 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"wsdcg": (
TuyaSensorEntityDescription(
key=DPCode.VA_TEMPERATURE,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VA_HUMIDITY,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_VALUE,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.BRIGHT_VALUE,
name="Luminosity",
translation_key="illuminance",
device_class=SensorDeviceClass.ILLUMINANCE,
state_class=SensorStateClass.MEASUREMENT,
),
@ -645,7 +645,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"ywbj": (
TuyaSensorEntityDescription(
key=DPCode.SMOKE_SENSOR_VALUE,
name="Smoke amount",
translation_key="smoke_amount",
icon="mdi:smoke-detector",
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
@ -660,13 +660,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"zndb": (
TuyaSensorEntityDescription(
key=DPCode.FORWARD_ENERGY_TOTAL,
name="Total energy",
translation_key="total_energy",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_A,
name="Phase A current",
translation_key="phase_a_current",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
@ -674,7 +674,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_A,
name="Phase A power",
translation_key="phase_a_power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
@ -682,7 +682,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_A,
name="Phase A voltage",
translation_key="phase_a_voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
@ -690,7 +690,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_B,
name="Phase B current",
translation_key="phase_b_current",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
@ -698,7 +698,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_B,
name="Phase B power",
translation_key="phase_b_power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
@ -706,7 +706,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_B,
name="Phase B voltage",
translation_key="phase_b_voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
@ -714,7 +714,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_C,
name="Phase C current",
translation_key="phase_c_current",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
@ -722,7 +722,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_C,
name="Phase C power",
translation_key="phase_c_power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
@ -730,7 +730,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_C,
name="Phase C voltage",
translation_key="phase_c_voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
@ -742,13 +742,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"dlq": (
TuyaSensorEntityDescription(
key=DPCode.TOTAL_FORWARD_ENERGY,
name="Total energy",
translation_key="total_energy",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_A,
name="Phase A current",
translation_key="phase_a_current",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
@ -756,7 +756,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_A,
name="Phase A power",
translation_key="phase_a_power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
@ -764,7 +764,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_A,
name="Phase A voltage",
translation_key="phase_a_voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
@ -772,7 +772,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_B,
name="Phase B current",
translation_key="phase_b_current",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
@ -780,7 +780,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_B,
name="Phase B power",
translation_key="phase_b_power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
@ -788,7 +788,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_B,
name="Phase B voltage",
translation_key="phase_b_voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
@ -796,7 +796,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_C,
name="Phase C current",
translation_key="phase_c_current",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
@ -804,7 +804,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_C,
name="Phase C power",
translation_key="phase_c_power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
@ -812,7 +812,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
TuyaSensorEntityDescription(
key=DPCode.PHASE_C,
name="Phase C voltage",
translation_key="phase_c_voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
@ -824,55 +824,55 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"sd": (
TuyaSensorEntityDescription(
key=DPCode.CLEAN_AREA,
name="Cleaning area",
translation_key="cleaning_area",
icon="mdi:texture-box",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.CLEAN_TIME,
name="Cleaning time",
translation_key="cleaning_time",
icon="mdi:progress-clock",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TOTAL_CLEAN_AREA,
name="Total cleaning area",
translation_key="total_cleaning_area",
icon="mdi:texture-box",
state_class=SensorStateClass.TOTAL_INCREASING,
),
TuyaSensorEntityDescription(
key=DPCode.TOTAL_CLEAN_TIME,
name="Total cleaning time",
translation_key="total_cleaning_time",
icon="mdi:history",
state_class=SensorStateClass.TOTAL_INCREASING,
),
TuyaSensorEntityDescription(
key=DPCode.TOTAL_CLEAN_COUNT,
name="Total cleaning times",
translation_key="total_cleaning_times",
icon="mdi:counter",
state_class=SensorStateClass.TOTAL_INCREASING,
),
TuyaSensorEntityDescription(
key=DPCode.DUSTER_CLOTH,
name="Duster cloth lifetime",
translation_key="duster_cloth_life",
icon="mdi:ticket-percent-outline",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.EDGE_BRUSH,
name="Side brush lifetime",
translation_key="side_brush_life",
icon="mdi:ticket-percent-outline",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.FILTER_LIFE,
name="Filter lifetime",
translation_key="filter_life",
icon="mdi:ticket-percent-outline",
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.ROLL_BRUSH,
name="Rolling brush lifetime",
translation_key="rolling_brush_life",
icon="mdi:ticket-percent-outline",
state_class=SensorStateClass.MEASUREMENT,
),
@ -882,7 +882,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"cl": (
TuyaSensorEntityDescription(
key=DPCode.TIME_TOTAL,
name="Last operation duration",
translation_key="last_operation_duration",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:progress-clock",
),
@ -892,25 +892,25 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"jsq": (
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_CURRENT,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT_F,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.LEVEL_CURRENT,
name="Water level",
translation_key="water_level",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:waves-arrow-up",
),
@ -920,60 +920,59 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"kj": (
TuyaSensorEntityDescription(
key=DPCode.FILTER,
name="Filter utilization",
translation_key="filter_utilization",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:ticket-percent-outline",
),
TuyaSensorEntityDescription(
key=DPCode.PM25,
name="Particulate matter 2.5 µm",
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:molecule",
),
TuyaSensorEntityDescription(
key=DPCode.TEMP,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TVOC,
name="Total volatile organic compound",
translation_key="total_volatile_organic_compound",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.ECO2,
name="Concentration of carbon dioxide",
translation_key="concentration_carbon_dioxide",
device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TOTAL_TIME,
name="Total operating time",
translation_key="total_operating_time",
icon="mdi:history",
state_class=SensorStateClass.TOTAL_INCREASING,
entity_category=EntityCategory.DIAGNOSTIC,
),
TuyaSensorEntityDescription(
key=DPCode.TOTAL_PM,
name="Total absorption of particles",
translation_key="total_absorption_particles",
icon="mdi:texture-box",
state_class=SensorStateClass.TOTAL_INCREASING,
entity_category=EntityCategory.DIAGNOSTIC,
),
TuyaSensorEntityDescription(
key=DPCode.AIR_QUALITY,
name="Air quality",
icon="mdi:air-filter",
translation_key="air_quality",
icon="mdi:air-filter",
),
),
# Fan
@ -981,7 +980,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"fs": (
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
@ -990,13 +989,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"wnykq": (
TuyaSensorEntityDescription(
key=DPCode.VA_TEMPERATURE,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.VA_HUMIDITY,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
@ -1006,13 +1005,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"cs": (
TuyaSensorEntityDescription(
key=DPCode.TEMP_INDOOR,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_INDOOR,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
@ -1021,13 +1020,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"zwjcy": (
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY,
name="Humidity",
translation_key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),