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

Add support for RGBWW lightbulbs.

Specifically A60 1800-2700K bulbs.

This bulb does not seem to send all its state, so will appear
alongside simple switch and mellerware vacuum as possible selections
for anything with a boolean dp 1.

Issue #996
Jason Rumney 2 лет назад
Родитель
Сommit
7ee666cdd4
3 измененных файлов с 85 добавлено и 0 удалено
  1. 1 0
      ACKNOWLEDGEMENTS.md
  2. 1 0
      DEVICES.md
  3. 83 0
      custom_components/tuya_local/devices/rgbww_lightbulb.yaml

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -365,3 +365,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [McAllstar](https://github.com/McAllstar) for assisting with support for Geyserwise TSE1 geyser controller kits.
 - [Thunn-Der](https://github.com/Thunn-Der) for assisting with support for Breville AirDynamic 3d fans.
 - [dwojtas](https://github.com/dwojtas) for contributing Polish translations.
+- [supersjimmie](https://github.com/supersjimmie) for assisting with support for A60 RGBWW lightbulbs.

+ 1 - 0
DEVICES.md

@@ -344,6 +344,7 @@ of device.
 - 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 dimmable/color temperature adjustable desktop lamp (confirmed with Setti+ SL601)
+- A60 1800-2700K RGBWW light
 - Atomi smart color string light
 - Deta/Arlec motion sensor lights (DET100HA/DET102HA/MAL315HA)
 - Deta 6910HA series2 dimmer switch

+ 83 - 0
custom_components/tuya_local/devices/rgbww_lightbulb.yaml

@@ -0,0 +1,83 @@
+name: RGB warm white light
+products:
+  - id: hpaeslvkx4znwzae
+    name: A60 RGB 1800-2700K light
+primary_entity:
+  entity: light
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+    - id: 2
+      type: string
+      name: color_mode
+      optional: true
+      mapping:
+        - dps_val: white
+          value: color_temp
+        - dps_val: colour
+          value: hsv
+    - id: 3
+      type: integer
+      name: brightness
+      optional: true
+      range:
+        min: 25
+        max: 255
+    - id: 4
+      type: integer
+      optional: true
+      name: color_temp
+      range:
+        min: 0
+        max: 255
+      mapping:
+        - target_range:
+            min: 1800
+            max: 2700
+    - id: 5
+      type: hex
+      name: rgbhsv
+      optional: true
+      format:
+        - name: r
+          bytes: 1
+        - name: g
+          bytes: 1
+        - name: b
+          bytes: 1
+        - name: h
+          bytes: 2
+          range:
+            min: 0
+            max: 360
+        - name: s
+          bytes: 1
+          range:
+            min: 0
+            max: 255
+        - name: v
+          bytes: 1
+          range:
+            min: 0
+            max: 255
+    - id: 6
+      type: string
+      name: scene_data
+      optional: true
+    - id: 7
+      type: string
+      name: flash_scene_1
+      optional: true
+    - id: 8
+      type: string
+      name: flash_scene_2
+      optional: true
+    - id: 9
+      type: string
+      name: flash_scene_3
+      optional: true
+    - id: 10
+      type: string
+      name: flash_scene_4
+      optional: true