Sfoglia il codice sorgente

Zemismart curtain: make non-working work_mode optional.

Many curtains seem to match dps 1, 2, 3, 5, so catch them all by not requiring
dp 7 which doesn't seem to work anyway.

Add optional fault dp on 12, as per Loonas smart curtain.

Issue #367
Jason Rumney 3 anni fa
parent
commit
f989b1e359

+ 31 - 5
custom_components/tuya_local/devices/zemismart_curtain.yaml

@@ -1,7 +1,7 @@
-name: Zemismart curtain rail
+name: Simple curtain
 primary_entity:
 primary_entity:
   entity: cover
   entity: cover
-  class: blind
+  class: curtain
   dps:
   dps:
     - id: 1
     - id: 1
       name: control
       name: control
@@ -29,11 +29,37 @@ primary_entity:
         max: 100
         max: 100
       mapping:
       mapping:
         - invert: true
         - invert: true
-    - id: 5
-      name: control_back_mode
-      type: boolean
     - id: 7
     - id: 7
       name: work_state
       name: work_state
       type: string
       type: string
+      optional: true
       # seems intended to match action, but doesn't change in observation
       # seems intended to match action, but doesn't change in observation
+    - 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: boolean
+        name: switch
+  - 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