Kaynağa Gözat

YP pet feeder: fix dp mapping

Original report #1011 had fault dp as bitfield, but config from user was not
checked, and included with the type set to boolean as submitted.
I guess the original user already had it configured from an earlier partial
config version, so didn't hit the compatibility issue trying to add it, and
until #3270 nobody else has reported issues because the config is almost
identical to catit_pixi_smart_pet_feeder (additional button), and also
ipettie_w5 (more limited portion size).
Jason Rumney 9 ay önce
ebeveyn
işleme
c5bacfd51a

+ 40 - 1
custom_components/tuya_local/devices/yp_petfeeeder.yaml

@@ -16,7 +16,24 @@ entities:
           max: 40
       - id: 1
         name: meal_plan
+        type: base64
+        optional: true
+  - entity: sensor
+    translation_key: status
+    class: enum
+    icon: "mdi:paw"
+    category: diagnostic
+    dps:
+      - id: 4
         type: string
+        name: sensor
+        mapping:
+          - dps_val: standby
+            value: standby
+          - dps_val: feeding
+            value: feeding
+          - dps_val: done
+            value: feeding_complete
   - entity: sensor
     icon: "mdi:paw"
     name: Feed report
@@ -31,11 +48,33 @@ entities:
     dps:
       - id: 9
         type: boolean
+        optional: true
         name: button
   - entity: binary_sensor
     class: problem
     category: diagnostic
     dps:
       - id: 14
-        type: boolean
+        type: bitfield
         name: sensor
+        mapping:
+          - dps_val: 0
+            value: false
+          - value: true
+      - id: 14
+        type: bitfield
+        name: fault_code
+      - id: 14
+        type: bitfield
+        name: description
+        mapping:
+          - dps_val: 1
+            value: pet_food_jammed
+          - dps_val: 2
+            value: pet_food_low
+          - dps_val: 4
+            value: pet_food_empty
+          - dps_val: 8
+            value: desiccant_exhausted
+          - dps_val: 16
+            value: battery_low