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

Add support for RGBW lightbulb with modern dps layout.

Issue #1169
Jason Rumney 2 лет назад
Родитель
Сommit
ab83b42171
3 измененных файлов с 80 добавлено и 1 удалено
  1. 1 0
      ACKNOWLEDGEMENTS.md
  2. 1 1
      DEVICES.md
  3. 78 0
      custom_components/tuya_local/devices/rgbw_lightbulbv2.yaml

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -390,3 +390,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [lnx85](https://github.com/lnx85) for contributing support for GiotoHun pet feeder (merged with Catit Pixi Smart feeder).
 - [dmitriy5181](https://github.com/dmitriy5181) for contributing support for Pro Breeze 30L dehumidifiers.
 - [wrmacj](https://github.com/wrmacj) for assisting with support for Kennedy electric fireplaces.
+- [KTibow](https://github.com/KTibow) for assisting with support for RGBW lights using the modern standard dps layout.

+ 1 - 1
DEVICES.md

@@ -358,7 +358,7 @@ of device.
 - Generic CCT lightbulb (supporting color temperature and brightness)
 - Generic dimmable light (2 types, using dp 1,2 and 20,22)
 - Generic RGBCW/RGBWW lightbulb (confirmed with Lijun branded bulb, expected to match others also). Three versions - standard dps layout starting from 20, with and without scene/music modes and timer, and a non-standard layout starting from 1 but following the same pattern (tested with "A60" bulbs).
-- Generic RGBW lightbulb in the non-standard pattern above but without color temperature control.
+- Generic RGBW lightbulb in the standard and non-standard patterns above but without color temperature control.
 - Generic dimmable/color temperature adjustable desktop lamp (confirmed with Setti+ SL601)
 - A60 1800-2700K RGBWW light
 - Atomi smart color string light

+ 78 - 0
custom_components/tuya_local/devices/rgbw_lightbulbv2.yaml

@@ -0,0 +1,78 @@
+name: RGBW lightbulb
+products:
+  - id: dik6z7of4nailf94
+primary_entity:
+  entity: light
+  dps:
+    - id: 20
+      type: boolean
+      name: switch
+    - id: 21
+      name: color_mode
+      type: string
+      mapping:
+        - dps_val: white
+          value: white
+        - dps_val: colour
+          value: hs
+        - dps_val: scene
+          value: Scene
+        - dps_val: music
+          value: Music
+    - id: 22
+      name: brightness
+      type: integer
+      range:
+        min: 10
+        max: 1000
+      mapping:
+        - scale: 3.92
+    - id: 24
+      name: rgbhsv
+      type: hex
+      format:
+        - name: h
+          bytes: 2
+          range:
+            min: 0
+            max: 360
+        - name: s
+          bytes: 2
+          range:
+            min: 0
+            max: 1000
+        - name: v
+          bytes: 2
+          range:
+            min: 0
+            max: 1000
+    - id: 25
+      name: scene
+      type: string
+      optional: true
+    - id: 27
+      name: music
+      type: string
+      optional: true
+    - id: 28
+      name: control_data
+      type: string
+      optional: true
+secondary_entities:
+  - entity: number
+    name: Timer
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 26
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+
+