From e547f35f9e6cb333604cd9d549aa23e7b55fbc6a Mon Sep 17 00:00:00 2001 From: Kaufman Home Automation Date: Tue, 21 Jun 2022 21:17:16 -0700 Subject: in config restore, wait for new select setup --- kauf-plug.yaml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/kauf-plug.yaml b/kauf-plug.yaml index 4d35745..47c115b 100644 --- a/kauf-plug.yaml +++ b/kauf-plug.yaml @@ -635,6 +635,8 @@ select: forced_addr: 34 global_addr: global_forced_addr on_value: + - wait_until: # wait until new select entity is setup + lambda: return ( id(select_button).has_state() ); - lambda: |- if ( x == "Didn't Restore" ) { ESP_LOGD("Kauf Config Migration", "No legacy button configuration to migrate."); @@ -643,15 +645,9 @@ select: // set button config select entity based on press/release/disabled auto call_sel = id(select_button).make_call(); - if ( i == 1 ) { - call_sel.set_option("Don't Toggle"); - id(select_button).set_initial_option("Don't Toggle"); - } + if ( i == 1 ) { call_sel.set_option("Don't Toggle"); } else if ( i >= 5 ) { call_sel.set_option("Toggle on Release"); } - else { - call_sel.set_option("Toggle on Press"); - id(select_button).set_initial_option("Toggle on Press"); - } + else { call_sel.set_option("Toggle on Press"); } call_sel.perform(); // set number_debounce if configured for longer than 100ms. -- cgit v1.2.3