Fix num gangs selection on boot

This commit is contained in:
Edward Firmo
2024-06-12 17:01:52 +02:00
parent ae922da750
commit 464394e15b

View File

@@ -196,8 +196,8 @@ esphome:
- lambda: |- - lambda: |-
const bool us_model = sl_tx_model_format->active_index().has_value() and const bool us_model = sl_tx_model_format->active_index().has_value() and
sl_tx_model_format->active_index().value() == 1; sl_tx_model_format->active_index().value() == 1;
const uint8_t num_gangs = (!sl_tx_model_gang->active_index().has_value()) ? 0 : const uint8_t num_gangs = (sl_tx_model_gang->active_index().has_value()) ?
(sl_tx_model_format->active_index().value() + 1); (sl_tx_model_gang->active_index().value() + 1) : 0;
bs_button_1->publish_state(false); bs_button_1->publish_state(false);
bs_button_1->set_internal(num_gangs < 1); bs_button_1->set_internal(num_gangs < 1);
sl_button_1_action->set_internal(num_gangs < 1); sl_button_1_action->set_internal(num_gangs < 1);