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

Add HDMI sync lights

Due to missing dps in most reports, these are indistinguishable from
other lights, even though they have some unique dps we should be able
to distinguish them by.  Most concerning is that they do not always
report the switch and mode states, but sometimes they do so the
functions are not missing from the device.  These two are the only
ones documented by Tuya as *required* by all lights.

Issue #264
Jason Rumney 3 лет назад
Родитель
Сommit
4060f0392d
3 измененных файлов с 151 добавлено и 1 удалено
  1. 1 1
      ACKNOWLEDGEMENTS.md
  2. 1 0
      DEVICES.md
  3. 149 0
      custom_components/tuya_local/devices/hdmi_sync_light.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, and for contributing support for dual mode light strings and Space Dog music lamps.
+- [and7ey](https://github.com/and7ey) for contributing support for dual mode light strings, Space Dog music lamps and HDMI sync lights.
 - [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

@@ -217,6 +217,7 @@ generic configurations known to work with multiple brands of device.
 - Atomi smart color string light
 - Deta/Arlec motion sensor lights (DET100HA/DET102HA/MAL315HA)
 - Dual-mode magic light string controller
+- HDMI sync light
 - Moes dimmer switch
 - Space Dog Music Lamp
 

+ 149 - 0
custom_components/tuya_local/devices/hdmi_sync_light.yaml

@@ -0,0 +1,149 @@
+name: HDMI sync light
+primary_entity:
+  entity: light
+  dps:
+    - id: 20
+      type: boolean
+      name: switch
+      optional: true
+      mapping:
+        - dps_val: null
+          value: false
+    - id: 21
+      type: string
+      name: color_mode
+      mapping:
+        - dps_val: white
+          value: brightness
+        - dps_val: colour
+          value: rgbw
+      optional: true
+    - id: 22
+      type: integer
+      name: brightness
+      range:
+        min: 0
+        max: 1000
+      mapping:
+        - scale: 3.92
+    - id: 24
+      type: hex
+      name: rgbhsv
+      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
+secondary_entities:
+  - entity: select
+    name: Scene
+    icon: "mdi:palette"
+    category: config
+    dps:
+      - id: 25
+        type: string
+        name: option
+        mapping:
+          - dps_val: 80000000000000000000000000000000
+            value: Screen - Movie
+          - dps_val: 81000000000000000000000000000000
+            value: Screen - Video
+          - dps_val: 82000000000000000000000000000000
+            value: Screen - Game
+          - dps_val: 83000000000000000000000000000000
+            value: Music - Spectrum
+          - dps_val: 84000000000000000000000000000000
+            value: Music - Electronic
+          - dps_val: 85000000000000000000000000000000
+            value: Music - Listen
+          - dps_val: 86000000000000000000000000000000
+            value: Scene - Rainbow
+          - dps_val: 87000000000000000000000000000000
+            value: Scene - Fire
+          - dps_val: 88000000000000000000000000000000
+            value: Scene - Read
+          - dps_val: 89000000000000000000000000000000
+            value: Scene - Firework
+          - dps_val: 90000000000000000000000000000000
+            value: Color Scene - Star
+          - dps_val: 91000000000000000000000000000000
+            value: Color Scene - Drip
+          - dps_val: 92000000000000000000000000000000
+            value: Color Scene - Particle
+          - dps_val: 93000000000000000000000000000000
+            value: Color Scene - Flow
+          - dps_val: 94000000000000000000000000000000
+            value: Color Scene - Ball
+          - dps_val: 95000000000000000000000000000000
+            value: Color Scene - Swing
+          - dps_val: 96000000000000000000000000000000
+            value: Color Scene - Breath
+          - dps_val: 97000000000000000000000000000000
+            value: Color Scene - Pure
+  - entity: number
+    name: Timer
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 26
+        type: integer
+        name: value
+        unit: 
+        range:
+          min: 0
+          max: 86400
+        optional: true
+        unit: min
+        mapping:
+          - scale: 60
+            step: 60
+
+  - entity: select
+    name: Installation side
+    category: config
+    icon: "mdi:cast-variant"
+    icon_priority: 2
+    dps:
+      - id: 101
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "0"
+            value: Left
+            icon: "mdi:rotate-left-variant"
+            icon_priority: 1
+          - dps_val: "1"
+            value: Right
+            icon: "mdi:rotate-right-variant"
+            icon_priority: 1
+  - entity: select
+    name: Lamp type
+    icon: "mdi:led-strip-variant"
+    icon_priority: 2
+    category: config
+    dps:
+      - id: 102
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "0"
+            value: Light strip
+          - dps_val: "1"
+            value: Light post
+            icon: "mdi:post-lamp"
+            icon_priority: 1
+
+