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

Add device configuration for Smart Light RGB48 (RGBIC string lights) (#4735)

* Add files via upload

Add device config for Smart Light RGB48 RGBIC string lights

* Update smart light rgb48.yml

Address review feedback: fix DP types, separate timer entity, add LED count and scene entities

* Update smart light rgb48.yml

* Update smart light rgb48.yml

Removed DP 24 from light entity entirely as it was causing a TypeError in tuya-local’s light.py due to missing format names

* Update smart light rgb48.yml

Fixed for linting - added new line at end of file.

* fix (rgb48_lightstring): file naming, translations and others

- rename file to follow general naming scheme
- use translation keys for scene and timer
- use time entity for timer
- hide the unavailable options for the light

PR #4735

* fix (rgb48_lightstring): use consistent yaml extension

- tests were skipped due to wrong extension used.

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
starfire0606 1 день назад
Родитель
Сommit
12e8ddfa09
1 измененных файлов с 105 добавлено и 0 удалено
  1. 105 0
      custom_components/tuya_local/devices/rgb48_lightstring.yaml

+ 105 - 0
custom_components/tuya_local/devices/rgb48_lightstring.yaml

@@ -0,0 +1,105 @@
+# Smart Light RGB48 - RGBIC outdoor string lights
+# Product ID: 2znvfkx64d4fkzxp
+# Protocol: 3.4
+#
+# Notes:
+# - DP 59 draw_tool is base64 type for direct per-LED control.
+# - DP 56 rgbic_linerlight_scene is base64 type for scene switching.
+# - DP 58 led_number_set configures string length/segment count.
+
+name: RGBIC string light
+products:
+  - id: 2znvfkx64d4fkzxp
+    model: Smart Light RGB48
+entities:
+  - entity: light
+    icon: "mdi:string-lights"
+    dps:
+      - id: 20
+        type: boolean
+        name: switch
+      - id: 21
+        type: string
+        name: color_mode
+        mapping:
+          - dps_val: "white"
+            value: "color_temp"
+          - dps_val: "colour"
+            value: "hs"
+            hidden: true  # there is no RGB dp, so prevent selection of this
+          - dps_val: "scene"
+            value: "scene"
+          - dps_val: "music"
+            value: "music"
+            hidden: true
+      - id: 22
+        type: integer
+        name: brightness
+        range:
+          min: 10
+          max: 1000
+      - id: 23
+        type: integer
+        name: color_temp
+        range:
+          min: 0
+          max: 1000
+        mapping:
+          - target_range:
+              min: 2700
+              max: 6500
+  - entity: select
+    name: Segment mode
+    category: config
+    icon: "mdi:led-strip-variant"
+    dps:
+      - id: 101
+        type: string
+        name: option
+        mapping:
+          - dps_val: "RGB"
+            value: "RGB"
+          - dps_val: "RGBIC"
+            value: "RGBIC"
+          - dps_val: "WHITE"
+            value: "White"
+          - dps_val: "SCENE"
+            value: "Scene"
+  - entity: number
+    name: LED count
+    category: config
+    icon: "mdi:counter"
+    dps:
+      - id: 58
+        type: integer
+        name: value
+        range:
+          min: 1
+          max: 5000
+  - entity: time
+    translation_key: timer
+    category: config
+    dps:
+      - id: 26
+        type: integer
+        name: second
+        optional: true
+        range:
+          min: 0
+          max: 86399
+        unit: s
+  - entity: text
+    translation_key: scene
+    category: config
+    dps:
+      - id: 56
+        type: base64
+        name: value
+  - entity: text
+    name: Draw tool
+    category: config
+    icon: "mdi:led-strip"
+    dps:
+      - id: 59
+        type: base64
+        name: value