From aabc4e8ed573df4d85f713e5acc64907d4855ffb Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Thu, 7 Mar 2024 18:50:09 +0900 Subject: [PATCH] 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 --- custom_components/tuya_local/devices/README.md | 11 +++++++++++ .../devices/avatto_me81_thermostat.yaml | 3 ++- .../devices/avatto_roller_blinds.yaml | 4 ++-- .../tuya_local/devices/becool_heatpump.yaml | 2 +- .../devices/beok_tgm50_thermostat.yaml | 3 ++- .../devices/beok_tr8b_thermostat.yaml | 2 +- .../devices/ccb11_blind_controller.yaml | 4 ++-- .../tuya_local/devices/daizuki_heatpump.yaml | 8 ++++---- .../devices/dongguan_electric_curtain.yaml | 4 ++-- .../devices/evotherm_eti_heatpump.yaml | 6 +++--- .../devices/greenmigo_alpha_q25_pro_wifi.yaml | 5 ++--- .../idea_heatingbelt_airconditioner.yaml | 13 ++++++++----- .../devices/inkbird_itc306a_thermostat.yaml | 10 ++++------ .../devices/jiahong_et72w_thermostat.yaml | 3 ++- .../devices/kabum_smart700_v2023_vaccum.yaml | 12 ++++++++++-- .../tuya_local/devices/m027_curtain.yaml | 4 ++-- .../devices/madimack_eco_heatpump.yaml | 2 +- .../tuya_local/devices/me80_thermostat.yaml | 2 -- .../devices/mellerware_comfy_radiator.yaml | 6 +++++- .../devices/poolex_qline_heatpump.yaml | 1 - .../devices/qlima_d820a_dehumidifier.yaml | 3 ++- .../devices/rotenso_ronix_heatpump.yaml | 13 +++++++++---- .../devices/royalclima_rcb150_ventilation.yaml | 3 ++- .../tuya_local/devices/sherko_curtain.yaml | 4 ++-- .../tuya_local/devices/starlight_heatpump.yaml | 18 ++++++++---------- .../devices/taurus_agadir_heater.yaml | 3 ++- .../devices/ttec_reobipro_vacuum.yaml | 12 ++++++++++-- .../tuya_local/devices/vivax_heatpump.yaml | 14 +++++++++----- .../devices/vivion_airconditioner.yaml | 8 ++++++-- .../devices/zemismart_roller_shade.yaml | 4 ++-- tests/test_device_config.py | 1 + 31 files changed, 117 insertions(+), 71 deletions(-) diff --git a/custom_components/tuya_local/devices/README.md b/custom_components/tuya_local/devices/README.md index 72b4c008c9..09ea3a2c2a 100644 --- a/custom_components/tuya_local/devices/README.md +++ b/custom_components/tuya_local/devices/README.md @@ -511,6 +511,17 @@ If `constraint_dp` is readonly: | c | y | target_dp: 2 | | 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 diff --git a/custom_components/tuya_local/devices/avatto_me81_thermostat.yaml b/custom_components/tuya_local/devices/avatto_me81_thermostat.yaml index 19a6d4100c..879eee82dd 100644 --- a/custom_components/tuya_local/devices/avatto_me81_thermostat.yaml +++ b/custom_components/tuya_local/devices/avatto_me81_thermostat.yaml @@ -50,7 +50,8 @@ primary_entity: conditions: - dps_val: false value: "off" - - mapping: + - dps_val: true + mapping: - dps_val: open value: heating - value: idle diff --git a/custom_components/tuya_local/devices/avatto_roller_blinds.yaml b/custom_components/tuya_local/devices/avatto_roller_blinds.yaml index 5e6b18dc22..a4c4725c80 100644 --- a/custom_components/tuya_local/devices/avatto_roller_blinds.yaml +++ b/custom_components/tuya_local/devices/avatto_roller_blinds.yaml @@ -35,21 +35,21 @@ primary_entity: type: string mapping: - dps_val: opening + value: opening constraint: current_position conditions: - dps_val: 100 value: opened - dps_val: null value: opened - - value: opening - dps_val: closing + value: closing constraint: current_position conditions: - dps_val: 0 value: closed - dps_val: null value: closed - - value: closing secondary_entities: - entity: select translation_key: timer diff --git a/custom_components/tuya_local/devices/becool_heatpump.yaml b/custom_components/tuya_local/devices/becool_heatpump.yaml index 830f6d3d90..1ec871de93 100644 --- a/custom_components/tuya_local/devices/becool_heatpump.yaml +++ b/custom_components/tuya_local/devices/becool_heatpump.yaml @@ -9,6 +9,7 @@ primary_entity: - dps_val: false value: "off" - dps_val: true + value: fan_only constraint: mode conditions: - dps_val: "0" @@ -21,7 +22,6 @@ primary_entity: value: cool - dps_val: "5" value: heat - - value: fan_only - id: 4 type: integer name: unknown_4 diff --git a/custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml b/custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml index 1457d1e651..b19536fa3b 100644 --- a/custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml +++ b/custom_components/tuya_local/devices/beok_tgm50_thermostat.yaml @@ -20,7 +20,8 @@ primary_entity: hidden: true - dps_val: home value: heat - - value: heat + - dps_val: leave + value: heat hidden: true - dps_val: false value: "off" diff --git a/custom_components/tuya_local/devices/beok_tr8b_thermostat.yaml b/custom_components/tuya_local/devices/beok_tr8b_thermostat.yaml index c601f49260..e9ca7a6412 100644 --- a/custom_components/tuya_local/devices/beok_tr8b_thermostat.yaml +++ b/custom_components/tuya_local/devices/beok_tr8b_thermostat.yaml @@ -89,13 +89,13 @@ primary_entity: name: hvac_action mapping: - dps_val: open + value: idle constraint: preset_mode conditions: - dps_val: [cool, floor] value: cooling - dps_val: [heat, floor_heat] value: heating - - value: idle - dps_val: close constraint: hvac_mode conditions: diff --git a/custom_components/tuya_local/devices/ccb11_blind_controller.yaml b/custom_components/tuya_local/devices/ccb11_blind_controller.yaml index 9a1156f67b..ddd64e1153 100644 --- a/custom_components/tuya_local/devices/ccb11_blind_controller.yaml +++ b/custom_components/tuya_local/devices/ccb11_blind_controller.yaml @@ -32,17 +32,17 @@ primary_entity: name: action mapping: - dps_val: opening + value: opening constraint: current_position conditions: - dps_val: 100 value: opened - - value: opening - dps_val: closing + value: closing constraint: current_position conditions: - dps_val: 0 value: closed - - value: closing - id: 11 type: string name: unknown_11 diff --git a/custom_components/tuya_local/devices/daizuki_heatpump.yaml b/custom_components/tuya_local/devices/daizuki_heatpump.yaml index c6db302510..763fccf63a 100644 --- a/custom_components/tuya_local/devices/daizuki_heatpump.yaml +++ b/custom_components/tuya_local/devices/daizuki_heatpump.yaml @@ -70,26 +70,26 @@ primary_entity: name: swing_mode mapping: - dps_val: "0" + value: horizontal constraint: horizontal_swing conditions: - dps_val: "0" value: "off" - dps_val: "1" value: horizontal - - value: horizontal - dps_val: "1" + value: both constraint: horizontal_swing conditions: - dps_val: "0" value: vertical - dps_val: "1" value: both - - value: both - - constraint: horizontal_swing + - value: both + constraint: horizontal_swing conditions: - dps_val: "0" value: vertical - - value: both - id: 114 type: string name: horizontal_swing diff --git a/custom_components/tuya_local/devices/dongguan_electric_curtain.yaml b/custom_components/tuya_local/devices/dongguan_electric_curtain.yaml index 06e9a47b95..eac21a66d0 100644 --- a/custom_components/tuya_local/devices/dongguan_electric_curtain.yaml +++ b/custom_components/tuya_local/devices/dongguan_electric_curtain.yaml @@ -32,19 +32,19 @@ primary_entity: type: string mapping: - dps_val: opening + value: opening constraint: current_position conditions: - dps_val: 0 value: opened - - value: opening - dps_val: closing + value: closing constraint: current_position conditions: - dps_val: 100 value: closed - dps_val: null value: closed - - value: closing - id: 12 name: fault_code type: bitfield diff --git a/custom_components/tuya_local/devices/evotherm_eti_heatpump.yaml b/custom_components/tuya_local/devices/evotherm_eti_heatpump.yaml index 7b32d76a42..16262fece6 100644 --- a/custom_components/tuya_local/devices/evotherm_eti_heatpump.yaml +++ b/custom_components/tuya_local/devices/evotherm_eti_heatpump.yaml @@ -62,18 +62,18 @@ primary_entity: type: string mapping: - dps_val: Running + value: heating constraint: preset_mode conditions: - dps_val: ["Cooling_Powerful", "Cooling_Smart", "Cooling_Silent"] value: cooling - - value: heating - dps_val: Defrosting value: preheating - - constraint: hvac_mode + - value: idle + constraint: hvac_mode conditions: - dps_val: false value: "off" - - value: idle - id: 101 name: temperature type: integer diff --git a/custom_components/tuya_local/devices/greenmigo_alpha_q25_pro_wifi.yaml b/custom_components/tuya_local/devices/greenmigo_alpha_q25_pro_wifi.yaml index 8c8120dfb9..f499139df5 100644 --- a/custom_components/tuya_local/devices/greenmigo_alpha_q25_pro_wifi.yaml +++ b/custom_components/tuya_local/devices/greenmigo_alpha_q25_pro_wifi.yaml @@ -108,9 +108,8 @@ secondary_entities: mapping: - constraint: dehumidifier_mode conditions: - - dps_val: Manual - - dps_val: Purifier - - invalid: true + - dps_val: [Auto, Laundrydrying, Sleeping] + invalid: true - id: 4 name: speed type: string diff --git a/custom_components/tuya_local/devices/idea_heatingbelt_airconditioner.yaml b/custom_components/tuya_local/devices/idea_heatingbelt_airconditioner.yaml index bf4a52dadd..6519df5763 100644 --- a/custom_components/tuya_local/devices/idea_heatingbelt_airconditioner.yaml +++ b/custom_components/tuya_local/devices/idea_heatingbelt_airconditioner.yaml @@ -78,7 +78,8 @@ primary_entity: value: "off" - dps_val: true value: horizontal - - value: "off" + - dps_val: null + value: "off" hidden: true - dps_val: true constraint: swing_horiz @@ -87,14 +88,16 @@ primary_entity: value: vertical - dps_val: true value: both - - value: vertical + - dps_val: null + value: vertical hidden: true - constraint: swing_horiz conditions: - dps_val: true value: horizontal hidden: true - - value: "off" + - dps_val: null + value: "off" hidden: true - id: 33 type: boolean @@ -130,21 +133,21 @@ secondary_entities: optional: true mapping: - dps_val: 0 + value: true constraint: fault_code_2 conditions: - dps_val: null value: false - dps_val: 0 value: false - - value: true - dps_val: null + value: true constraint: fault_code_2 conditions: - dps_val: null value: false - dps_val: 0 value: false - - value: true - value: true - id: 22 type: bitfield diff --git a/custom_components/tuya_local/devices/inkbird_itc306a_thermostat.yaml b/custom_components/tuya_local/devices/inkbird_itc306a_thermostat.yaml index 826debe1ab..7a740a8483 100644 --- a/custom_components/tuya_local/devices/inkbird_itc306a_thermostat.yaml +++ b/custom_components/tuya_local/devices/inkbird_itc306a_thermostat.yaml @@ -91,7 +91,10 @@ primary_entity: type: boolean name: hvac_action mapping: - - constraint: hvac_mode + - icon: "mdi:thermometer-off" + icon_priority: 5 + value: "off" + constraint: hvac_mode conditions: - dps_val: "on" mapping: @@ -100,12 +103,7 @@ primary_entity: icon_priority: 6 value: heating - dps_val: false - icon: "mdi:thermometer-off" - icon_priority: 5 value: idle - - icon: "mdi:thermometer-off" - icon_priority: 5 - value: "off" - id: 116 type: integer name: current_temperature_f diff --git a/custom_components/tuya_local/devices/jiahong_et72w_thermostat.yaml b/custom_components/tuya_local/devices/jiahong_et72w_thermostat.yaml index 510eb2f3fa..f1f8e76e86 100644 --- a/custom_components/tuya_local/devices/jiahong_et72w_thermostat.yaml +++ b/custom_components/tuya_local/devices/jiahong_et72w_thermostat.yaml @@ -75,7 +75,8 @@ primary_entity: conditions: - dps_val: false value: "off" - - mapping: + - dps_val: true + mapping: - dps_val: true value: heating - dps_val: false diff --git a/custom_components/tuya_local/devices/kabum_smart700_v2023_vaccum.yaml b/custom_components/tuya_local/devices/kabum_smart700_v2023_vaccum.yaml index ec796abf58..acecf5c32e 100644 --- a/custom_components/tuya_local/devices/kabum_smart700_v2023_vaccum.yaml +++ b/custom_components/tuya_local/devices/kabum_smart700_v2023_vaccum.yaml @@ -15,14 +15,22 @@ primary_entity: conditions: - dps_val: true value: false - - value: false + - dps_val: false + value: false + hidden: true + - dps_val: null + value: false hidden: true - dps_val: true constraint: pause conditions: - dps_val: false value: true - - value: true + - dps_val: true + value: true + hidden: true + - dps_val: null + value: true hidden: true - dps_val: null value: false diff --git a/custom_components/tuya_local/devices/m027_curtain.yaml b/custom_components/tuya_local/devices/m027_curtain.yaml index 549c14da40..f441dc4d9a 100644 --- a/custom_components/tuya_local/devices/m027_curtain.yaml +++ b/custom_components/tuya_local/devices/m027_curtain.yaml @@ -32,21 +32,21 @@ primary_entity: persist: false mapping: - dps_val: opening + value: opening constraint: current_position conditions: - dps_val: 100 value: opened - dps_val: null value: opened - - value: opening - dps_val: closing + value: closing constraint: current_position conditions: - dps_val: 0 value: closed - dps_val: null value: closed - - value: closing - id: 12 name: fault_code type: bitfield diff --git a/custom_components/tuya_local/devices/madimack_eco_heatpump.yaml b/custom_components/tuya_local/devices/madimack_eco_heatpump.yaml index 3b4582b574..1f2e253fc7 100644 --- a/custom_components/tuya_local/devices/madimack_eco_heatpump.yaml +++ b/custom_components/tuya_local/devices/madimack_eco_heatpump.yaml @@ -107,11 +107,11 @@ secondary_entities: name: sensor mapping: - dps_val: 0 + value: true constraint: fault_2 conditions: - dps_val: 0 value: false - - value: true - value: true - entity: sensor name: Compressor strength diff --git a/custom_components/tuya_local/devices/me80_thermostat.yaml b/custom_components/tuya_local/devices/me80_thermostat.yaml index d7c89df2b4..4326da13ce 100644 --- a/custom_components/tuya_local/devices/me80_thermostat.yaml +++ b/custom_components/tuya_local/devices/me80_thermostat.yaml @@ -14,8 +14,6 @@ primary_entity: value: auto - dps_val: manual value: heat - # in case of unknown presets - - value: heat - dps_val: false value: "off" - id: 2 diff --git a/custom_components/tuya_local/devices/mellerware_comfy_radiator.yaml b/custom_components/tuya_local/devices/mellerware_comfy_radiator.yaml index f191cd6d17..2fff889de5 100644 --- a/custom_components/tuya_local/devices/mellerware_comfy_radiator.yaml +++ b/custom_components/tuya_local/devices/mellerware_comfy_radiator.yaml @@ -21,7 +21,11 @@ primary_entity: hidden: true - dps_val: CF value: heat - - value: heat + - dps_val: [EC, AF] + value: heat + hidden: true + - dps_val: ST + value: "off" hidden: true - id: 2 type: integer diff --git a/custom_components/tuya_local/devices/poolex_qline_heatpump.yaml b/custom_components/tuya_local/devices/poolex_qline_heatpump.yaml index 231dd192f4..175f62baff 100644 --- a/custom_components/tuya_local/devices/poolex_qline_heatpump.yaml +++ b/custom_components/tuya_local/devices/poolex_qline_heatpump.yaml @@ -19,7 +19,6 @@ primary_entity: value: heat - dps_val: mute value: heat_cool - - value: heat_cool - id: 2 name: heating_mode hidden: true diff --git a/custom_components/tuya_local/devices/qlima_d820a_dehumidifier.yaml b/custom_components/tuya_local/devices/qlima_d820a_dehumidifier.yaml index dc0ea326ca..0e0f46aba5 100644 --- a/custom_components/tuya_local/devices/qlima_d820a_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/qlima_d820a_dehumidifier.yaml @@ -49,7 +49,8 @@ secondary_entities: conditions: - dps_val: airpurify value_redirect: purify_speed - - mapping: + - dps_val: [dehum_air, dehum30_air] + mapping: - dps_val: low value: 33 - dps_val: mid diff --git a/custom_components/tuya_local/devices/rotenso_ronix_heatpump.yaml b/custom_components/tuya_local/devices/rotenso_ronix_heatpump.yaml index f716496108..c4f25f1353 100644 --- a/custom_components/tuya_local/devices/rotenso_ronix_heatpump.yaml +++ b/custom_components/tuya_local/devices/rotenso_ronix_heatpump.yaml @@ -81,7 +81,9 @@ primary_entity: value: "off" - dps_val: "1" value: horizontal - - value: horizontal + - dps_val: ["2", "3", "4"] + value: horizontal + hidden: true - dps_val: "1" constraint: horizontal_swing conditions: @@ -89,12 +91,15 @@ primary_entity: value: vertical - dps_val: "1" value: both - - value: both - - constraint: horizontal_swing + - dps_val: ["2", "3", "4"] + value: both + hidden: true + - hidden: true + value: both + constraint: horizontal_swing conditions: - dps_val: "0" value: vertical - - value: both - id: 114 type: string name: horizontal_swing diff --git a/custom_components/tuya_local/devices/royalclima_rcb150_ventilation.yaml b/custom_components/tuya_local/devices/royalclima_rcb150_ventilation.yaml index 4d50bb27f3..8dd4d90f74 100644 --- a/custom_components/tuya_local/devices/royalclima_rcb150_ventilation.yaml +++ b/custom_components/tuya_local/devices/royalclima_rcb150_ventilation.yaml @@ -133,7 +133,8 @@ secondary_entities: conditions: - dps_val: true value: heat - - value: "off" + - dps_val: false + value: "off" - id: 102 name: temperature type: integer diff --git a/custom_components/tuya_local/devices/sherko_curtain.yaml b/custom_components/tuya_local/devices/sherko_curtain.yaml index 7f2c5c0698..ad4358759a 100644 --- a/custom_components/tuya_local/devices/sherko_curtain.yaml +++ b/custom_components/tuya_local/devices/sherko_curtain.yaml @@ -35,21 +35,21 @@ primary_entity: name: action mapping: - dps_val: opening + value: opening constraint: current_position conditions: - dps_val: 100 value: opened - dps_val: null value: opened - - value: opening - dps_val: closing + value: closing constraint: current_position conditions: - dps_val: 0 value: closed - dps_val: null value: closed - - value: closing secondary_entities: - entity: switch category: config diff --git a/custom_components/tuya_local/devices/starlight_heatpump.yaml b/custom_components/tuya_local/devices/starlight_heatpump.yaml index 5eb9393bb8..1867ffc142 100644 --- a/custom_components/tuya_local/devices/starlight_heatpump.yaml +++ b/custom_components/tuya_local/devices/starlight_heatpump.yaml @@ -84,7 +84,9 @@ primary_entity: value: "off" - dps_val: "1" value: horizontal - - value: horizontal + - dps_val: ["2", "3", "4"] + value: horizontal + hidden: true - dps_val: "1" constraint: horizontal_swing conditions: @@ -92,19 +94,15 @@ primary_entity: value: vertical - dps_val: "1" 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 conditions: - dps_val: "0" value: vertical - - value: both - id: 114 name: horizontal_swing type: string diff --git a/custom_components/tuya_local/devices/taurus_agadir_heater.yaml b/custom_components/tuya_local/devices/taurus_agadir_heater.yaml index 979c5f4eea..072a44345f 100644 --- a/custom_components/tuya_local/devices/taurus_agadir_heater.yaml +++ b/custom_components/tuya_local/devices/taurus_agadir_heater.yaml @@ -37,7 +37,8 @@ primary_entity: conditions: - dps_val: false value: "off" - - mapping: + - dps_val: true + mapping: - dps_val: working value: heating - dps_val: standby diff --git a/custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml b/custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml index b45d2fe479..6d9bfba1ce 100644 --- a/custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml +++ b/custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml @@ -15,14 +15,22 @@ primary_entity: conditions: - dps_val: true value: false - - value: false + - dps_val: false + value: false + hidden: true + - dps_val: null + value: false hidden: true - dps_val: true constraint: pause conditions: - dps_val: false value: true - - value: true + - dps_val: true + value: true + hidden: true + - dps_val: null + value: true hidden: true - dps_val: null value: false diff --git a/custom_components/tuya_local/devices/vivax_heatpump.yaml b/custom_components/tuya_local/devices/vivax_heatpump.yaml index 6fca0c25a6..9f549726eb 100644 --- a/custom_components/tuya_local/devices/vivax_heatpump.yaml +++ b/custom_components/tuya_local/devices/vivax_heatpump.yaml @@ -138,7 +138,9 @@ primary_entity: value: both - dps_val: lr_00 value: vertical - - value: vertical + - dps_val: [lr_01, lr_02, lr_03, lr_04] + value: vertical + hidden: true - dps_val: ud_00 constraint: horizontal_swing conditions: @@ -146,16 +148,18 @@ primary_entity: value: horizontal - dps_val: lr_00 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: - dps_val: lr_0c value: horizontal - - value: "off" - id: 118 type: string name: horizontal_swing - # From Tadiran Apollo - id: 101 type: boolean name: mood_lighting diff --git a/custom_components/tuya_local/devices/vivion_airconditioner.yaml b/custom_components/tuya_local/devices/vivion_airconditioner.yaml index 8518865591..0dfaa21d62 100644 --- a/custom_components/tuya_local/devices/vivion_airconditioner.yaml +++ b/custom_components/tuya_local/devices/vivion_airconditioner.yaml @@ -82,7 +82,9 @@ primary_entity: value: "off" - dps_val: same value: vertical - - value: "off" + - dps_val: [vane_1, vane_2, vane_3, vane_4, vane_5] + value: "off" + hidden: true - dps_val: true constraint: vertical conditions: @@ -90,7 +92,9 @@ primary_entity: value: horizontal - dps_val: same value: both - - value: horizontal + - dps_val: [vane_1, vane_2, vane_3, vane_4, vane_5] + value: horizontal + hidden: true - id: 103 type: string name: unknown_103 diff --git a/custom_components/tuya_local/devices/zemismart_roller_shade.yaml b/custom_components/tuya_local/devices/zemismart_roller_shade.yaml index ea2f116178..8503252032 100644 --- a/custom_components/tuya_local/devices/zemismart_roller_shade.yaml +++ b/custom_components/tuya_local/devices/zemismart_roller_shade.yaml @@ -39,17 +39,17 @@ primary_entity: type: string mapping: - dps_val: opening + value: opening constraint: current_position conditions: - dps_val: 0 value: opened - - value: opening - dps_val: closing + value: closing constraint: current_position conditions: - dps_val: 100 value: closed - - value: closing - id: 12 name: fault_code type: bitfield diff --git a/tests/test_device_config.py b/tests/test_device_config.py index 02c2a0c586..1b3cdd7d72 100644 --- a/tests/test_device_config.py +++ b/tests/test_device_config.py @@ -56,6 +56,7 @@ ) COND_SCHEMA = CONDMAP_SCHEMA.extend( { + vol.Required("dps_val"): vol.Maybe(vol.Any(str, int, bool, list)), vol.Optional("mapping"): [CONDMAP_SCHEMA], } )