Browse Source

feat (rgbcw_lightbulb_xld_cl002): compatibility improvements

- incorrectly used device id as product id, so comment this out
- device uses dp 51 for scenes, but dp 25 was still defined. Compatible
  device puts non-hex data here though, so make it a string to be more
  tolerant of other usage. Issue #4806
- other hex types carried over from more standard lightbulb may have same
  issue, so make them strings too, since hex isn't being decoded anyway.
- Break out sleep, wakeup, rhythm settings into text entities
Jason Rumney 1 week ago
parent
commit
e1f75a0d93
1 changed files with 42 additions and 28 deletions
  1. 42 28
      custom_components/tuya_local/devices/rgbcw_lightbulb_xld_cl002.yaml

+ 42 - 28
custom_components/tuya_local/devices/rgbcw_lightbulb_xld_cl002.yaml

@@ -1,8 +1,8 @@
 name: RGBCW lightbulb
-products:
-  - id: bfde31c920bcaa323azft2
-    manufacturer: Xinled
-    model: XLD-CL002
+# products:
+#   - id: UNKNOWN
+#     manufacturer: Xinled
+#     model: XLD-CL002
 entities:
   - entity: light
     dps:
@@ -62,30 +62,6 @@ entities:
             range:
               min: 0
               max: 1000
-      - id: 25
-        name: scene_data
-        type: hex
-        optional: true
-      - id: 27
-        name: music_data
-        type: hex
-        optional: true
-      - id: 28
-        name: control_data
-        type: hex
-        optional: true
-      - id: 30
-        name: rhythm_mode
-        type: base64
-        optional: true
-      - id: 31
-        name: sleep_mode
-        type: base64
-        optional: true
-      - id: 32
-        name: wakeup_mode
-        type: base64
-        optional: true
   - entity: time
     translation_key: timer
     category: config
@@ -139,3 +115,41 @@ entities:
             value: "WW+RED 50%"
           - dps_val: "AAcAAAPoA+gD6AAA"
             value: "WW+RED 1%"
+      - id: 25
+        name: scene_data  # dp 51 used instead but this still declared
+        type: string  # some compatible devices put other data here, so avoid hex
+        optional: true
+  - entity: text
+    name: Rhythm mode
+    category: config
+    icon: "mdi:music"
+    hidden: true
+    dps:
+      - id: 30
+        type: base64
+        optional: true
+        name: value
+      - id: 27
+        name: music_data  # dp 30 used instead but this still declared
+        type: string
+        optional: true
+  - entity: text
+    name: Sleep mode
+    category: config
+    icon: "mdi:sleep"
+    hidden: true
+    dps:
+      - id: 31
+        type: base64
+        optional: true
+        name: value
+  - entity: text
+    name: Wakeup mode
+    category: config
+    icon: "mdi:weather-sunset-up"
+    hidden: true
+    dps:
+      - id: 32
+        type: base64
+        optional: true
+        name: value