Migrate Tuya to new entity naming style (#74975)

This commit is contained in:
Franck Nijhof 2022-07-11 18:17:54 +02:00 committed by GitHub
parent 75abf87611
commit 8d6925b3ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 125 additions and 134 deletions

View File

@ -131,6 +131,7 @@ class ElectricityTypeData:
class TuyaEntity(Entity): class TuyaEntity(Entity):
"""Tuya base device.""" """Tuya base device."""
_attr_has_entity_name = True
_attr_should_poll = False _attr_should_poll = False
def __init__(self, device: TuyaDevice, device_manager: TuyaDeviceManager) -> None: def __init__(self, device: TuyaDevice, device_manager: TuyaDeviceManager) -> None:
@ -139,16 +140,6 @@ class TuyaEntity(Entity):
self.device = device self.device = device
self.device_manager = device_manager self.device_manager = device_manager
@property
def name(self) -> str | None:
"""Return Tuya device name."""
if (
hasattr(self, "entity_description")
and self.entity_description.name is not None
):
return f"{self.device.name} {self.entity_description.name}"
return self.device.name
@property @property
def device_info(self) -> DeviceInfo: def device_info(self) -> DeviceInfo:
"""Return a device description for device registry.""" """Return a device description for device registry."""

View File

@ -64,19 +64,19 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
), ),
TuyaBinarySensorEntityDescription( TuyaBinarySensorEntityDescription(
key=DPCode.VOC_STATE, key=DPCode.VOC_STATE,
name="Volatile Organic Compound", name="Volatile organic compound",
device_class=BinarySensorDeviceClass.SAFETY, device_class=BinarySensorDeviceClass.SAFETY,
on_value="alarm", on_value="alarm",
), ),
TuyaBinarySensorEntityDescription( TuyaBinarySensorEntityDescription(
key=DPCode.PM25_STATE, key=DPCode.PM25_STATE,
name="Particulate Matter 2.5 µm", name="Particulate matter 2.5 µm",
device_class=BinarySensorDeviceClass.SAFETY, device_class=BinarySensorDeviceClass.SAFETY,
on_value="alarm", on_value="alarm",
), ),
TuyaBinarySensorEntityDescription( TuyaBinarySensorEntityDescription(
key=DPCode.CO_STATE, key=DPCode.CO_STATE,
name="Carbon Monoxide", name="Carbon monoxide",
icon="mdi:molecule-co", icon="mdi:molecule-co",
device_class=BinarySensorDeviceClass.SAFETY, device_class=BinarySensorDeviceClass.SAFETY,
on_value="alarm", on_value="alarm",
@ -84,7 +84,7 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
TuyaBinarySensorEntityDescription( TuyaBinarySensorEntityDescription(
key=DPCode.CO2_STATE, key=DPCode.CO2_STATE,
icon="mdi:molecule-co2", icon="mdi:molecule-co2",
name="Carbon Dioxide", name="Carbon dioxide",
device_class=BinarySensorDeviceClass.SAFETY, device_class=BinarySensorDeviceClass.SAFETY,
on_value="alarm", on_value="alarm",
), ),
@ -101,7 +101,7 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
), ),
TuyaBinarySensorEntityDescription( TuyaBinarySensorEntityDescription(
key=DPCode.WATERSENSOR_STATE, key=DPCode.WATERSENSOR_STATE,
name="Water Leak", name="Water leak",
device_class=BinarySensorDeviceClass.MOISTURE, device_class=BinarySensorDeviceClass.MOISTURE,
on_value="alarm", on_value="alarm",
), ),

View File

@ -22,31 +22,31 @@ BUTTONS: dict[str, tuple[ButtonEntityDescription, ...]] = {
"sd": ( "sd": (
ButtonEntityDescription( ButtonEntityDescription(
key=DPCode.RESET_DUSTER_CLOTH, key=DPCode.RESET_DUSTER_CLOTH,
name="Reset Duster Cloth", name="Reset duster cloth",
icon="mdi:restart", icon="mdi:restart",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
ButtonEntityDescription( ButtonEntityDescription(
key=DPCode.RESET_EDGE_BRUSH, key=DPCode.RESET_EDGE_BRUSH,
name="Reset Edge Brush", name="Reset edge brush",
icon="mdi:restart", icon="mdi:restart",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
ButtonEntityDescription( ButtonEntityDescription(
key=DPCode.RESET_FILTER, key=DPCode.RESET_FILTER,
name="Reset Filter", name="Reset filter",
icon="mdi:air-filter", icon="mdi:air-filter",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
ButtonEntityDescription( ButtonEntityDescription(
key=DPCode.RESET_MAP, key=DPCode.RESET_MAP,
name="Reset Map", name="Reset map",
icon="mdi:map-marker-remove", icon="mdi:map-marker-remove",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
ButtonEntityDescription( ButtonEntityDescription(
key=DPCode.RESET_ROLL_BRUSH, key=DPCode.RESET_ROLL_BRUSH,
name="Reset Roll Brush", name="Reset roll brush",
icon="mdi:restart", icon="mdi:restart",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),

View File

@ -299,7 +299,7 @@ LIGHTS: dict[str, tuple[TuyaLightEntityDescription, ...]] = {
), ),
TuyaLightEntityDescription( TuyaLightEntityDescription(
key=DPCode.SWITCH_NIGHT_LIGHT, key=DPCode.SWITCH_NIGHT_LIGHT,
name="Night Light", name="Night light",
), ),
), ),
# Remote Control # Remote Control

View File

@ -51,21 +51,21 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.TEMP_BOILING_C, key=DPCode.TEMP_BOILING_C,
name="Temperature After Boiling", name="Temperature after boiling",
device_class=NumberDeviceClass.TEMPERATURE, device_class=NumberDeviceClass.TEMPERATURE,
icon="mdi:thermometer", icon="mdi:thermometer",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.TEMP_BOILING_F, key=DPCode.TEMP_BOILING_F,
name="Temperature After Boiling", name="Temperature after boiling",
device_class=NumberDeviceClass.TEMPERATURE, device_class=NumberDeviceClass.TEMPERATURE,
icon="mdi:thermometer", icon="mdi:thermometer",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.WARM_TIME, key=DPCode.WARM_TIME,
name="Heat Preservation Time", name="Heat preservation time",
icon="mdi:timer", icon="mdi:timer",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -80,7 +80,7 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.VOICE_TIMES, key=DPCode.VOICE_TIMES,
name="Voice Times", name="Voice times",
icon="mdi:microphone", icon="mdi:microphone",
), ),
), ),
@ -94,13 +94,13 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.NEAR_DETECTION, key=DPCode.NEAR_DETECTION,
name="Near Detection", name="Near detection",
icon="mdi:signal-distance-variant", icon="mdi:signal-distance-variant",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.FAR_DETECTION, key=DPCode.FAR_DETECTION,
name="Far Detection", name="Far detection",
icon="mdi:signal-distance-variant", icon="mdi:signal-distance-variant",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -110,7 +110,7 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
"kfj": ( "kfj": (
NumberEntityDescription( NumberEntityDescription(
key=DPCode.WATER_SET, key=DPCode.WATER_SET,
name="Water Level", name="Water level",
icon="mdi:cup-water", icon="mdi:cup-water",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -123,7 +123,7 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.WARM_TIME, key=DPCode.WARM_TIME,
name="Heat Preservation Time", name="Heat preservation time",
icon="mdi:timer", icon="mdi:timer",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -138,20 +138,20 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
"mzj": ( "mzj": (
NumberEntityDescription( NumberEntityDescription(
key=DPCode.COOK_TEMPERATURE, key=DPCode.COOK_TEMPERATURE,
name="Cook Temperature", name="Cook temperature",
icon="mdi:thermometer", icon="mdi:thermometer",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.COOK_TIME, key=DPCode.COOK_TIME,
name="Cook Time", name="Cook time",
icon="mdi:timer", icon="mdi:timer",
native_unit_of_measurement=TIME_MINUTES, native_unit_of_measurement=TIME_MINUTES,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.CLOUD_RECIPE_NUMBER, key=DPCode.CLOUD_RECIPE_NUMBER,
name="Cloud Recipe", name="Cloud recipe",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
), ),
@ -189,37 +189,37 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
"tgkg": ( "tgkg": (
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_1, key=DPCode.BRIGHTNESS_MIN_1,
name="Minimum Brightness", name="Minimum brightness",
icon="mdi:lightbulb-outline", icon="mdi:lightbulb-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_1, key=DPCode.BRIGHTNESS_MAX_1,
name="Maximum Brightness", name="Maximum brightness",
icon="mdi:lightbulb-on-outline", icon="mdi:lightbulb-on-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_2, key=DPCode.BRIGHTNESS_MIN_2,
name="Minimum Brightness 2", name="Minimum brightness 2",
icon="mdi:lightbulb-outline", icon="mdi:lightbulb-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_2, key=DPCode.BRIGHTNESS_MAX_2,
name="Maximum Brightness 2", name="Maximum brightness 2",
icon="mdi:lightbulb-on-outline", icon="mdi:lightbulb-on-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_3, key=DPCode.BRIGHTNESS_MIN_3,
name="Minimum Brightness 3", name="Minimum brightness 3",
icon="mdi:lightbulb-outline", icon="mdi:lightbulb-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_3, key=DPCode.BRIGHTNESS_MAX_3,
name="Maximum Brightness 3", name="Maximum brightness 3",
icon="mdi:lightbulb-on-outline", icon="mdi:lightbulb-on-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -229,25 +229,25 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
"tgq": ( "tgq": (
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_1, key=DPCode.BRIGHTNESS_MIN_1,
name="Minimum Brightness", name="Minimum brightness",
icon="mdi:lightbulb-outline", icon="mdi:lightbulb-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_1, key=DPCode.BRIGHTNESS_MAX_1,
name="Maximum Brightness", name="Maximum brightness",
icon="mdi:lightbulb-on-outline", icon="mdi:lightbulb-on-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_2, key=DPCode.BRIGHTNESS_MIN_2,
name="Minimum Brightness 2", name="Minimum brightness 2",
icon="mdi:lightbulb-outline", icon="mdi:lightbulb-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_2, key=DPCode.BRIGHTNESS_MAX_2,
name="Maximum Brightness 2", name="Maximum brightness 2",
icon="mdi:lightbulb-on-outline", icon="mdi:lightbulb-on-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -265,19 +265,19 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
"szjqr": ( "szjqr": (
NumberEntityDescription( NumberEntityDescription(
key=DPCode.ARM_DOWN_PERCENT, key=DPCode.ARM_DOWN_PERCENT,
name="Move Down %", name="Move down %",
icon="mdi:arrow-down-bold", icon="mdi:arrow-down-bold",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.ARM_UP_PERCENT, key=DPCode.ARM_UP_PERCENT,
name="Move Up %", name="Move up %",
icon="mdi:arrow-up-bold", icon="mdi:arrow-up-bold",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
NumberEntityDescription( NumberEntityDescription(
key=DPCode.CLICK_SUSTAIN_TIME, key=DPCode.CLICK_SUSTAIN_TIME,
name="Down Delay", name="Down delay",
icon="mdi:timer", icon="mdi:timer",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),

View File

@ -57,13 +57,13 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"kg": ( "kg": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.RELAY_STATUS, key=DPCode.RELAY_STATUS,
name="Power on Behavior", name="Power on behavior",
device_class=TuyaDeviceClass.RELAY_STATUS, device_class=TuyaDeviceClass.RELAY_STATUS,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LIGHT_MODE, key=DPCode.LIGHT_MODE,
name="Indicator Light Mode", name="Indicator light mode",
device_class=TuyaDeviceClass.LIGHT_MODE, device_class=TuyaDeviceClass.LIGHT_MODE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -73,7 +73,7 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"qn": ( "qn": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LEVEL, key=DPCode.LEVEL,
name="Temperature Level", name="Temperature level",
icon="mdi:thermometer-lines", icon="mdi:thermometer-lines",
), ),
), ),
@ -96,27 +96,27 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"sp": ( "sp": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.IPC_WORK_MODE, key=DPCode.IPC_WORK_MODE,
name="IPC Mode", name="IPC mode",
device_class=TuyaDeviceClass.IPC_WORK_MODE, device_class=TuyaDeviceClass.IPC_WORK_MODE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.DECIBEL_SENSITIVITY, key=DPCode.DECIBEL_SENSITIVITY,
name="Sound Detection Sensitivity", name="Sound detection densitivity",
icon="mdi:volume-vibrate", icon="mdi:volume-vibrate",
device_class=TuyaDeviceClass.DECIBEL_SENSITIVITY, device_class=TuyaDeviceClass.DECIBEL_SENSITIVITY,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.RECORD_MODE, key=DPCode.RECORD_MODE,
name="Record Mode", name="Record mode",
icon="mdi:record-rec", icon="mdi:record-rec",
device_class=TuyaDeviceClass.RECORD_MODE, device_class=TuyaDeviceClass.RECORD_MODE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.BASIC_NIGHTVISION, key=DPCode.BASIC_NIGHTVISION,
name="Night Vision", name="Night vision",
icon="mdi:theme-light-dark", icon="mdi:theme-light-dark",
device_class=TuyaDeviceClass.BASIC_NIGHTVISION, device_class=TuyaDeviceClass.BASIC_NIGHTVISION,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
@ -130,7 +130,7 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.MOTION_SENSITIVITY, key=DPCode.MOTION_SENSITIVITY,
name="Motion Detection Sensitivity", name="Motion detection sensitivity",
icon="mdi:motion-sensor", icon="mdi:motion-sensor",
device_class=TuyaDeviceClass.MOTION_SENSITIVITY, device_class=TuyaDeviceClass.MOTION_SENSITIVITY,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
@ -141,13 +141,13 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"tdq": ( "tdq": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.RELAY_STATUS, key=DPCode.RELAY_STATUS,
name="Power on Behavior", name="Power on behavior",
device_class=TuyaDeviceClass.RELAY_STATUS, device_class=TuyaDeviceClass.RELAY_STATUS,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LIGHT_MODE, key=DPCode.LIGHT_MODE,
name="Indicator Light Mode", name="Indicator light mode",
device_class=TuyaDeviceClass.LIGHT_MODE, device_class=TuyaDeviceClass.LIGHT_MODE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -157,31 +157,31 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"tgkg": ( "tgkg": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.RELAY_STATUS, key=DPCode.RELAY_STATUS,
name="Power on Behavior", name="Power on behavior",
device_class=TuyaDeviceClass.RELAY_STATUS, device_class=TuyaDeviceClass.RELAY_STATUS,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LIGHT_MODE, key=DPCode.LIGHT_MODE,
name="Indicator Light Mode", name="Indicator light mode",
device_class=TuyaDeviceClass.LIGHT_MODE, device_class=TuyaDeviceClass.LIGHT_MODE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LED_TYPE_1, key=DPCode.LED_TYPE_1,
name="Light Source Type", name="Light source type",
device_class=TuyaDeviceClass.LED_TYPE, device_class=TuyaDeviceClass.LED_TYPE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LED_TYPE_2, key=DPCode.LED_TYPE_2,
name="Light 2 Source Type", name="Light 2 source type",
device_class=TuyaDeviceClass.LED_TYPE, device_class=TuyaDeviceClass.LED_TYPE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LED_TYPE_3, key=DPCode.LED_TYPE_3,
name="Light 3 Source Type", name="Light 3 source type",
device_class=TuyaDeviceClass.LED_TYPE, device_class=TuyaDeviceClass.LED_TYPE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -191,13 +191,13 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"tgq": ( "tgq": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LED_TYPE_1, key=DPCode.LED_TYPE_1,
name="Light Source Type", name="Light source type",
device_class=TuyaDeviceClass.LED_TYPE, device_class=TuyaDeviceClass.LED_TYPE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LED_TYPE_2, key=DPCode.LED_TYPE_2,
name="Light 2 Source Type", name="Light 2 source type",
device_class=TuyaDeviceClass.LED_TYPE, device_class=TuyaDeviceClass.LED_TYPE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
@ -216,14 +216,14 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"sd": ( "sd": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.CISTERN, key=DPCode.CISTERN,
name="Water Tank Adjustment", name="Water tank adjustment",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
device_class=TuyaDeviceClass.VACUUM_CISTERN, device_class=TuyaDeviceClass.VACUUM_CISTERN,
icon="mdi:water-opacity", icon="mdi:water-opacity",
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.COLLECTION_MODE, key=DPCode.COLLECTION_MODE,
name="Dust Collection Mode", name="Dust collection mode",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
device_class=TuyaDeviceClass.VACUUM_COLLECTION, device_class=TuyaDeviceClass.VACUUM_COLLECTION,
icon="mdi:air-filter", icon="mdi:air-filter",
@ -241,14 +241,14 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"fs": ( "fs": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.FAN_VERTICAL, key=DPCode.FAN_VERTICAL,
name="Vertical Swing Flap Angle", name="Vertical swing flap angle",
device_class=TuyaDeviceClass.FAN_ANGLE, device_class=TuyaDeviceClass.FAN_ANGLE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
icon="mdi:format-vertical-align-center", icon="mdi:format-vertical-align-center",
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.FAN_HORIZONTAL, key=DPCode.FAN_HORIZONTAL,
name="Horizontal Swing Flap Angle", name="Horizontal swing flap angle",
device_class=TuyaDeviceClass.FAN_ANGLE, device_class=TuyaDeviceClass.FAN_ANGLE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
icon="mdi:format-horizontal-align-center", icon="mdi:format-horizontal-align-center",
@ -273,7 +273,7 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"cl": ( "cl": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.CONTROL_BACK_MODE, key=DPCode.CONTROL_BACK_MODE,
name="Motor Mode", name="Motor mode",
device_class=TuyaDeviceClass.CURTAIN_MOTOR_MODE, device_class=TuyaDeviceClass.CURTAIN_MOTOR_MODE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
icon="mdi:swap-horizontal", icon="mdi:swap-horizontal",
@ -290,14 +290,14 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
"jsq": ( "jsq": (
SelectEntityDescription( SelectEntityDescription(
key=DPCode.SPRAY_MODE, key=DPCode.SPRAY_MODE,
name="Spray Mode", name="Spray mode",
device_class=TuyaDeviceClass.HUMIDIFIER_SPRAY_MODE, device_class=TuyaDeviceClass.HUMIDIFIER_SPRAY_MODE,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
icon="mdi:spray", icon="mdi:spray",
), ),
SelectEntityDescription( SelectEntityDescription(
key=DPCode.LEVEL, key=DPCode.LEVEL,
name="Spraying Level", name="Spraying level",
device_class=TuyaDeviceClass.HUMIDIFIER_LEVEL, device_class=TuyaDeviceClass.HUMIDIFIER_LEVEL,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
icon="mdi:spray", icon="mdi:spray",

View File

@ -58,7 +58,7 @@ BATTERY_SENSORS: tuple[TuyaSensorEntityDescription, ...] = (
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.BATTERY_STATE, key=DPCode.BATTERY_STATE,
name="Battery State", name="Battery state",
icon="mdi:battery", icon="mdi:battery",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
), ),
@ -99,26 +99,26 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE, key=DPCode.VOC_VALUE,
name="Volatile Organic Compound", name="Volatile organic compound",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS, device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE, key=DPCode.PM25_VALUE,
name="Particulate Matter 2.5 µm", name="Particulate matter 2.5 µm",
device_class=SensorDeviceClass.PM25, device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CO_VALUE, key=DPCode.CO_VALUE,
name="Carbon Monoxide", name="Carbon monoxide",
icon="mdi:molecule-co", icon="mdi:molecule-co",
device_class=SensorDeviceClass.CO, device_class=SensorDeviceClass.CO,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE, key=DPCode.CO2_VALUE,
name="Carbon Dioxide", name="Carbon dioxide",
icon="mdi:molecule-co2", icon="mdi:molecule-co2",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -154,7 +154,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.SMOKE_SENSOR_VALUE, key=DPCode.SMOKE_SENSOR_VALUE,
name="Smoke Amount", name="Smoke amount",
icon="mdi:smoke-detector", icon="mdi:smoke-detector",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
device_class=SensorStateClass.MEASUREMENT, device_class=SensorStateClass.MEASUREMENT,
@ -166,13 +166,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"bh": ( "bh": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT, key=DPCode.TEMP_CURRENT,
name="Current Temperature", name="Current temperature",
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT_F, key=DPCode.TEMP_CURRENT_F,
name="Current Temperature", name="Current temperature",
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -199,7 +199,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE, key=DPCode.CO2_VALUE,
name="Carbon Dioxide", name="Carbon dioxide",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -210,7 +210,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"cobj": ( "cobj": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CO_VALUE, key=DPCode.CO_VALUE,
name="Carbon Monoxide", name="Carbon monoxide",
device_class=SensorDeviceClass.CO, device_class=SensorDeviceClass.CO,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -221,7 +221,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"cwwsq": ( "cwwsq": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.FEED_REPORT, key=DPCode.FEED_REPORT,
name="Last Amount", name="Last amount",
icon="mdi:counter", icon="mdi:counter",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -243,7 +243,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE, key=DPCode.CO2_VALUE,
name="Carbon Dioxide", name="Carbon dioxide",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -254,13 +254,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE, key=DPCode.VOC_VALUE,
name="Volatile Organic Compound", name="Volatile organic compound",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS, device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE, key=DPCode.PM25_VALUE,
name="Particulate Matter 2.5 µm", name="Particulate matter 2.5 µm",
device_class=SensorDeviceClass.PM25, device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -270,19 +270,19 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"jqbj": ( "jqbj": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE, key=DPCode.CO2_VALUE,
name="Carbon Dioxide", name="Carbon dioxide",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE, key=DPCode.VOC_VALUE,
name="Volatile Organic Compound", name="Volatile organic compound",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS, device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE, key=DPCode.PM25_VALUE,
name="Particulate Matter 2.5 µm", name="Particulate matter 2.5 µm",
device_class=SensorDeviceClass.PM25, device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -368,7 +368,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE, key=DPCode.CO2_VALUE,
name="Carbon Dioxide", name="Carbon dioxide",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -385,7 +385,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"mzj": ( "mzj": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT, key=DPCode.TEMP_CURRENT,
name="Current Temperature", name="Current temperature",
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -396,7 +396,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.REMAIN_TIME, key=DPCode.REMAIN_TIME,
name="Remaining Time", name="Remaining time",
native_unit_of_measurement=TIME_MINUTES, native_unit_of_measurement=TIME_MINUTES,
icon="mdi:timer", icon="mdi:timer",
), ),
@ -409,7 +409,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"pm2.5": ( "pm2.5": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE, key=DPCode.PM25_VALUE,
name="Particulate Matter 2.5 µm", name="Particulate matter 2.5 µm",
device_class=SensorDeviceClass.PM25, device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -420,7 +420,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE, key=DPCode.VOC_VALUE,
name="Volatile Organic Compound", name="Volatile organic compound",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS, device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -432,7 +432,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE, key=DPCode.CO2_VALUE,
name="Carbon Dioxide", name="Carbon dioxide",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -444,13 +444,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PM1, key=DPCode.PM1,
name="Particulate Matter 1.0 µm", name="Particulate matter 1.0 µm",
device_class=SensorDeviceClass.PM1, device_class=SensorDeviceClass.PM1,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PM10, key=DPCode.PM10,
name="Particulate Matter 10.0 µm", name="Particulate matter 10.0 µm",
device_class=SensorDeviceClass.PM10, device_class=SensorDeviceClass.PM10,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -515,13 +515,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"voc": ( "voc": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CO2_VALUE, key=DPCode.CO2_VALUE,
name="Carbon Dioxide", name="Carbon dioxide",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PM25_VALUE, key=DPCode.PM25_VALUE,
name="Particulate Matter 2.5 µm", name="Particulate matter 2.5 µm",
device_class=SensorDeviceClass.PM25, device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -544,7 +544,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.VOC_VALUE, key=DPCode.VOC_VALUE,
name="Volatile Organic Compound", name="Volatile organic compound",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS, device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -603,7 +603,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"ywbj": ( "ywbj": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.SMOKE_SENSOR_VALUE, key=DPCode.SMOKE_SENSOR_VALUE,
name="Smoke Amount", name="Smoke amount",
icon="mdi:smoke-detector", icon="mdi:smoke-detector",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
device_class=SensorStateClass.MEASUREMENT, device_class=SensorStateClass.MEASUREMENT,
@ -618,13 +618,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"zndb": ( "zndb": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.FORWARD_ENERGY_TOTAL, key=DPCode.FORWARD_ENERGY_TOTAL,
name="Total Energy", name="Total energy",
device_class=SensorDeviceClass.ENERGY, device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_A, key=DPCode.PHASE_A,
name="Phase A Current", name="Phase A current",
device_class=SensorDeviceClass.CURRENT, device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -632,7 +632,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_A, key=DPCode.PHASE_A,
name="Phase A Power", name="Phase A power",
device_class=SensorDeviceClass.POWER, device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_KILO_WATT, native_unit_of_measurement=POWER_KILO_WATT,
@ -640,7 +640,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_A, key=DPCode.PHASE_A,
name="Phase A Voltage", name="Phase A voltage",
device_class=SensorDeviceClass.VOLTAGE, device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT, native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
@ -648,7 +648,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_B, key=DPCode.PHASE_B,
name="Phase B Current", name="Phase B current",
device_class=SensorDeviceClass.CURRENT, device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -656,7 +656,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_B, key=DPCode.PHASE_B,
name="Phase B Power", name="Phase B power",
device_class=SensorDeviceClass.POWER, device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_KILO_WATT, native_unit_of_measurement=POWER_KILO_WATT,
@ -664,7 +664,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_B, key=DPCode.PHASE_B,
name="Phase B Voltage", name="Phase B voltage",
device_class=SensorDeviceClass.VOLTAGE, device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT, native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
@ -672,7 +672,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_C, key=DPCode.PHASE_C,
name="Phase C Current", name="Phase C current",
device_class=SensorDeviceClass.CURRENT, device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -680,7 +680,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_C, key=DPCode.PHASE_C,
name="Phase C Power", name="Phase C power",
device_class=SensorDeviceClass.POWER, device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_KILO_WATT, native_unit_of_measurement=POWER_KILO_WATT,
@ -688,7 +688,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_C, key=DPCode.PHASE_C,
name="Phase C Voltage", name="Phase C voltage",
device_class=SensorDeviceClass.VOLTAGE, device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT, native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
@ -700,13 +700,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"dlq": ( "dlq": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TOTAL_FORWARD_ENERGY, key=DPCode.TOTAL_FORWARD_ENERGY,
name="Total Energy", name="Total energy",
device_class=SensorDeviceClass.ENERGY, device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_A, key=DPCode.PHASE_A,
name="Phase A Current", name="Phase A current",
device_class=SensorDeviceClass.CURRENT, device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -714,7 +714,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_A, key=DPCode.PHASE_A,
name="Phase A Power", name="Phase A power",
device_class=SensorDeviceClass.POWER, device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_KILO_WATT, native_unit_of_measurement=POWER_KILO_WATT,
@ -722,7 +722,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_A, key=DPCode.PHASE_A,
name="Phase A Voltage", name="Phase A voltage",
device_class=SensorDeviceClass.VOLTAGE, device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT, native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
@ -730,7 +730,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_B, key=DPCode.PHASE_B,
name="Phase B Current", name="Phase B current",
device_class=SensorDeviceClass.CURRENT, device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -738,7 +738,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_B, key=DPCode.PHASE_B,
name="Phase B Power", name="Phase B power",
device_class=SensorDeviceClass.POWER, device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_KILO_WATT, native_unit_of_measurement=POWER_KILO_WATT,
@ -746,7 +746,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_B, key=DPCode.PHASE_B,
name="Phase B Voltage", name="Phase B voltage",
device_class=SensorDeviceClass.VOLTAGE, device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT, native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
@ -754,7 +754,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_C, key=DPCode.PHASE_C,
name="Phase C Current", name="Phase C current",
device_class=SensorDeviceClass.CURRENT, device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -762,7 +762,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_C, key=DPCode.PHASE_C,
name="Phase C Power", name="Phase C power",
device_class=SensorDeviceClass.POWER, device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_KILO_WATT, native_unit_of_measurement=POWER_KILO_WATT,
@ -770,7 +770,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PHASE_C, key=DPCode.PHASE_C,
name="Phase C Voltage", name="Phase C voltage",
device_class=SensorDeviceClass.VOLTAGE, device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT, native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
@ -782,13 +782,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"sd": ( "sd": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CLEAN_AREA, key=DPCode.CLEAN_AREA,
name="Cleaning Area", name="Cleaning area",
icon="mdi:texture-box", icon="mdi:texture-box",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.CLEAN_TIME, key=DPCode.CLEAN_TIME,
name="Cleaning Time", name="Cleaning time",
icon="mdi:progress-clock", icon="mdi:progress-clock",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -800,37 +800,37 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TOTAL_CLEAN_TIME, key=DPCode.TOTAL_CLEAN_TIME,
name="Total Cleaning Time", name="Total cleaning time",
icon="mdi:history", icon="mdi:history",
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TOTAL_CLEAN_COUNT, key=DPCode.TOTAL_CLEAN_COUNT,
name="Total Cleaning Times", name="Total cleaning times",
icon="mdi:counter", icon="mdi:counter",
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.DUSTER_CLOTH, key=DPCode.DUSTER_CLOTH,
name="Duster Cloth Life", name="Duster cloth life",
icon="mdi:ticket-percent-outline", icon="mdi:ticket-percent-outline",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.EDGE_BRUSH, key=DPCode.EDGE_BRUSH,
name="Side Brush Life", name="Side brush life",
icon="mdi:ticket-percent-outline", icon="mdi:ticket-percent-outline",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.FILTER_LIFE, key=DPCode.FILTER_LIFE,
name="Filter Life", name="Filter life",
icon="mdi:ticket-percent-outline", icon="mdi:ticket-percent-outline",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.ROLL_BRUSH, key=DPCode.ROLL_BRUSH,
name="Rolling Brush Life", name="Rolling brush life",
icon="mdi:ticket-percent-outline", icon="mdi:ticket-percent-outline",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
@ -840,7 +840,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"cl": ( "cl": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TIME_TOTAL, key=DPCode.TIME_TOTAL,
name="Last Operation Duration", name="Last operation duration",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:progress-clock", icon="mdi:progress-clock",
), ),
@ -868,7 +868,7 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.LEVEL_CURRENT, key=DPCode.LEVEL_CURRENT,
name="Water Level", name="Water level",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:waves-arrow-up", icon="mdi:waves-arrow-up",
), ),
@ -878,13 +878,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
"kj": ( "kj": (
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.FILTER, key=DPCode.FILTER,
name="Filter Utilization", name="Filter utilization",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:ticket-percent-outline", icon="mdi:ticket-percent-outline",
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.PM25, key=DPCode.PM25,
name="Particulate Matter 2.5 µm", name="Particulate matter 2.5 µm",
device_class=SensorDeviceClass.PM25, device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
icon="mdi:molecule", icon="mdi:molecule",
@ -903,26 +903,26 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TVOC, key=DPCode.TVOC,
name="Total Volatile Organic Compound", name="Total volatile organic compound",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS, device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.ECO2, key=DPCode.ECO2,
name="Concentration of Carbon Dioxide", name="Concentration of carbon dioxide",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TOTAL_TIME, key=DPCode.TOTAL_TIME,
name="Total Operating Time", name="Total operating time",
icon="mdi:history", icon="mdi:history",
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
), ),
TuyaSensorEntityDescription( TuyaSensorEntityDescription(
key=DPCode.TOTAL_PM, key=DPCode.TOTAL_PM,
name="Total Absorption of Particles", name="Total absorption of particles",
icon="mdi:texture-box", icon="mdi:texture-box",
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,