Explorar o código

Add support for Keyun RGB chandelier fan

Issue #1628
Jason Rumney %!s(int64=2) %!d(string=hai) anos
pai
achega
5b365f6a0a

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -495,3 +495,4 @@ Further device support has been made with the assistance of users. Please consid
 - [RoelDU](https://github.com/RoelDU) for assisting with support for Mirabella Genio Pixel oval lights.
 - [toposilva](https://github.com/toposilva) for assisting with support for 1CH dimmer modules.
 - [Pel1can111](https://github.com/Pel1can111) for assisting with support for Timeguard WFPIR motion light controller.
+- [ShiGhost](https://github.com/ShiGhost) for assisting with support for Keyun RGB chandelier fans.

+ 1 - 0
DEVICES.md

@@ -189,6 +189,7 @@
 - Immax Neo Lite Vento ceiling fan with light
 - Ledkia fan and light controller
 - Lexy F501 fan
+- Keyun MKCFE002 RGB chandelier fan
 - Kogan bladeless fans
 - Mantra ceiling fan with light
 - Ovlaim ceiling fan with cool/warm white dimmable light

+ 164 - 0
custom_components/tuya_local/devices/keyun_rgb_ceilingfan.yaml

@@ -0,0 +1,164 @@
+name: Ceiling fan
+products:
+  - id: lonfamz9k72cpjgq
+    name: Keyun MKCFE002
+primary_entity:
+  entity: fan
+  translation_key: fan_with_presets
+  dps:
+    - id: 60
+      type: boolean
+      name: switch
+    - id: 61
+      type: string
+      name: preset_mode
+      mapping:
+        - dps_val: fresh
+          value: fresh
+        - dps_val: nature
+          value: nature
+    - id: 62
+      type: integer
+      name: speed
+      range:
+        min: 1
+        max: 100
+    - id: 63
+      type: string
+      name: direction
+    - id: 106
+      type: boolean
+      name: oscillate
+secondary_entities:
+  - entity: light
+    dps:
+      - id: 20
+        type: boolean
+        name: switch
+      - id: 21
+        name: color_mode
+        type: string
+        mapping:
+          - dps_val: white
+            value: color_temp
+          - 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
+      - id: 23
+        name: color_temp
+        type: integer
+        range:
+          min: 0
+          max: 1000
+      - 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: scene_data
+      - id: 28
+        type: string
+        optional: true
+        name: control_data
+      - id: 33
+        type: string
+        optional: true
+        name: power_memory
+      - id: 35
+        type: string
+        optional: true
+        name: switch_gradient
+      - id: 51
+        type: string
+        optional: true
+        name: mix_rgbcw
+      - id: 121
+        type: string
+        optional: true
+        name: music_data
+  - entity: switch
+    name: Do not disturb
+    category: config
+    dps:
+      - id: 34
+        type: boolean
+        name: switch
+  - entity: sensor
+    name: Fan timer
+    class: duration
+    category: diagnostic
+    dps:
+      - id: 64
+        type: integer
+        name: sensor
+        unit: min
+  - entity: switch
+    name: Beep
+    icon: "mdi:volume-high"
+    category: config
+    dps:
+      - id: 103
+        type: boolean
+        name: switch
+  - entity: light
+    name: White
+    category: config
+    dps:
+      - id: 107
+        type: boolean
+        name: switch
+  - entity: light
+    name: Color
+    category: config
+    dps:
+      - id: 108
+        type: boolean
+        name: switch
+  - entity: number
+    name: Timer
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 112
+        type: integer
+        name: value
+        optional: true
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+  - entity: switch
+    name: Main switch
+    category: config
+    dps:
+      - id: 119
+        type: boolean
+        name: switch