Преглед изворни кода

Revert merging of Loonas and Zemismart curtains.

The "Reverse" dp takes different values for these two curtains.
Zemismart takes a boolean, while Loonas takes "back" or "forward" as
strings.

New config introduced for Loonas.

Issue #367
Jason Rumney пре 3 година
родитељ
комит
ce3ea79da2

+ 2 - 1
DEVICES.md

@@ -228,10 +228,11 @@ generic configurations known to work with multiple brands of device.
 - Benexmart blind motor
 - Dongguan garage door
 - Kogan garage door with tilt sensor
+- Loonas smart curtain
 - M027 curtain module (sold under several brands, including zemismart, meterk and others)
 - QS-WIFI-C01(BK) curtain module
 - Wistar roller blinds controller
-- Zemismart curtain rail (also matches Loonas and probably many others)
+- Zemismart curtain rail
 
 ### Vacuum Cleaners
 

+ 67 - 0
custom_components/tuya_local/devices/loonas_curtain.yaml

@@ -0,0 +1,67 @@
+name: Loonas smart curtain
+products:
+  - id: wraaecjqfiirj8go
+primary_entity:
+  entity: cover
+  class: curtain
+  dps:
+    - id: 1
+      name: control
+      type: string
+      mapping:
+        - dps_val: open
+          value: open
+        - dps_val: close
+          value: close
+        - dps_val: stop
+          value: stop
+    - id: 2
+      name: position
+      type: integer
+      range:
+        min: 0
+        max: 100
+      mapping:
+        - invert: true
+    - id: 3
+      name: current_position
+      type: integer
+      range:
+        min: 0
+        max: 100
+      mapping:
+        - invert: true
+    - id: 12
+      name: fault_code
+      type: bitfield
+      optional: true
+secondary_entities:
+  - entity: switch
+    name: Reverse
+    category: config
+    icon: "mdi:arrow-u-down-left"
+    dps:
+      - id: 5
+        type: string
+        name: switch
+        mapping:
+          - dps_val: back
+            value: true
+          - dps_val: forward
+            value: false
+  - entity: binary_sensor
+    name: Fault
+    class: problem
+    category: diagnostic
+    dps:
+      - id: 12
+        type: boolean
+        name: sensor
+        optional: true
+        mapping:
+          - dps_val: 0
+            value: false
+          - dps_val: null
+            value: false
+          - value: true
+

+ 1 - 4
custom_components/tuya_local/devices/zemismart_curtain.yaml

@@ -1,7 +1,4 @@
-name: Simple curtain
-products:
-  - id: wraaecjqfiirj8go
-    name: Loonas smart curtain
+name: Zemismart curtain
 primary_entity:
   entity: cover
   class: curtain