Parcourir la source

Add support for dual-mode light string.

Issue #309
Jason Rumney il y a 3 ans
Parent
commit
e0e306dab9
3 fichiers modifiés avec 92 ajouts et 1 suppressions
  1. 1 1
      ACKNOWLEDGEMENTS.md
  2. 1 0
      DEVICES.md
  3. 90 0
      custom_components/tuya_local/devices/light_string.yaml

+ 1 - 1
ACKNOWLEDGEMENTS.md

@@ -125,7 +125,7 @@ Further device support has been made with the assistance of users.  Please consi
 - [karnas99](https://github.com/karnas99) for assistance in improving Hysen thermostat support.
 - [cooperaj](https://github.com/cooperaj) for contributing support for ElectriQ CD12PRO-LE dehumidifiers.
 - [geroulas](https://github.com/geroulas) for assisting with support for Inventor Atmosphere XL dehumidifiers.
-- [and7ey](https://github.com/and7ey) for all the effort investigating Screen sync smart lights, which in the end proved too problematic to support.
+- [and7ey](https://github.com/and7ey) for all the effort investigating Screen sync smart lights, which in the end proved too problematic to support, and for contributing support for dual mode light strings.
 - [dragosmd](https://github.com/dragosmd) and [RomchikL](https://github.com/RomchikL) for assisting with support for more dual switches.
 - [patrik-malina](https://github.com/patrik-malina) for contributing improvements to Kyvol vacuums.
 - [cr4shydlo](https://github.com/cr4shydlo) for assistance supporting Rotenso Roni heat pumps.

+ 1 - 0
DEVICES.md

@@ -191,6 +191,7 @@ Other brands may work with the above configurations
 - Generic RGBCW/RGBWW lightbulb (confirmed with Lijun branded bulb, expected to match others also). Two versions - with and without scene/music modes and timer.
 - Atomi smart color string light
 - Deta motion sensor lights (DET100HA/DET102HA)
+- Dual-mode magic light string controller
 
 ### Covers
 

+ 90 - 0
custom_components/tuya_local/devices/light_string.yaml

@@ -0,0 +1,90 @@
+name: Fairy lights
+primary_entity:
+  entity: light
+  dps:
+    - id: 20
+      name: switch
+      type: boolean
+    - id: 21
+      name: color_mode
+      type: string
+      mapping:
+        - dps_val: colour
+          value: rgbw
+        - dps_val: scene
+          value: colorloop
+        - dps_val: music
+          value: random
+    - 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
+      type: hex
+      name: effect
+      mapping:
+        - dps_val: "0103e8"
+          name: Palm
+        - dps_val: "0101f1"
+          name: "Palm 50%"
+        - dps_val: "0203e8"
+          name: Christmas tree
+        - dps_val: "0201f1"
+          name: "Christmas tree 50%"
+        - dps_val: "0303e8"
+          name: Fence
+        - dps_val: "0301f1"
+          name: "Fence 50%"
+        - dps_val: "0403e8"
+          name: Rainbow
+        - dps_val: "0401f1"
+          name: "Rainbox 50%"
+        - dps_val: "0503e8"
+          name: Photos
+        - dps_val: "0501f1"
+          name: "Photos 50%"
+        - dps_val: "0603e8"
+          name: Fairy lights
+        - dps_val: "0601f1"
+          name: "Fairy lights 50%"
+        - dps_val: "0703e8"
+          name: Wreath
+        - dps_val: "0701f1"
+          name: "Wreath 50%"
+    - id: 26
+      type: integer
+      name: timer
+      optional: true
+secondary_entities:
+  - entity: select
+    name: Music mode
+    category: config
+    icon: "mdi:music"
+    dps:
+      - id: 101
+        type: hex
+        name: option
+        mapping:
+          - dps_val: 16401bb1006e03e801f4
+            value: Energy
+          - dps_val: 26401bb1006e03e801f4
+            value: Rhythm
+          - dps_val: 36401bb1006e03e801f4
+            value: Spectrum
+          - dps_val: 46401bb1006e03e801f4
+            value: Rolling