Add some sensors and controls to tuya dehumidifier (#85380)

fixes undefined
This commit is contained in:
Andre Basche 2023-01-16 22:58:01 +01:00 committed by GitHub
parent 851eef1144
commit abc8b891be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 0 deletions

View File

@ -173,6 +173,7 @@ class DPCode(StrEnum):
CUR_VOLTAGE = "cur_voltage" # Actual voltage
DECIBEL_SENSITIVITY = "decibel_sensitivity"
DECIBEL_SWITCH = "decibel_switch"
DEHUMIDITY_SET_ENUM = "dehumidify_set_enum"
DEHUMIDITY_SET_VALUE = "dehumidify_set_value"
DISINFECTION = "disinfection"
DO_NOT_DISTURB = "do_not_disturb"
@ -209,6 +210,7 @@ class DPCode(StrEnum):
HUMIDIFIER = "humidifier" # Humidification
HUMIDITY = "humidity" # Humidity
HUMIDITY_CURRENT = "humidity_current" # Current humidity
HUMIDITY_INDOOR = "humidity_indoor" # Indoor humidity
HUMIDITY_SET = "humidity_set" # Humidity setting
HUMIDITY_VALUE = "humidity_value" # Humidity
IPC_WORK_MODE = "ipc_work_mode"
@ -328,6 +330,7 @@ class DPCode(StrEnum):
TEMP_CONTROLLER = "temp_controller"
TEMP_CURRENT = "temp_current" # Current temperature in °C
TEMP_CURRENT_F = "temp_current_f" # Current temperature in °F
TEMP_INDOOR = "temp_indoor" # Indoor temperature in °C
TEMP_SET = "temp_set" # Set the temperature in °C
TEMP_SET_F = "temp_set_f" # Set the temperature in °F
TEMP_UNIT_CONVERT = "temp_unit_convert" # Temperature unit switching

View File

@ -29,6 +29,7 @@ TUYA_SUPPORT_TYPE = {
"fsd", # Fan with Light
"fskg", # Fan wall switch
"kj", # Air Purifier
"cs", # Dehumidifier
}

View File

@ -342,6 +342,23 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
translation_key="countdown",
),
),
# Dehumidifier
# https://developer.tuya.com/en/docs/iot/categorycs?id=Kaiuz1vcz4dha
"cs": (
SelectEntityDescription(
key=DPCode.COUNTDOWN_SET,
name="Countdown",
entity_category=EntityCategory.CONFIG,
icon="mdi:timer-cog-outline",
translation_key="countdown",
),
SelectEntityDescription(
key=DPCode.DEHUMIDITY_SET_ENUM,
name="Target humidity",
entity_category=EntityCategory.CONFIG,
icon="mdi:water-percent",
),
),
}
# Socket (duplicate of `kg`)

View File

@ -999,6 +999,22 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
state_class=SensorStateClass.MEASUREMENT,
),
),
# Dehumidifier
# https://developer.tuya.com/en/docs/iot/s?id=K9gf48r6jke8e
"cs": (
TuyaSensorEntityDescription(
key=DPCode.TEMP_INDOOR,
name="Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_INDOOR,
name="Humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
),
}
# Socket (duplicate of `kg`)