Просмотр исходного кода

ZY-HPS01 presence sensor: add alternate illuminance dp

Some devices with the same model have illuminance on dp 11.
Include this as an alternative to redirect to when 103 is not available.
Remove the range, as it is not needed for a sensor.

Issue #2849
Jason Rumney 1 год назад
Родитель
Сommit
bd405472c0

+ 8 - 4
custom_components/tuya_local/devices/zyhps01_human_presence_sensor.yaml

@@ -20,13 +20,17 @@ entities:
     dps:
       - id: 103
         type: integer
+        optional: true
         name: sensor
         unit: lx
         class: measurement
-        range:
-          min: 0
-          max: 3000
-
+        mapping:
+          - dps_val: null
+            value_redirect: alt
+      - id: 11
+        type: integer
+        optional: true
+        name: alt
   - entity: number
     name: Presence delay
     category: config