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

Petlibro PLAF203: expose feeding schedule as writable meal plan (#5517)

DP 231 (the feeding schedule) was mapped as a read-only "schedule"
extra attribute on the status sensor, so it could be read but not
changed. Move it to a dedicated text entity using the existing
meal_plan translation_key (as already done for the advwin and catit
feeders), so the schedule can be edited and feeding slots enabled or
disabled locally. Writes to DP 231 were verified over LAN (protocol
3.4) on the device.
Kilian Cavalotti 9 часов назад
Родитель
Сommit
2000426f6a
1 измененных файлов с 14 добавлено и 3 удалено
  1. 14 3
      custom_components/tuya_local/devices/petlibro_camera_feeder.yaml

+ 14 - 3
custom_components/tuya_local/devices/petlibro_camera_feeder.yaml

@@ -12,9 +12,6 @@ entities:
         type: string
         name: sensor
         optional: true
-      - id: 231
-        type: hex
-        name: schedule
       - id: 237
         type: string
         name: planned_feed_report
@@ -23,6 +20,20 @@ entities:
         type: string
         name: manual_feed_report
         optional: true
+  - entity: text
+    translation_key: meal_plan
+    category: config
+    hidden: true
+    dps:
+      # Meal plan is a hex blob of 5-byte slots:
+      # - Days (1 bit per day, bitmask)
+      # - Hour
+      # - Minute
+      # - Portions
+      # - Enabled (1) / disabled (0)
+      - id: 231
+        type: hex
+        name: value
   - entity: light
     translation_key: indicator
     category: config