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

Ovlaim 809 ceiling fan: add sleep preset mode, make timer a read-only sensor (#5405)

* Ovlaim 809 ceiling fan: add sleep preset, make timer a read-only sensor

From the device Tuya cloud spec (product ftqsaibnb3insvp9):
- fan_mode (dp61) enum is fresh/nature/sleep; add the missing sleep preset.
- countdown_left_fan (dp64): the device accepts and stores a written value but
  never starts a countdown or turns the fan off (tested on hardware), so it is
  effectively read-only. Changed from a writable number to a read-only sensor
  (time_remaining, duration, diagnostic).

yamllint clean, tests/test_device_config.py 32 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Add optional back to time remaining dp

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Andrea 1 неделя назад
Родитель
Сommit
00530648f9

+ 6 - 7
custom_components/tuya_local/devices/ovlaim_809_ceiling_fanlight.yaml

@@ -45,6 +45,8 @@ entities:
             value: fresh
           - dps_val: nature
             value: nature
+          - dps_val: sleep
+            value: sleep
       - id: 62
         name: speed
         type: integer
@@ -56,16 +58,13 @@ entities:
         name: direction
         type: string
         optional: true
-  - entity: number
-    translation_key: timer
+  - entity: sensor
+    translation_key: time_remaining
     class: duration
-    category: config
+    category: diagnostic
     dps:
       - id: 64
-        name: value
         type: integer
         optional: true
+        name: sensor
         unit: min
-        range:
-          min: 0
-          max: 540