Selaa lähdekoodia

Conditional mappings do not support default mappings.

Defaults for conditions have to be set one level up in the mapping,
as the conditions only look for matches, not keep track of defaults.
There may be some side-effect to changing this, and setting one level
up is an acceptable workaround.

In read-write situations that need to control which options are set
for a specific value, it is sometimes better to list all conditions
rather than use a default.

Main effect is on climate hvac_action, swing_mode where more than just
two options for vertical and horizontal are available, cover actions
where opened/opening, closed/closing need to distinguished based on
position, and complex logic to handle optional vacuum activate and
pause switches.

Issue #1709
Jason Rumney 1 vuosi sitten
vanhempi
commit
aabc4e8ed5
31 muutettua tiedostoa jossa 117 lisäystä ja 71 poistoa
  1. 11 0
      custom_components/tuya_local/devices/README.md
  2. 2 1
      custom_components/tuya_local/devices/avatto_me81_thermostat.yaml
  3. 2 2
      custom_components/tuya_local/devices/avatto_roller_blinds.yaml
  4. 1 1
      custom_components/tuya_local/devices/becool_heatpump.yaml
  5. 2 1
      custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml
  6. 1 1
      custom_components/tuya_local/devices/beok_tr8b_thermostat.yaml
  7. 2 2
      custom_components/tuya_local/devices/ccb11_blind_controller.yaml
  8. 4 4
      custom_components/tuya_local/devices/daizuki_heatpump.yaml
  9. 2 2
      custom_components/tuya_local/devices/dongguan_electric_curtain.yaml
  10. 3 3
      custom_components/tuya_local/devices/evotherm_eti_heatpump.yaml
  11. 2 3
      custom_components/tuya_local/devices/greenmigo_alpha_q25_pro_wifi.yaml
  12. 8 5
      custom_components/tuya_local/devices/idea_heatingbelt_airconditioner.yaml
  13. 4 6
      custom_components/tuya_local/devices/inkbird_itc306a_thermostat.yaml
  14. 2 1
      custom_components/tuya_local/devices/jiahong_et72w_thermostat.yaml
  15. 10 2
      custom_components/tuya_local/devices/kabum_smart700_v2023_vaccum.yaml
  16. 2 2
      custom_components/tuya_local/devices/m027_curtain.yaml
  17. 1 1
      custom_components/tuya_local/devices/madimack_eco_heatpump.yaml
  18. 0 2
      custom_components/tuya_local/devices/me80_thermostat.yaml
  19. 5 1
      custom_components/tuya_local/devices/mellerware_comfy_radiator.yaml
  20. 0 1
      custom_components/tuya_local/devices/poolex_qline_heatpump.yaml
  21. 2 1
      custom_components/tuya_local/devices/qlima_d820a_dehumidifier.yaml
  22. 9 4
      custom_components/tuya_local/devices/rotenso_ronix_heatpump.yaml
  23. 2 1
      custom_components/tuya_local/devices/royalclima_rcb150_ventilation.yaml
  24. 2 2
      custom_components/tuya_local/devices/sherko_curtain.yaml
  25. 8 10
      custom_components/tuya_local/devices/starlight_heatpump.yaml
  26. 2 1
      custom_components/tuya_local/devices/taurus_agadir_heater.yaml
  27. 10 2
      custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml
  28. 9 5
      custom_components/tuya_local/devices/vivax_heatpump.yaml
  29. 6 2
      custom_components/tuya_local/devices/vivion_airconditioner.yaml
  30. 2 2
      custom_components/tuya_local/devices/zemismart_roller_shade.yaml
  31. 1 0
      tests/test_device_config.py

+ 11 - 0
custom_components/tuya_local/devices/README.md

@@ -511,6 +511,17 @@ If `constraint_dp` is readonly:
 | c | y | target_dp: 2 |
 | c | y | target_dp: 2 |
 | c | z | target_dp: 1 |
 | c | z | target_dp: 1 |
 
 
+Note that each condition must specify a `dps_val` to match againt. If you want to specify a default match, do it outside the conditions.
+
+```
+    mapping:
+      - dps_val: some_value
+        value: defaulted
+        constraint: other_dp
+        conditions:
+          - dps_val: other_value
+            value: overridden
+```
 
 
 
 
 ## Entity types
 ## Entity types

+ 2 - 1
custom_components/tuya_local/devices/avatto_me81_thermostat.yaml

@@ -50,7 +50,8 @@ primary_entity:
           conditions:
           conditions:
             - dps_val: false
             - dps_val: false
               value: "off"
               value: "off"
-            - mapping:
+            - dps_val: true
+              mapping:
                 - dps_val: open
                 - dps_val: open
                   value: heating
                   value: heating
                 - value: idle
                 - value: idle

+ 2 - 2
custom_components/tuya_local/devices/avatto_roller_blinds.yaml

@@ -35,21 +35,21 @@ primary_entity:
       type: string
       type: string
       mapping:
       mapping:
         - dps_val: opening
         - dps_val: opening
+          value: opening
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 100
             - dps_val: 100
               value: opened
               value: opened
             - dps_val: null
             - dps_val: null
               value: opened
               value: opened
-            - value: opening
         - dps_val: closing
         - dps_val: closing
+          value: closing
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 0
             - dps_val: 0
               value: closed
               value: closed
             - dps_val: null
             - dps_val: null
               value: closed
               value: closed
-            - value: closing
 secondary_entities:
 secondary_entities:
   - entity: select
   - entity: select
     translation_key: timer
     translation_key: timer

+ 1 - 1
custom_components/tuya_local/devices/becool_heatpump.yaml

@@ -9,6 +9,7 @@ primary_entity:
         - dps_val: false
         - dps_val: false
           value: "off"
           value: "off"
         - dps_val: true
         - dps_val: true
+          value: fan_only
           constraint: mode
           constraint: mode
           conditions:
           conditions:
             - dps_val: "0"
             - dps_val: "0"
@@ -21,7 +22,6 @@ primary_entity:
               value: cool
               value: cool
             - dps_val: "5"
             - dps_val: "5"
               value: heat
               value: heat
-            - value: fan_only
     - id: 4
     - id: 4
       type: integer
       type: integer
       name: unknown_4
       name: unknown_4

+ 2 - 1
custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml

@@ -20,7 +20,8 @@ primary_entity:
               hidden: true
               hidden: true
             - dps_val: home
             - dps_val: home
               value: heat
               value: heat
-            - value: heat
+            - dps_val: leave
+              value: heat
               hidden: true
               hidden: true
         - dps_val: false
         - dps_val: false
           value: "off"
           value: "off"

+ 1 - 1
custom_components/tuya_local/devices/beok_tr8b_thermostat.yaml

@@ -89,13 +89,13 @@ primary_entity:
       name: hvac_action
       name: hvac_action
       mapping:
       mapping:
         - dps_val: open
         - dps_val: open
+          value: idle
           constraint: preset_mode
           constraint: preset_mode
           conditions:
           conditions:
             - dps_val: [cool, floor]
             - dps_val: [cool, floor]
               value: cooling
               value: cooling
             - dps_val: [heat, floor_heat]
             - dps_val: [heat, floor_heat]
               value: heating
               value: heating
-            - value: idle
         - dps_val: close
         - dps_val: close
           constraint: hvac_mode
           constraint: hvac_mode
           conditions:
           conditions:

+ 2 - 2
custom_components/tuya_local/devices/ccb11_blind_controller.yaml

@@ -32,17 +32,17 @@ primary_entity:
       name: action
       name: action
       mapping:
       mapping:
         - dps_val: opening
         - dps_val: opening
+          value: opening
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 100
             - dps_val: 100
               value: opened
               value: opened
-            - value: opening
         - dps_val: closing
         - dps_val: closing
+          value: closing
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 0
             - dps_val: 0
               value: closed
               value: closed
-            - value: closing
     - id: 11
     - id: 11
       type: string
       type: string
       name: unknown_11
       name: unknown_11

+ 4 - 4
custom_components/tuya_local/devices/daizuki_heatpump.yaml

@@ -70,26 +70,26 @@ primary_entity:
       name: swing_mode
       name: swing_mode
       mapping:
       mapping:
         - dps_val: "0"
         - dps_val: "0"
+          value: horizontal
           constraint: horizontal_swing
           constraint: horizontal_swing
           conditions:
           conditions:
             - dps_val: "0"
             - dps_val: "0"
               value: "off"
               value: "off"
             - dps_val: "1"
             - dps_val: "1"
               value: horizontal
               value: horizontal
-            - value: horizontal
         - dps_val: "1"
         - dps_val: "1"
+          value: both
           constraint: horizontal_swing
           constraint: horizontal_swing
           conditions:
           conditions:
             - dps_val: "0"
             - dps_val: "0"
               value: vertical
               value: vertical
             - dps_val: "1"
             - dps_val: "1"
               value: both
               value: both
-            - value: both
-        - constraint: horizontal_swing
+        - value: both
+          constraint: horizontal_swing
           conditions:
           conditions:
             - dps_val: "0"
             - dps_val: "0"
               value: vertical
               value: vertical
-            - value: both
     - id: 114
     - id: 114
       type: string
       type: string
       name: horizontal_swing
       name: horizontal_swing

+ 2 - 2
custom_components/tuya_local/devices/dongguan_electric_curtain.yaml

@@ -32,19 +32,19 @@ primary_entity:
       type: string
       type: string
       mapping:
       mapping:
         - dps_val: opening
         - dps_val: opening
+          value: opening
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 0
             - dps_val: 0
               value: opened
               value: opened
-            - value: opening
         - dps_val: closing
         - dps_val: closing
+          value: closing
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 100
             - dps_val: 100
               value: closed
               value: closed
             - dps_val: null
             - dps_val: null
               value: closed
               value: closed
-            - value: closing
     - id: 12
     - id: 12
       name: fault_code
       name: fault_code
       type: bitfield
       type: bitfield

+ 3 - 3
custom_components/tuya_local/devices/evotherm_eti_heatpump.yaml

@@ -62,18 +62,18 @@ primary_entity:
       type: string
       type: string
       mapping:
       mapping:
         - dps_val: Running
         - dps_val: Running
+          value: heating
           constraint: preset_mode
           constraint: preset_mode
           conditions:
           conditions:
             - dps_val: ["Cooling_Powerful", "Cooling_Smart", "Cooling_Silent"]
             - dps_val: ["Cooling_Powerful", "Cooling_Smart", "Cooling_Silent"]
               value: cooling
               value: cooling
-            - value: heating
         - dps_val: Defrosting
         - dps_val: Defrosting
           value: preheating
           value: preheating
-        - constraint: hvac_mode
+        - value: idle
+          constraint: hvac_mode
           conditions:
           conditions:
             - dps_val: false
             - dps_val: false
               value: "off"
               value: "off"
-            - value: idle
     - id: 101
     - id: 101
       name: temperature
       name: temperature
       type: integer
       type: integer

+ 2 - 3
custom_components/tuya_local/devices/greenmigo_alpha_q25_pro_wifi.yaml

@@ -108,9 +108,8 @@ secondary_entities:
         mapping:
         mapping:
           - constraint: dehumidifier_mode
           - constraint: dehumidifier_mode
             conditions:
             conditions:
-              - dps_val: Manual
-              - dps_val: Purifier
-              - invalid: true
+              - dps_val: [Auto, Laundrydrying, Sleeping]
+                invalid: true
       - id: 4
       - id: 4
         name: speed
         name: speed
         type: string
         type: string

+ 8 - 5
custom_components/tuya_local/devices/idea_heatingbelt_airconditioner.yaml

@@ -78,7 +78,8 @@ primary_entity:
               value: "off"
               value: "off"
             - dps_val: true
             - dps_val: true
               value: horizontal
               value: horizontal
-            - value: "off"
+            - dps_val: null
+              value: "off"
               hidden: true
               hidden: true
         - dps_val: true
         - dps_val: true
           constraint: swing_horiz
           constraint: swing_horiz
@@ -87,14 +88,16 @@ primary_entity:
               value: vertical
               value: vertical
             - dps_val: true
             - dps_val: true
               value: both
               value: both
-            - value: vertical
+            - dps_val: null
+              value: vertical
               hidden: true
               hidden: true
         - constraint: swing_horiz
         - constraint: swing_horiz
           conditions:
           conditions:
             - dps_val: true
             - dps_val: true
               value: horizontal
               value: horizontal
               hidden: true
               hidden: true
-            - value: "off"
+            - dps_val: null
+              value: "off"
               hidden: true
               hidden: true
     - id: 33
     - id: 33
       type: boolean
       type: boolean
@@ -130,21 +133,21 @@ secondary_entities:
         optional: true
         optional: true
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
+            value: true
             constraint: fault_code_2
             constraint: fault_code_2
             conditions:
             conditions:
               - dps_val: null
               - dps_val: null
                 value: false
                 value: false
               - dps_val: 0
               - dps_val: 0
                 value: false
                 value: false
-              - value: true
           - dps_val: null
           - dps_val: null
+            value: true
             constraint: fault_code_2
             constraint: fault_code_2
             conditions:
             conditions:
               - dps_val: null
               - dps_val: null
                 value: false
                 value: false
               - dps_val: 0
               - dps_val: 0
                 value: false
                 value: false
-              - value: true
           - value: true
           - value: true
       - id: 22
       - id: 22
         type: bitfield
         type: bitfield

+ 4 - 6
custom_components/tuya_local/devices/inkbird_itc306a_thermostat.yaml

@@ -91,7 +91,10 @@ primary_entity:
       type: boolean
       type: boolean
       name: hvac_action
       name: hvac_action
       mapping:
       mapping:
-        - constraint: hvac_mode
+        - icon: "mdi:thermometer-off"
+          icon_priority: 5
+          value: "off"
+          constraint: hvac_mode
           conditions:
           conditions:
             - dps_val: "on"
             - dps_val: "on"
               mapping:
               mapping:
@@ -100,12 +103,7 @@ primary_entity:
                   icon_priority: 6
                   icon_priority: 6
                   value: heating
                   value: heating
                 - dps_val: false
                 - dps_val: false
-                  icon: "mdi:thermometer-off"
-                  icon_priority: 5
                   value: idle
                   value: idle
-            - icon: "mdi:thermometer-off"
-              icon_priority: 5
-              value: "off"
     - id: 116
     - id: 116
       type: integer
       type: integer
       name: current_temperature_f
       name: current_temperature_f

+ 2 - 1
custom_components/tuya_local/devices/jiahong_et72w_thermostat.yaml

@@ -75,7 +75,8 @@ primary_entity:
           conditions:
           conditions:
             - dps_val: false
             - dps_val: false
               value: "off"
               value: "off"
-            - mapping:
+            - dps_val: true
+              mapping:
                 - dps_val: true
                 - dps_val: true
                   value: heating
                   value: heating
                 - dps_val: false
                 - dps_val: false

+ 10 - 2
custom_components/tuya_local/devices/kabum_smart700_v2023_vaccum.yaml

@@ -15,14 +15,22 @@ primary_entity:
           conditions:
           conditions:
             - dps_val: true
             - dps_val: true
               value: false
               value: false
-            - value: false
+            - dps_val: false
+              value: false
+              hidden: true
+            - dps_val: null
+              value: false
               hidden: true
               hidden: true
         - dps_val: true
         - dps_val: true
           constraint: pause
           constraint: pause
           conditions:
           conditions:
             - dps_val: false
             - dps_val: false
               value: true
               value: true
-            - value: true
+            - dps_val: true
+              value: true
+              hidden: true
+            - dps_val: null
+              value: true
               hidden: true
               hidden: true
         - dps_val: null
         - dps_val: null
           value: false
           value: false

+ 2 - 2
custom_components/tuya_local/devices/m027_curtain.yaml

@@ -32,21 +32,21 @@ primary_entity:
       persist: false
       persist: false
       mapping:
       mapping:
         - dps_val: opening
         - dps_val: opening
+          value: opening
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 100
             - dps_val: 100
               value: opened
               value: opened
             - dps_val: null
             - dps_val: null
               value: opened
               value: opened
-            - value: opening
         - dps_val: closing
         - dps_val: closing
+          value: closing
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 0
             - dps_val: 0
               value: closed
               value: closed
             - dps_val: null
             - dps_val: null
               value: closed
               value: closed
-            - value: closing
     - id: 12
     - id: 12
       name: fault_code
       name: fault_code
       type: bitfield
       type: bitfield

+ 1 - 1
custom_components/tuya_local/devices/madimack_eco_heatpump.yaml

@@ -107,11 +107,11 @@ secondary_entities:
         name: sensor
         name: sensor
         mapping:
         mapping:
           - dps_val: 0
           - dps_val: 0
+            value: true
             constraint: fault_2
             constraint: fault_2
             conditions:
             conditions:
               - dps_val: 0
               - dps_val: 0
                 value: false
                 value: false
-              - value: true
           - value: true
           - value: true
   - entity: sensor
   - entity: sensor
     name: Compressor strength
     name: Compressor strength

+ 0 - 2
custom_components/tuya_local/devices/me80_thermostat.yaml

@@ -14,8 +14,6 @@ primary_entity:
               value: auto
               value: auto
             - dps_val: manual
             - dps_val: manual
               value: heat
               value: heat
-              # in case of unknown presets
-            - value: heat
         - dps_val: false
         - dps_val: false
           value: "off"
           value: "off"
     - id: 2
     - id: 2

+ 5 - 1
custom_components/tuya_local/devices/mellerware_comfy_radiator.yaml

@@ -21,7 +21,11 @@ primary_entity:
               hidden: true
               hidden: true
             - dps_val: CF
             - dps_val: CF
               value: heat
               value: heat
-            - value: heat
+            - dps_val: [EC, AF]
+              value: heat
+              hidden: true
+            - dps_val: ST
+              value: "off"
               hidden: true
               hidden: true
     - id: 2
     - id: 2
       type: integer
       type: integer

+ 0 - 1
custom_components/tuya_local/devices/poolex_qline_heatpump.yaml

@@ -19,7 +19,6 @@ primary_entity:
               value: heat
               value: heat
             - dps_val: mute
             - dps_val: mute
               value: heat_cool
               value: heat_cool
-            - value: heat_cool
     - id: 2
     - id: 2
       name: heating_mode
       name: heating_mode
       hidden: true
       hidden: true

+ 2 - 1
custom_components/tuya_local/devices/qlima_d820a_dehumidifier.yaml

@@ -49,7 +49,8 @@ secondary_entities:
             conditions:
             conditions:
               - dps_val: airpurify
               - dps_val: airpurify
                 value_redirect: purify_speed
                 value_redirect: purify_speed
-              - mapping:
+              - dps_val: [dehum_air, dehum30_air]
+                mapping:
                   - dps_val: low
                   - dps_val: low
                     value: 33
                     value: 33
                   - dps_val: mid
                   - dps_val: mid

+ 9 - 4
custom_components/tuya_local/devices/rotenso_ronix_heatpump.yaml

@@ -81,7 +81,9 @@ primary_entity:
               value: "off"
               value: "off"
             - dps_val: "1"
             - dps_val: "1"
               value: horizontal
               value: horizontal
-            - value: horizontal
+            - dps_val: ["2", "3", "4"]
+              value: horizontal
+              hidden: true
         - dps_val: "1"
         - dps_val: "1"
           constraint: horizontal_swing
           constraint: horizontal_swing
           conditions:
           conditions:
@@ -89,12 +91,15 @@ primary_entity:
               value: vertical
               value: vertical
             - dps_val: "1"
             - dps_val: "1"
               value: both
               value: both
-            - value: both
-        - constraint: horizontal_swing
+            - dps_val: ["2", "3", "4"]
+              value: both
+              hidden: true
+        - hidden: true
+          value: both
+          constraint: horizontal_swing
           conditions:
           conditions:
             - dps_val: "0"
             - dps_val: "0"
               value: vertical
               value: vertical
-            - value: both
     - id: 114
     - id: 114
       type: string
       type: string
       name: horizontal_swing
       name: horizontal_swing

+ 2 - 1
custom_components/tuya_local/devices/royalclima_rcb150_ventilation.yaml

@@ -133,7 +133,8 @@ secondary_entities:
             conditions:
             conditions:
               - dps_val: true
               - dps_val: true
                 value: heat
                 value: heat
-              - value: "off"
+              - dps_val: false
+                value: "off"
       - id: 102
       - id: 102
         name: temperature
         name: temperature
         type: integer
         type: integer

+ 2 - 2
custom_components/tuya_local/devices/sherko_curtain.yaml

@@ -35,21 +35,21 @@ primary_entity:
       name: action
       name: action
       mapping:
       mapping:
         - dps_val: opening
         - dps_val: opening
+          value: opening
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 100
             - dps_val: 100
               value: opened
               value: opened
             - dps_val: null
             - dps_val: null
               value: opened
               value: opened
-            - value: opening
         - dps_val: closing
         - dps_val: closing
+          value: closing
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 0
             - dps_val: 0
               value: closed
               value: closed
             - dps_val: null
             - dps_val: null
               value: closed
               value: closed
-            - value: closing
 secondary_entities:
 secondary_entities:
   - entity: switch
   - entity: switch
     category: config
     category: config

+ 8 - 10
custom_components/tuya_local/devices/starlight_heatpump.yaml

@@ -84,7 +84,9 @@ primary_entity:
               value: "off"
               value: "off"
             - dps_val: "1"
             - dps_val: "1"
               value: horizontal
               value: horizontal
-            - value: horizontal
+            - dps_val: ["2", "3", "4"]
+              value: horizontal
+              hidden: true
         - dps_val: "1"
         - dps_val: "1"
           constraint: horizontal_swing
           constraint: horizontal_swing
           conditions:
           conditions:
@@ -92,19 +94,15 @@ primary_entity:
               value: vertical
               value: vertical
             - dps_val: "1"
             - dps_val: "1"
               value: both
               value: both
-            - value: both
-        - dps_val: "2"
-          constraint: horizontal_swing
-          conditions:
-            - dps_val: "0"
-              value: vertical
-            - value: both
-        - dps_val: "3"
+            - dps_val: ["2", "3", "4"]
+              value: both
+              hidden: true
+        - value: both
+          hidden: true
           constraint: horizontal_swing
           constraint: horizontal_swing
           conditions:
           conditions:
             - dps_val: "0"
             - dps_val: "0"
               value: vertical
               value: vertical
-            - value: both
     - id: 114
     - id: 114
       name: horizontal_swing
       name: horizontal_swing
       type: string
       type: string

+ 2 - 1
custom_components/tuya_local/devices/taurus_agadir_heater.yaml

@@ -37,7 +37,8 @@ primary_entity:
           conditions:
           conditions:
             - dps_val: false
             - dps_val: false
               value: "off"
               value: "off"
-            - mapping:
+            - dps_val: true
+              mapping:
                 - dps_val: working
                 - dps_val: working
                   value: heating
                   value: heating
                 - dps_val: standby
                 - dps_val: standby

+ 10 - 2
custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml

@@ -15,14 +15,22 @@ primary_entity:
           conditions:
           conditions:
             - dps_val: true
             - dps_val: true
               value: false
               value: false
-            - value: false
+            - dps_val: false
+              value: false
+              hidden: true
+            - dps_val: null
+              value: false
               hidden: true
               hidden: true
         - dps_val: true
         - dps_val: true
           constraint: pause
           constraint: pause
           conditions:
           conditions:
             - dps_val: false
             - dps_val: false
               value: true
               value: true
-            - value: true
+            - dps_val: true
+              value: true
+              hidden: true
+            - dps_val: null
+              value: true
               hidden: true
               hidden: true
         - dps_val: null
         - dps_val: null
           value: false
           value: false

+ 9 - 5
custom_components/tuya_local/devices/vivax_heatpump.yaml

@@ -138,7 +138,9 @@ primary_entity:
               value: both
               value: both
             - dps_val: lr_00
             - dps_val: lr_00
               value: vertical
               value: vertical
-            - value: vertical
+            - dps_val: [lr_01, lr_02, lr_03, lr_04]
+              value: vertical
+              hidden: true
         - dps_val: ud_00
         - dps_val: ud_00
           constraint: horizontal_swing
           constraint: horizontal_swing
           conditions:
           conditions:
@@ -146,16 +148,18 @@ primary_entity:
               value: horizontal
               value: horizontal
             - dps_val: lr_00
             - dps_val: lr_00
               value: "off"
               value: "off"
-            - value: "off"
-        - constraint: horizontal_swing
+            - dps_val: [lr_01, lr_02, lr_03, lr_04]
+              value: "off"
+              hidden: true
+        - value: "off"
+          hidden: true
+          constraint: horizontal_swing
           conditions:
           conditions:
             - dps_val: lr_0c
             - dps_val: lr_0c
               value: horizontal
               value: horizontal
-            - value: "off"
     - id: 118
     - id: 118
       type: string
       type: string
       name: horizontal_swing
       name: horizontal_swing
-      # From Tadiran Apollo
     - id: 101
     - id: 101
       type: boolean
       type: boolean
       name: mood_lighting
       name: mood_lighting

+ 6 - 2
custom_components/tuya_local/devices/vivion_airconditioner.yaml

@@ -82,7 +82,9 @@ primary_entity:
               value: "off"
               value: "off"
             - dps_val: same
             - dps_val: same
               value: vertical
               value: vertical
-            - value: "off"
+            - dps_val: [vane_1, vane_2, vane_3, vane_4, vane_5]
+              value: "off"
+              hidden: true
         - dps_val: true
         - dps_val: true
           constraint: vertical
           constraint: vertical
           conditions:
           conditions:
@@ -90,7 +92,9 @@ primary_entity:
               value: horizontal
               value: horizontal
             - dps_val: same
             - dps_val: same
               value: both
               value: both
-            - value: horizontal
+            - dps_val: [vane_1, vane_2, vane_3, vane_4, vane_5]
+              value: horizontal
+              hidden: true
     - id: 103
     - id: 103
       type: string
       type: string
       name: unknown_103
       name: unknown_103

+ 2 - 2
custom_components/tuya_local/devices/zemismart_roller_shade.yaml

@@ -39,17 +39,17 @@ primary_entity:
       type: string
       type: string
       mapping:
       mapping:
         - dps_val: opening
         - dps_val: opening
+          value: opening
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 0
             - dps_val: 0
               value: opened
               value: opened
-            - value: opening
         - dps_val: closing
         - dps_val: closing
+          value: closing
           constraint: current_position
           constraint: current_position
           conditions:
           conditions:
             - dps_val: 100
             - dps_val: 100
               value: closed
               value: closed
-            - value: closing
     - id: 12
     - id: 12
       name: fault_code
       name: fault_code
       type: bitfield
       type: bitfield

+ 1 - 0
tests/test_device_config.py

@@ -56,6 +56,7 @@ CONDMAP_SCHEMA = vol.Schema(
 )
 )
 COND_SCHEMA = CONDMAP_SCHEMA.extend(
 COND_SCHEMA = CONDMAP_SCHEMA.extend(
     {
     {
+        vol.Required("dps_val"): vol.Maybe(vol.Any(str, int, bool, list)),
         vol.Optional("mapping"): [CONDMAP_SCHEMA],
         vol.Optional("mapping"): [CONDMAP_SCHEMA],
     }
     }
 )
 )