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

Add support for a generic CCT lightbulb.

We have an RGBCW lightbulb (full color control), and a dimming
lightbulb (no color control), this covers the in between case of a
lightbulb supporting cool-warm white adjustment, but no other colors.

Issue #730
Jason Rumney 2 лет назад
Родитель
Сommit
d54d4dcfb7

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -270,3 +270,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [LesTR](https://github.com/LesTR) for early assistance with the subdevice support, and contribution of test improvements for subdevices.
 - [JonF-49](https://github.com/JonF-49) for contributing support for RGBW lightbulbs, and improvements to color light entities that lack color temperature control.
 - [charliesjc](https://github.com/charliesjc) for contributing support for CBI Astute smart controller breaker switches.
+- [stijnb1234](https://github.com/stijnb1234) for assisting with support for CCT lightbulbs.

+ 1 - 0
DEVICES.md

@@ -288,6 +288,7 @@ of device.
 
 ### Lights
 
+- Generic CCT lightbulb (supporting color temperature and brightness)
 - Generic dimmable light (2 types, using dp 1,2 and 20,22)
 - Generic RGBCW/RGBWW lightbulb (confirmed with Lijun branded bulb, expected to match others also). Three versions - standard dps layout starting from 20, with and without scene/music modes and timer, and a non-standard layout starting from 1 but following the same pattern (tested with "A60" bulbs).
 - Generic RGBW lightbulb in the non-standard pattern above but without color temperature control.

+ 49 - 0
custom_components/tuya_local/devices/cct_lightbulb.yaml

@@ -0,0 +1,49 @@
+name: CCT lightbulb
+products:
+  - id: dqs8oqdeccnqjfkx
+    name: A60 lightbulb
+  - id: znfxaaxc89zz6m5a
+    name: A65 lightbulb
+primary_entity:
+  entity: light
+  dps:
+    - id: 20
+      type: boolean
+      name: switch
+    - id: 21
+      name: work_mode
+      type: string
+    - id: 22
+      name: brightness
+      type: integer
+      range:
+        min: 10
+        max: 1000
+    - id: 23
+      name: color_temp
+      type: integer
+      range:
+        min: 0
+        max: 1000
+    - id: 25
+      name: scene
+      type: hex
+      optional: true
+secondary_entities:
+  - entity: number
+    name: Timer
+    category: config
+    icon: "mdi:timer"
+    dps:
+      - id: 26
+        type: integer
+        name: value
+        unit: min
+        range:
+          min: 0
+          max: 86400
+        mapping:
+          - scale: 60
+            step: 60
+        optional: true
+

+ 1 - 1
custom_components/tuya_local/manifest.json

@@ -9,5 +9,5 @@
     "iot_class": "local_push",
     "issue_tracker": "https://github.com/make-all/tuya-local/issues",
     "requirements": ["pycryptodome~=3.17","tinytuya==1.12.7"],
-    "version": "2022.5.1"
+    "version": "2022.5.2"
 }