@@ -1,7 +1,7 @@
|
||||
bluetooth_proxy:
|
||||
|
||||
esp32:
|
||||
framework:
|
||||
framework:
|
||||
type: esp-idf
|
||||
sdkconfig_options:
|
||||
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST: "y"
|
||||
|
||||
@@ -37,12 +37,12 @@ binary_sensor:
|
||||
icon: mdi:gesture-tap-box
|
||||
internal: false
|
||||
platform: template
|
||||
on_press:
|
||||
then:
|
||||
- switch.toggle: sw_relay_1
|
||||
on_click:
|
||||
then:
|
||||
- lambda: send_event_to_ha->execute("bs_button_1", "click");
|
||||
- lambda: |-
|
||||
if (sl_button_1_action->active_index().has_value() and sl_button_1_action->active_index().value() == 1)
|
||||
sw_relay_1->toggle();
|
||||
send_event_to_ha->execute("bs_button_1", "click");
|
||||
on_double_click:
|
||||
then:
|
||||
- lambda: send_event_to_ha->execute("bs_button_1", "double_click");
|
||||
@@ -58,12 +58,12 @@ binary_sensor:
|
||||
icon: mdi:gesture-tap-box
|
||||
internal: true
|
||||
platform: template
|
||||
on_press:
|
||||
then:
|
||||
- switch.toggle: sw_relay_2
|
||||
on_click:
|
||||
then:
|
||||
- lambda: send_event_to_ha->execute("bs_button_2", "click");
|
||||
- lambda: |-
|
||||
if (sl_button_2_action->active_index().has_value() and sl_button_2_action->active_index().value() == 1)
|
||||
sw_relay_2->toggle();
|
||||
send_event_to_ha->execute("bs_button_2", "click");
|
||||
on_double_click:
|
||||
then:
|
||||
- lambda: send_event_to_ha->execute("bs_button_2", "double_click");
|
||||
@@ -78,12 +78,12 @@ binary_sensor:
|
||||
icon: mdi:gesture-tap-box
|
||||
internal: true
|
||||
platform: template
|
||||
on_press:
|
||||
then:
|
||||
- switch.toggle: sw_relay_3
|
||||
on_click:
|
||||
then:
|
||||
- lambda: send_event_to_ha->execute("bs_button_3", "click");
|
||||
- lambda: |-
|
||||
if (sl_button_3_action->active_index().has_value() and sl_button_3_action->active_index().value() == 1)
|
||||
sw_relay_3->toggle();
|
||||
send_event_to_ha->execute("bs_button_3", "click");
|
||||
on_double_click:
|
||||
then:
|
||||
- lambda: send_event_to_ha->execute("bs_button_3", "double_click");
|
||||
@@ -98,12 +98,12 @@ binary_sensor:
|
||||
icon: mdi:gesture-tap-box
|
||||
internal: true
|
||||
platform: template
|
||||
on_press:
|
||||
then:
|
||||
- switch.toggle: sw_relay_4
|
||||
on_click:
|
||||
then:
|
||||
- lambda: send_event_to_ha->execute("bs_button_4", "click");
|
||||
- lambda: |-
|
||||
if (sl_button_4_action->active_index().has_value() and sl_button_4_action->active_index().value() == 1)
|
||||
sw_relay_4->toggle();
|
||||
send_event_to_ha->execute("bs_button_4", "click");
|
||||
on_double_click:
|
||||
then:
|
||||
- lambda: send_event_to_ha->execute("bs_button_4", "double_click");
|
||||
@@ -217,10 +217,6 @@ esphome:
|
||||
auto index = sl_tx_model_gang->active_index();
|
||||
if (index.has_value()) {
|
||||
uint8_t idx = index.value();
|
||||
sw_relay_1->set_internal(false);
|
||||
sw_relay_2->set_internal(idx < 1);
|
||||
sw_relay_3->set_internal(idx < 2);
|
||||
sw_relay_4->set_internal(idx < 3);
|
||||
bs_button_1->set_internal(false);
|
||||
bs_button_2->set_internal(idx < 1);
|
||||
bs_button_3->set_internal(idx < 2);
|
||||
@@ -231,6 +227,14 @@ esphome:
|
||||
bs_button_4->publish_state(false);
|
||||
bs_swipe_left->publish_state(false);
|
||||
bs_swipe_right->publish_state(false);
|
||||
sl_button_1_action->set_internal(false);
|
||||
sl_button_2_action->set_internal(idx < 1);
|
||||
sl_button_3_action->set_internal(idx < 2);
|
||||
sl_button_4_action->set_internal(idx < 3);
|
||||
sw_relay_1->set_internal(false);
|
||||
sw_relay_2->set_internal(idx < 1);
|
||||
sw_relay_3->set_internal(idx < 2);
|
||||
sw_relay_4->set_internal(idx < 3);
|
||||
}
|
||||
- priority: 699
|
||||
then:
|
||||
@@ -1608,6 +1612,58 @@ script:
|
||||
- switch.turn_off: sw_vibration_motor
|
||||
|
||||
select:
|
||||
- id: sl_button_1_action
|
||||
name: Button 1 action
|
||||
platform: template
|
||||
options:
|
||||
- "None"
|
||||
- "Relay 1 (toggle)"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
internal: true
|
||||
entity_category: config
|
||||
disabled_by_default: false
|
||||
icon: mdi:dip-switch
|
||||
|
||||
- id: sl_button_2_action
|
||||
name: Button 2 action
|
||||
platform: template
|
||||
options:
|
||||
- "None"
|
||||
- "Relay 2 (toggle)"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
internal: true
|
||||
entity_category: config
|
||||
disabled_by_default: false
|
||||
icon: mdi:dip-switch
|
||||
|
||||
- id: sl_button_3_action
|
||||
name: Button 3 action
|
||||
platform: template
|
||||
options:
|
||||
- "None"
|
||||
- "Relay 3 (toggle)"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
internal: true
|
||||
entity_category: config
|
||||
disabled_by_default: false
|
||||
icon: mdi:dip-switch
|
||||
|
||||
- id: sl_button_4_action
|
||||
name: Button 4 action
|
||||
platform: template
|
||||
options:
|
||||
- "None"
|
||||
- "Relay 4 (toggle)"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
internal: true
|
||||
entity_category: config
|
||||
disabled_by_default: false
|
||||
icon: mdi:dip-switch
|
||||
|
||||
- id: sl_relay_light_mode_eu
|
||||
name: Relay light mode
|
||||
platform: template
|
||||
|
||||
Reference in New Issue
Block a user