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

Add support for RGB nightlight sockets.

Issue #360
Jason Rumney 3 лет назад
Родитель
Сommit
560ecaff7e
3 измененных файлов с 135 добавлено и 0 удалено
  1. 1 0
      ACKNOWLEDGEMENTS.md
  2. 1 0
      DEVICES.md
  3. 133 0
      custom_components/tuya_local/devices/rgb_nightlight_outlet.yaml

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -163,3 +163,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [spuljko](https://github.com/spuljko) for contributing support for YYM-805SW aroma diffuser with nightlight and BlitzWoolf BWSH5 humidifier.
 - [raphaelcouzet](https://github.com/raphaelcouzet) for contributing support for Arlec motion sensor lights which were used to improve Deta motion light support.
 - [TheExenth](https://github.com/TheExenth) for assistance supporting Salcar T9W thermostats, and identifying the likely identical Tellur model.
+- [MadDoct](https://github.com/MadDoct) for contributing support for RGB nightlight sockets.

+ 1 - 0
DEVICES.md

@@ -206,6 +206,7 @@ generic configurations known to work with multiple brands of device.
 - Simple switch with timer v2 - the above with timer moved from dp 11 to 9, confirmed with a Nexxt 220V smart switch.
 - Simple triple switch - three switches in a single device, tested with Somgam 3 gang wall switches.
 - Simple quad switch - four switches in a single device, tested with Somgam 4 gang wall switches.
+- RGB Nightlight outlet - one smartplug with a small built-in RGB light.
 
 ### Lights
 

+ 133 - 0
custom_components/tuya_local/devices/rgb_nightlight_outlet.yaml

@@ -0,0 +1,133 @@
+name: Scenario light socket
+primary_entity:
+  entity: switch
+  class: outlet
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+secondary_entities:
+  - entity: light
+    name: Night light
+    dps:
+      - id: 27
+        name: switch
+        type: boolean
+      - id: 28
+        type: string
+        name: color_mode
+        mapping:
+          - dps_val: white
+            value: white
+          - dps_val: colour
+            value: rgbw
+          - dps_val: scene
+            value: Scene
+          - dps_val: music
+            value: Music
+      - id: 31
+        name: rgbhsv
+        type: hex
+        optional: true
+        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
+  - entity: number
+    category: config
+    icon: "mdi:timer"
+    name: Timer
+    dps:
+      - id: 33
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: sensor
+    name: Current
+    class: current
+    category: diagnostic
+    dps:
+      - id: 4
+        type: integer
+        name: sensor
+        unit: mA
+        class: measurement
+  - entity: sensor
+    name: Voltage
+    class: voltage
+    category: diagnostic
+    dps:
+      - id: 5
+        type: integer
+        name: sensor
+        unit: V
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: sensor
+    name: Power
+    class: power
+    category: diagnostic
+    dps:
+      - id: 6
+        type: integer
+        name: sensor
+        unit: W
+        class: measurement
+        mapping:
+          - scale: 10
+  - entity: select
+    name: Scene
+    icon: "mdi:palette"
+    category: config
+    dps:
+      - id: 25
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "000c0d0000000000000000c80000"
+            value: Night
+          - dps_val: "010e0d0000840000000003e801f4"
+            # color: white, static
+            value: Read
+          - dps_val: "020e0d0000e80383000003e803e8"
+            # color: lt cyan, static
+            value: Working
+          - dps_val: "030e0d00001403e8000001f401f4"
+            # color: grey, static
+            value: Leisure
+          - dps_val: "04464602007803e803e800000000464602007803e8000a00000000"
+            # color: G+DkG, Breath, Mid speed
+            value: Soft
+          - dps_val: "05464601000003e803e800000000464601007803e803e80000000046460100f003e803e800000000464601003d03e803e80000000046460100ae03e803e800000000464601011303e803e800000000"
+            # color* R+G+B+Y+C+V, Flash, Mid speed
+            value: Colorful
+          - dps_val: "06464601000003e803e800000000464601007803e803e80000000046460100f003e803e800000000"
+            # color* R+G+B, Flash, Mid speed
+            value: Dazzling
+          - dps_val: "07464602000003e803e800000000464602007803e803e80000000046460200f003e803e800000000464602003d03e803e80000000046460200ae03e803e800000000464602011303e803e800000000"
+            # color* R+G+B+Y+C+V, Breath, Mid speed
+            value: Gorgeous
+
+
+
+