ソースを参照

Add support for Maxico aroma diffuser.

Same dp layout as Ditua, but uses small, big, off instead of small,
large, (null) for spray amounts.

Issue #1675
Jason Rumney 2 年 前
コミット
03a2819338

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -519,3 +519,4 @@ Further device support has been made with the assistance of users. Please consid
 - [popeen](https://github.com/popeen) for contributing support for Silvercrest Coffee makers.
 - [ciotorcristian](https://github.com/ciotorcristian) for contributing support for HoneyGuardian S56 pet feeder.
 - [Dexter-Lucky](https://github.com/Dexter-Lucky) for assisting with support for Zigbee PY321-Z-TY energy meters.
+- [teeodor](https://github.com/teeodor) for assisting with support for Maxico aroma diffusers.

+ 1 - 0
DEVICES.md

@@ -293,6 +293,7 @@
 - Cadance ultrasonic aroma diffuser with light and music playback
 - Ditua DT-1522-YN aroma diffuser
 - Etersky aroma diffuser with light
+- Maxico aroma diffuser with light (cannot be differentiated automatically from Ditua above)
 - Tesla Smart aroma diffuser with light
 - YX316WIFI aroma diffuser
 - YYM-805SW aroma diffuser with light (also supports GX Aroma diffuser)

+ 137 - 0
custom_components/tuya_local/devices/maxcio_aromadiffuser.yaml

@@ -0,0 +1,137 @@
+name: Aroma diffuser
+primary_entity:
+  entity: fan
+  icon: "mdi:scent"
+  dps:
+    - id: 1
+      type: boolean
+      name: switch
+    - id: 103
+      type: string
+      name: speed
+      mapping:
+        - dps_val: small
+          value: 50
+        - dps_val: big
+          value: 100
+        - dps_val: "off"
+          value: 0
+          hidden: true
+    - id: 12
+      type: bitfield
+      name: fault_code
+      optional: true
+secondary_entities:
+  - entity: light
+    name: LED
+    category: config
+    dps:
+      - id: 11
+        type: boolean
+        name: switch
+      - id: 108
+        type: hex
+        name: rgbhsv
+        format:
+          - name: r
+            bytes: 1
+          - name: g
+            bytes: 1
+          - name: b
+            bytes: 1
+          - name: h
+            bytes: 2
+            range:
+              min: 0
+              max: 360
+          - name: s
+            bytes: 1
+            range:
+              min: 0
+              max: 255
+          - name: v
+            bytes: 1
+            range:
+              min: 0
+              max: 255
+      - id: 109
+        type: string
+        name: color_mode
+        mapping:
+          - dps_val: white
+            value: white
+          - dps_val: colour
+            value: rgb
+          - dps_val: scene
+            value: Scene
+          - dps_val: scene1
+            value: Scene 1
+          - dps_val: scene2
+            value: Scene 2
+          - dps_val: scene3
+            value: Scene 3
+          - dps_val: scene4
+            value: Scene 4
+      - id: 111
+        type: integer
+        name: brightness
+        range:
+          min: 0
+          max: 255
+  - entity: select
+    name: Mood lighting
+    icon: "mdi:candelabra-fire"
+    category: config
+    dps:
+      - id: 110
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "1"
+            value: "Cycle"
+          - dps_val: "2"
+            value: "Fixed"
+          - dps_val: "3"
+            value: "Nightlight"
+  - entity: binary_sensor
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 12
+        type: bitfield
+        name: sensor
+        optional: true
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+  - entity: select
+    translation_key: timer
+    category: config
+    dps:
+      - id: 13
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: "0"
+            value: "Off"
+          - dps_val: "1"
+            value: "1 hour"
+          - dps_val: "2"
+            value: "3 hours"
+          - dps_val: "3"
+            value: "6 hours"
+  - entity: sensor
+    name: Time remaining
+    class: duration
+    category: diagnostic
+    dps:
+      - id: 14
+        type: integer
+        name: sensor
+        unit: min
+        optional: true