From ed8d434290e8cfd698d338f6425b933b6e8f1f9e Mon Sep 17 00:00:00 2001 From: Kaufman Home Automation Date: Tue, 21 Jun 2022 21:06:00 -0700 Subject: set initial option when restoring config --- kauf-plug.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kauf-plug.yaml b/kauf-plug.yaml index a05fdd8..4d35745 100644 --- a/kauf-plug.yaml +++ b/kauf-plug.yaml @@ -643,9 +643,15 @@ 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"); } + if ( i == 1 ) { + call_sel.set_option("Don't Toggle"); + id(select_button).set_initial_option("Don't Toggle"); + } else if ( i >= 5 ) { call_sel.set_option("Toggle on Release"); } - else { call_sel.set_option("Toggle on Press"); } + else { + call_sel.set_option("Toggle on Press"); + id(select_button).set_initial_option("Toggle on Press"); + } call_sel.perform(); // set number_debounce if configured for longer than 100ms. -- cgit v1.2.3