Explorar el Código

Eruiklink curtain: use current_position to determine state

Description of situation_set seems to indicate that it should be the
reliable way to tell if the curtain is fully opened or fully closed, but
it does not seem to be the case.

Issue #1735
Jason Rumney hace 2 años
padre
commit
1da9cfa103
Se han modificado 1 ficheros con 7 adiciones y 5 borrados
  1. 7 5
      custom_components/tuya_local/devices/eruiklink_curtains.yaml

+ 7 - 5
custom_components/tuya_local/devices/eruiklink_curtains.yaml

@@ -27,6 +27,9 @@ primary_entity:
     - id: 3
       type: integer
       name: current_position
+      range:
+        min: 0
+        max: 100
       mapping:
         - invert: true
     - id: 7
@@ -35,21 +38,20 @@ primary_entity:
       mapping:
         - dps_val: opening
           value: opening
-          constraint: situation_set
+          constraint: current_position
           conditions:
-            - dps_val: fully_open
+            - dps_val: 0
               value: opened
         - dps_val: closing
           value: closing
-          constraint: situation_set
+          constraint: current_position
           conditions:
-            - dps_val: fully_close
+            - dps_val: 100
               value: closed
     - id: 11
       type: string
       name: situation_set
       optional: true
-      persist: false
 secondary_entities:
   - entity: select
     name: Direction