Add Human Presence Sensor (hps) device support to Tuya (#58054)
This commit is contained in:
parent
0fe5baa425
commit
e65345900f
3 changed files with 33 additions and 0 deletions
|
@ -42,6 +42,15 @@ class TuyaBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||||
# end up being a binary sensor.
|
# end up being a binary sensor.
|
||||||
# https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq
|
# https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq
|
||||||
BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
|
BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
|
||||||
|
# Human Presence Sensor
|
||||||
|
# https://developer.tuya.com/en/docs/iot/categoryhps?id=Kaiuz42yhn1hs
|
||||||
|
"hps": (
|
||||||
|
TuyaBinarySensorEntityDescription(
|
||||||
|
key=DPCode.PRESENCE_STATE,
|
||||||
|
device_class=DEVICE_CLASS_MOTION,
|
||||||
|
on_value="presence",
|
||||||
|
),
|
||||||
|
),
|
||||||
# Door Window Sensor
|
# Door Window Sensor
|
||||||
# https://developer.tuya.com/en/docs/iot/s?id=K9gf48hm02l8m
|
# https://developer.tuya.com/en/docs/iot/s?id=K9gf48hm02l8m
|
||||||
"mcs": (
|
"mcs": (
|
||||||
|
|
|
@ -156,6 +156,7 @@ class DPCode(str, Enum):
|
||||||
FAN_DIRECTION = "fan_direction" # Fan direction
|
FAN_DIRECTION = "fan_direction" # Fan direction
|
||||||
FAN_SPEED_ENUM = "fan_speed_enum" # Speed mode
|
FAN_SPEED_ENUM = "fan_speed_enum" # Speed mode
|
||||||
FAN_SPEED_PERCENT = "fan_speed_percent" # Stepless speed
|
FAN_SPEED_PERCENT = "fan_speed_percent" # Stepless speed
|
||||||
|
FAR_DETECTION = "far_detection"
|
||||||
FILTER_RESET = "filter_reset" # Filter (cartridge) reset
|
FILTER_RESET = "filter_reset" # Filter (cartridge) reset
|
||||||
HUMIDITY_CURRENT = "humidity_current" # Current humidity
|
HUMIDITY_CURRENT = "humidity_current" # Current humidity
|
||||||
HUMIDITY_SET = "humidity_set" # Humidity setting
|
HUMIDITY_SET = "humidity_set" # Humidity setting
|
||||||
|
@ -166,6 +167,7 @@ class DPCode(str, Enum):
|
||||||
MODE = "mode" # Working mode / Mode
|
MODE = "mode" # Working mode / Mode
|
||||||
MOTION_SWITCH = "motion_switch" # Motion switch
|
MOTION_SWITCH = "motion_switch" # Motion switch
|
||||||
MUFFLING = "muffling" # Muffling
|
MUFFLING = "muffling" # Muffling
|
||||||
|
NEAR_DETECTION = "near_detection"
|
||||||
PAUSE = "pause"
|
PAUSE = "pause"
|
||||||
PERCENT_CONTROL = "percent_control"
|
PERCENT_CONTROL = "percent_control"
|
||||||
PERCENT_CONTROL_2 = "percent_control_2"
|
PERCENT_CONTROL_2 = "percent_control_2"
|
||||||
|
@ -176,6 +178,7 @@ class DPCode(str, Enum):
|
||||||
PIR = "pir" # Motion sensor
|
PIR = "pir" # Motion sensor
|
||||||
POWDER_SET = "powder_set" # Powder
|
POWDER_SET = "powder_set" # Powder
|
||||||
POWER_GO = "power_go"
|
POWER_GO = "power_go"
|
||||||
|
PRESENCE_STATE = "presence_state"
|
||||||
PUMP_RESET = "pump_reset" # Water pump reset
|
PUMP_RESET = "pump_reset" # Water pump reset
|
||||||
RECORD_SWITCH = "record_switch" # Recording switch
|
RECORD_SWITCH = "record_switch" # Recording switch
|
||||||
SEEK = "seek"
|
SEEK = "seek"
|
||||||
|
|
|
@ -21,6 +21,27 @@ from .const import DOMAIN, TUYA_DISCOVERY_NEW, DPCode
|
||||||
# default instructions set of each category end up being a number.
|
# default instructions set of each category end up being a number.
|
||||||
# https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq
|
# https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq
|
||||||
NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
|
NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
|
||||||
|
# Human Presence Sensor
|
||||||
|
# https://developer.tuya.com/en/docs/iot/categoryhps?id=Kaiuz42yhn1hs
|
||||||
|
"hps": (
|
||||||
|
NumberEntityDescription(
|
||||||
|
key=DPCode.SENSITIVITY,
|
||||||
|
name="Sensitivity",
|
||||||
|
entity_category=ENTITY_CATEGORY_CONFIG,
|
||||||
|
),
|
||||||
|
NumberEntityDescription(
|
||||||
|
key=DPCode.NEAR_DETECTION,
|
||||||
|
name="Near Detection",
|
||||||
|
icon="mdi:signal-distance-variant",
|
||||||
|
entity_category=ENTITY_CATEGORY_CONFIG,
|
||||||
|
),
|
||||||
|
NumberEntityDescription(
|
||||||
|
key=DPCode.FAR_DETECTION,
|
||||||
|
name="Far Detection",
|
||||||
|
icon="mdi:signal-distance-variant",
|
||||||
|
entity_category=ENTITY_CATEGORY_CONFIG,
|
||||||
|
),
|
||||||
|
),
|
||||||
# Coffee maker
|
# Coffee maker
|
||||||
# https://developer.tuya.com/en/docs/iot/categorykfj?id=Kaiuz2p12pc7f
|
# https://developer.tuya.com/en/docs/iot/categorykfj?id=Kaiuz2p12pc7f
|
||||||
"kfj": (
|
"kfj": (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue