Przeglądaj źródła

Add limited support for PowerAsia 6-inch recessed lighting.

No RGB control for now, as we do not know the format (only that it
does not work with the usual 6 byte hsv hex encoded format).

Issue #2577
Jason Rumney 1 rok temu
rodzic
commit
952382f9b6

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -791,3 +791,4 @@ Further device support has been made with the assistance of users. Please consid
 - [doertli](https://github.com/doertli) for assisting with support for Aeratron AE3+ ceiling fan.
 - [0xa51f](https://github.com/0xa51f) for assisting with support for BNETA F1-D pet feeder.
 - [merlin051](https://github.com/merlin051) for assisting with support for Mayborn GroClock Connect.
+- [Sk1nnyDoc](https://github.com/Sk1nnyDoc) for assisting with support for PowerAsia RGB 6-inch recessed lighting.

+ 1 - 0
DEVICES.md

@@ -643,6 +643,7 @@ of device.
 - Newone WF39M dimmer smartplug
 - Nince RGB LED strip
 - Peteme recessed lighting
+- PowerAsia RGB 6-inch recessed lighting
 - Richelieu tunable white LED puck light (166142030)
 - Spa Electrics Iris pool light controller
 - Space Dog Music Lamp (works for Aurora Smart Galaxy Star)

+ 130 - 0
custom_components/tuya_local/devices/powerasia_6inchrecessed_lighting.yaml

@@ -0,0 +1,130 @@
+name: Light
+products:
+  - id: 8ugheslg
+    name: PowerAsia RGB 6 Inch recessed
+primary_entity:
+  entity: light
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+    # Most of the non-switch dps are write-only on this device, so there will
+    # be no feedback, but we can allow blind control as far as possible
+    - id: 2
+      name: color_mode
+      type: string
+      optional: true
+      mapping:
+        - dps_val: white
+          value: color_temp
+        - dps_val: colour
+          value: hs
+        - dps_val: scene
+          value: Scene
+        - dps_val: music
+          value: Music
+    - id: 3
+      name: brightness
+      type: integer
+      optional: true
+      range:
+        min: 10
+        max: 1000
+    - id: 4
+      name: color_temp
+      type: integer
+      optional: true
+      range:
+        min: 0
+        max: 1000
+      mapping:
+        - target_range:
+            min: 2700
+            max: 6500
+    - id: 11
+      name: color_data_raw
+      type: string
+      optional: true
+      # format unknown
+    - id: 109
+      type: string
+      optional: true
+      name: scene_data
+    - id: 113
+      type: string
+      optional: true
+      name: switch_gradient
+    - id: 121
+      type: string
+      optional: true
+      name: music_data
+    - id: 123
+      type: base64
+      optional: true
+      name: device_info
+secondary_entities:
+  - 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
+    translation_key: timer
+    category: config
+    class: duration
+    dps:
+      - id: 112
+        type: integer
+        name: value
+        unit: s
+        range:
+          min: 0
+          max: 86400
+      - id: 140
+        type: string
+        optional: true
+        name: timestamp
+      - id: 141
+        type: string
+        optional: true
+        name: local_timer
+      - id: 142
+        type: string
+        optional: true
+        name: timer_mgr
+  - entity: switch
+    name: Main switch
+    category: config
+    dps:
+      - id: 119
+        type: boolean
+        name: switch
+  - entity: select
+    name: Control
+    icon: "mdi:lightbulb-multiple"
+    category: config
+    dps:
+      - id: 125
+        type: string
+        name: option
+        mapping:
+          - dps_val: "0"
+            value: Independent
+          - dps_val: "1"
+            value: Grouped
+  - entity: light
+    translation_key: nightlight
+    category: config
+    dps:
+      - id: 143
+        type: boolean
+        name: switch