Complementing the Tuya Humidifier (jsq) category (#65276)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
dougiteixeira 2022-02-05 16:31:20 -03:00 committed by GitHub
parent 87049283c1
commit 52d7ca6b1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 138 additions and 0 deletions

View file

@ -96,6 +96,9 @@ class TuyaDeviceClass(StrEnum):
DECIBEL_SENSITIVITY = "tuya__decibel_sensitivity" DECIBEL_SENSITIVITY = "tuya__decibel_sensitivity"
FAN_ANGLE = "tuya__fan_angle" FAN_ANGLE = "tuya__fan_angle"
FINGERBOT_MODE = "tuya__fingerbot_mode" FINGERBOT_MODE = "tuya__fingerbot_mode"
HUMIDIFIER_SPRAY_MODE = "tuya__humidifier_spray_mode"
HUMIDIFIER_LEVEL = "tuya__humidifier_level"
HUMIDIFIER_MOODLIGHTING = "tuya__humidifier_moodlighting"
IPC_WORK_MODE = "tuya__ipc_work_mode" IPC_WORK_MODE = "tuya__ipc_work_mode"
LED_TYPE = "tuya__led_type" LED_TYPE = "tuya__led_type"
LIGHT_MODE = "tuya__light_mode" LIGHT_MODE = "tuya__light_mode"
@ -245,6 +248,7 @@ class DPCode(StrEnum):
LED_TYPE_2 = "led_type_2" LED_TYPE_2 = "led_type_2"
LED_TYPE_3 = "led_type_3" LED_TYPE_3 = "led_type_3"
LEVEL = "level" LEVEL = "level"
LEVEL_CURRENT = "level_current"
LIGHT = "light" # Light LIGHT = "light" # Light
LIGHT_MODE = "light_mode" LIGHT_MODE = "light_mode"
LOCK = "lock" # Lock / Child lock LOCK = "lock" # Lock / Child lock
@ -253,6 +257,7 @@ class DPCode(StrEnum):
MANUAL_FEED = "manual_feed" MANUAL_FEED = "manual_feed"
MATERIAL = "material" # Material MATERIAL = "material" # Material
MODE = "mode" # Working mode / Mode MODE = "mode" # Working mode / Mode
MOODLIGHTING = "moodlighting" # Mood light
MOTION_RECORD = "motion_record" MOTION_RECORD = "motion_record"
MOTION_SENSITIVITY = "motion_sensitivity" MOTION_SENSITIVITY = "motion_sensitivity"
MOTION_SWITCH = "motion_switch" # Motion switch MOTION_SWITCH = "motion_switch" # Motion switch
@ -303,6 +308,7 @@ class DPCode(StrEnum):
SHOCK_STATE = "shock_state" # Vibration status SHOCK_STATE = "shock_state" # Vibration status
SIREN_SWITCH = "siren_switch" SIREN_SWITCH = "siren_switch"
SITUATION_SET = "situation_set" SITUATION_SET = "situation_set"
SLEEP = "sleep" # Sleep function
SLOW_FEED = "slow_feed" SLOW_FEED = "slow_feed"
SMOKE_SENSOR_STATE = "smoke_sensor_state" SMOKE_SENSOR_STATE = "smoke_sensor_state"
SMOKE_SENSOR_STATUS = "smoke_sensor_status" SMOKE_SENSOR_STATUS = "smoke_sensor_status"
@ -310,8 +316,10 @@ class DPCode(StrEnum):
SOS = "sos" # Emergency State SOS = "sos" # Emergency State
SOS_STATE = "sos_state" # Emergency mode SOS_STATE = "sos_state" # Emergency mode
SPEED = "speed" # Speed level SPEED = "speed" # Speed level
SPRAY_MODE = "spray_mode" # Spraying mode
START = "start" # Start START = "start" # Start
STATUS = "status" STATUS = "status"
STERILIZATION = "sterilization" # Sterilization
SUCTION = "suction" SUCTION = "suction"
SWING = "swing" # Swing mode SWING = "swing" # Swing mode
SWITCH = "switch" # Switch SWITCH = "switch" # Switch
@ -333,6 +341,7 @@ class DPCode(StrEnum):
SWITCH_LED_3 = "switch_led_3" SWITCH_LED_3 = "switch_led_3"
SWITCH_NIGHT_LIGHT = "switch_night_light" SWITCH_NIGHT_LIGHT = "switch_night_light"
SWITCH_SAVE_ENERGY = "switch_save_energy" SWITCH_SAVE_ENERGY = "switch_save_energy"
SWITCH_SOUND = "switch_sound" # Voice switch
SWITCH_SPRAY = "switch_spray" # Spraying switch SWITCH_SPRAY = "switch_spray" # Spraying switch
SWITCH_USB1 = "switch_usb1" # USB 1 SWITCH_USB1 = "switch_usb1" # USB 1
SWITCH_USB2 = "switch_usb2" # USB 2 SWITCH_USB2 = "switch_usb2" # USB 2

View file

@ -250,6 +250,20 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
icon="mdi:thermometer-lines", icon="mdi:thermometer-lines",
), ),
), ),
# Humidifier
# https://developer.tuya.com/en/docs/iot/categoryjsq?id=Kaiuz1smr440b
"jsq": (
NumberEntityDescription(
key=DPCode.TEMP_SET,
name="Temperature",
icon="mdi:thermometer-lines",
),
NumberEntityDescription(
key=DPCode.TEMP_SET_F,
name="Temperature",
icon="mdi:thermometer-lines",
),
),
} }

View file

@ -276,6 +276,45 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
), ),
# Humidifier
# https://developer.tuya.com/en/docs/iot/categoryjsq?id=Kaiuz1smr440b
"jsq": (
SelectEntityDescription(
key=DPCode.SPRAY_MODE,
name="Spray Mode",
device_class=TuyaDeviceClass.HUMIDIFIER_SPRAY_MODE,
entity_category=EntityCategory.CONFIG,
icon="mdi:spray",
),
SelectEntityDescription(
key=DPCode.LEVEL,
name="Spraying Level",
device_class=TuyaDeviceClass.HUMIDIFIER_LEVEL,
entity_category=EntityCategory.CONFIG,
icon="mdi:spray",
),
SelectEntityDescription(
key=DPCode.MOODLIGHTING,
name="Moodlighting",
device_class=TuyaDeviceClass.HUMIDIFIER_MOODLIGHTING,
entity_category=EntityCategory.CONFIG,
icon="mdi:lightbulb-multiple",
),
SelectEntityDescription(
key=DPCode.COUNTDOWN,
name="Countdown",
device_class=TuyaDeviceClass.COUNTDOWN,
entity_category=EntityCategory.CONFIG,
icon="mdi:timer-cog-outline",
),
SelectEntityDescription(
key=DPCode.COUNTDOWN_SET,
name="Countdown",
device_class=TuyaDeviceClass.COUNTDOWN,
entity_category=EntityCategory.CONFIG,
icon="mdi:timer-cog-outline",
),
),
# Air Purifier # Air Purifier
# https://developer.tuya.com/en/docs/iot/f?id=K9gf46h2s6dzm # https://developer.tuya.com/en/docs/iot/f?id=K9gf46h2s6dzm
"kj": ( "kj": (

View file

@ -742,6 +742,34 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
icon="mdi:progress-clock", icon="mdi:progress-clock",
), ),
), ),
# Humidifier
# https://developer.tuya.com/en/docs/iot/s?id=K9gf48qwjz0i3
"jsq": (
TuyaSensorEntityDescription(
key=DPCode.HUMIDITY_CURRENT,
name="Humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
name="Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT_F,
name="Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.LEVEL_CURRENT,
name="Water Level",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:waves-arrow-up",
),
),
# Air Purifier # Air Purifier
# https://developer.tuya.com/en/docs/iot/s?id=K9gf48r41mn81 # https://developer.tuya.com/en/docs/iot/s?id=K9gf48r41mn81
"kj": ( "kj": (

View file

@ -102,6 +102,32 @@
"4h": "4 hours", "4h": "4 hours",
"5h": "5 hours", "5h": "5 hours",
"6h": "6 hours" "6h": "6 hours"
},
"tuya__humidifier_spray_mode": {
"auto": "Auto",
"health": "Health",
"sleep": "Sleep",
"humidity": "Humidity",
"work": "Work"
},
"tuya__humidifier_level": {
"level_1": "Level 1",
"level_2": "Level 2",
"level_3": "Level 3",
"level_4": "Level 4",
"level_5": "Level 5",
"level_6": "Level 6",
"level_7": "Level 7",
"level_8": "Level 8",
"level_9": "Level 9",
"level_10": "Level 10"
},
"tuya__humidifier_moodlighting": {
"1": "Mood 1",
"2": "Mood 2",
"3": "Mood 3",
"4": "Mood 4",
"5": "Mood 5"
} }
} }
} }

View file

@ -558,6 +558,28 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
), ),
# Humidifier
# https://developer.tuya.com/en/docs/iot/categoryjsq?id=Kaiuz1smr440b
"jsq": (
SwitchEntityDescription(
key=DPCode.SWITCH_SOUND,
name="Voice",
icon="mdi:account-voice",
entity_category=EntityCategory.CONFIG,
),
SwitchEntityDescription(
key=DPCode.SLEEP,
name="Sleep",
icon="mdi:power-sleep",
entity_category=EntityCategory.CONFIG,
),
SwitchEntityDescription(
key=DPCode.STERILIZATION,
name="Sterilization",
icon="mdi:minus-circle-outline",
entity_category=EntityCategory.CONFIG,
),
),
} }
# Socket (duplicate of `pc`) # Socket (duplicate of `pc`)