Update Tuya integration with target distance (#126700)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Tal Atlas 2024-09-25 02:47:53 -04:00 committed by GitHub
parent e351f8ba07
commit 7e41b40441
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View File

@ -150,7 +150,7 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
"hps": (
TuyaBinarySensorEntityDescription(
key=DPCode.PRESENCE_STATE,
device_class=BinarySensorDeviceClass.MOTION,
device_class=BinarySensorDeviceClass.OCCUPANCY,
on_value="presence",
),
),

View File

@ -326,6 +326,7 @@ class DPCode(StrEnum):
SWITCH_USB6 = "switch_usb6" # USB 6
SWITCH_VERTICAL = "switch_vertical" # Vertical swing flap switch
SWITCH_VOICE = "switch_voice" # Voice switch
TARGET_DIS_CLOSEST = "target_dis_closest" # Closest target distance
TEMP = "temp" # Temperature setting
TEMP_BOILING_C = "temp_boiling_c"
TEMP_BOILING_F = "temp_boiling_f"

View File

@ -87,13 +87,20 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
NumberEntityDescription(
key=DPCode.NEAR_DETECTION,
translation_key="near_detection",
device_class=NumberDeviceClass.DISTANCE,
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.FAR_DETECTION,
translation_key="far_detection",
device_class=NumberDeviceClass.DISTANCE,
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.TARGET_DIS_CLOSEST,
translation_key="target_dis_closest",
device_class=NumberDeviceClass.DISTANCE,
),
),
# Coffee maker
# https://developer.tuya.com/en/docs/iot/categorykfj?id=Kaiuz2p12pc7f

View File

@ -146,6 +146,9 @@
"far_detection": {
"name": "Far detection"
},
"target_dis_closest": {
"name": "Clostest target distance"
},
"water_level": {
"name": "Water level"
},