Files
buttonplus-esphome-generator/esphome/latest_generated_full.yaml
T

617 lines
20 KiB
YAML

# Generated by ESPHome for Buttonplus
# File: buttonplus.yaml
# Options:
# - device: buttonplus
# - version: 1
# - bars: 3
# - pages: Start, Music, Lights, Security
packages:
- !include 'buttonplus_base.yaml'
esphome:
name: buttonplus
friendly_name: buttonplus
wifi:
ssid: !secret 'wifi_ssid'
password: !secret 'wifi_password'
logger:
level: DEBUG
ota:
- platform: esphome
password: !secret 'ota_password'
api:
encryption:
key: !secret 'encryption_key'
color:
- id: accent
hex: FF0000
script:
- id: display_script_draw_user
then:
- lambda: |-
// All pages
id(display_disp).strftime(160, 5, id(font_arial20), TextAlign::TOP_CENTER, "%H:%M", id(datetime).now());
id(display_disp).strftime(160, 80, id(font_arial20), TextAlign::TOP_CENTER, "%d-%m-%Y", id(datetime).now());
switch (id(active_page_nr)){
// Page 0 - Start
case 0:
break;
// Page 1 - Music
case 1:
break;
// Page 2 - Lights
case 2:
break;
// Page 3 - Security
case 3:
break;
}
- id: bar1_left_script_draw
then:
- lambda: |-
switch (id(active_page_nr)){
// Page 0 - Start
case 0:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 1 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Start");
break;
// Page 1 - Music
case 1:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 1 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Music");
break;
// Page 2 - Lights
case 2:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 1 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Lights");
break;
// Page 3 - Security
case 3:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 1 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Security");
break;
}
- id: bar1_right_script_draw
then:
- lambda: |-
switch (id(active_page_nr)){
// Page 0 - Start
case 0:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 1 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Start");
break;
// Page 1 - Music
case 1:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 1 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Music");
break;
// Page 2 - Lights
case 2:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 1 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Lights");
break;
// Page 3 - Security
case 3:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 1 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Security");
break;
}
- id: bar2_left_script_draw
then:
- lambda: |-
switch (id(active_page_nr)){
// Page 0 - Start
case 0:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 2 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Start");
break;
// Page 1 - Music
case 1:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 2 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Music");
break;
// Page 2 - Lights
case 2:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 2 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Lights");
break;
// Page 3 - Security
case 3:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 2 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Security");
break;
}
- id: bar2_right_script_draw
then:
- lambda: |-
switch (id(active_page_nr)){
// Page 0 - Start
case 0:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 2 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Start");
break;
// Page 1 - Music
case 1:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 2 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Music");
break;
// Page 2 - Lights
case 2:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 2 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Lights");
break;
// Page 3 - Security
case 3:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 2 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Security");
break;
}
- id: bar3_left_script_draw
then:
- lambda: |-
switch (id(active_page_nr)){
// Page 0 - Start
case 0:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 3 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Start");
break;
// Page 1 - Music
case 1:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 3 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Music");
break;
// Page 2 - Lights
case 2:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 3 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Lights");
break;
// Page 3 - Security
case 3:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 3 left");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Security");
break;
}
- id: bar3_right_script_draw
then:
- lambda: |-
switch (id(active_page_nr)){
// Page 0 - Start
case 0:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 3 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Start");
break;
// Page 1 - Music
case 1:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 3 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Music");
break;
// Page 2 - Lights
case 2:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 3 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Lights");
break;
// Page 3 - Security
case 3:
id(bar_display).printf(80, 0, id(font_arial20), id(accent), TextAlign::TOP_CENTER , "Bar 3 right");
id(bar_display).printf(80, 80, id(font_arial20), id(white), TextAlign::BOTTOM_CENTER , "Security");
break;
}
event:
- id: !extend 'display_left_btn_event'
on_event:
then:
- lambda: |-
if(event_type == "click Start"){
// Handle this event locally
}
if(event_type == "double_click Start"){
// Handle this event locally
}
if(event_type == "triple_click Start"){
// Handle this event locally
}
if(event_type == "hold Start"){
// Handle this event locally
}
if(event_type == "click Music"){
// Handle this event locally
}
if(event_type == "double_click Music"){
// Handle this event locally
}
if(event_type == "triple_click Music"){
// Handle this event locally
}
if(event_type == "hold Music"){
// Handle this event locally
}
if(event_type == "click Lights"){
// Handle this event locally
}
if(event_type == "double_click Lights"){
// Handle this event locally
}
if(event_type == "triple_click Lights"){
// Handle this event locally
}
if(event_type == "hold Lights"){
// Handle this event locally
}
if(event_type == "click Security"){
// Handle this event locally
}
if(event_type == "double_click Security"){
// Handle this event locally
}
if(event_type == "triple_click Security"){
// Handle this event locally
}
if(event_type == "hold Security"){
// Handle this event locally
}
- id: !extend 'display_right_btn_event'
on_event:
then:
- lambda: |-
if(event_type == "click Start"){
// Handle this event locally
}
if(event_type == "double_click Start"){
// Handle this event locally
}
if(event_type == "triple_click Start"){
// Handle this event locally
}
if(event_type == "hold Start"){
// Handle this event locally
}
if(event_type == "click Music"){
// Handle this event locally
}
if(event_type == "double_click Music"){
// Handle this event locally
}
if(event_type == "triple_click Music"){
// Handle this event locally
}
if(event_type == "hold Music"){
// Handle this event locally
}
if(event_type == "click Lights"){
// Handle this event locally
}
if(event_type == "double_click Lights"){
// Handle this event locally
}
if(event_type == "triple_click Lights"){
// Handle this event locally
}
if(event_type == "hold Lights"){
// Handle this event locally
}
if(event_type == "click Security"){
// Handle this event locally
}
if(event_type == "double_click Security"){
// Handle this event locally
}
if(event_type == "triple_click Security"){
// Handle this event locally
}
if(event_type == "hold Security"){
// Handle this event locally
}
- id: !extend 'bar1_left_btn_event'
on_event:
then:
- lambda: |-
if(event_type == "click Start"){
// Handle this event locally
}
if(event_type == "double_click Start"){
// Handle this event locally
}
if(event_type == "triple_click Start"){
// Handle this event locally
}
if(event_type == "hold Start"){
// Handle this event locally
}
if(event_type == "click Music"){
// Handle this event locally
}
if(event_type == "double_click Music"){
// Handle this event locally
}
if(event_type == "triple_click Music"){
// Handle this event locally
}
if(event_type == "hold Music"){
// Handle this event locally
}
if(event_type == "click Lights"){
// Handle this event locally
}
if(event_type == "double_click Lights"){
// Handle this event locally
}
if(event_type == "triple_click Lights"){
// Handle this event locally
}
if(event_type == "hold Lights"){
// Handle this event locally
}
if(event_type == "click Security"){
// Handle this event locally
}
if(event_type == "double_click Security"){
// Handle this event locally
}
if(event_type == "triple_click Security"){
// Handle this event locally
}
if(event_type == "hold Security"){
// Handle this event locally
}
- id: !extend 'bar1_right_btn_event'
on_event:
then:
- lambda: |-
if(event_type == "click Start"){
// Handle this event locally
}
if(event_type == "double_click Start"){
// Handle this event locally
}
if(event_type == "triple_click Start"){
// Handle this event locally
}
if(event_type == "hold Start"){
// Handle this event locally
}
if(event_type == "click Music"){
// Handle this event locally
}
if(event_type == "double_click Music"){
// Handle this event locally
}
if(event_type == "triple_click Music"){
// Handle this event locally
}
if(event_type == "hold Music"){
// Handle this event locally
}
if(event_type == "click Lights"){
// Handle this event locally
}
if(event_type == "double_click Lights"){
// Handle this event locally
}
if(event_type == "triple_click Lights"){
// Handle this event locally
}
if(event_type == "hold Lights"){
// Handle this event locally
}
if(event_type == "click Security"){
// Handle this event locally
}
if(event_type == "double_click Security"){
// Handle this event locally
}
if(event_type == "triple_click Security"){
// Handle this event locally
}
if(event_type == "hold Security"){
// Handle this event locally
}
- id: !extend 'bar2_left_btn_event'
on_event:
then:
- lambda: |-
if(event_type == "click Start"){
// Handle this event locally
}
if(event_type == "double_click Start"){
// Handle this event locally
}
if(event_type == "triple_click Start"){
// Handle this event locally
}
if(event_type == "hold Start"){
// Handle this event locally
}
if(event_type == "click Music"){
// Handle this event locally
}
if(event_type == "double_click Music"){
// Handle this event locally
}
if(event_type == "triple_click Music"){
// Handle this event locally
}
if(event_type == "hold Music"){
// Handle this event locally
}
if(event_type == "click Lights"){
// Handle this event locally
}
if(event_type == "double_click Lights"){
// Handle this event locally
}
if(event_type == "triple_click Lights"){
// Handle this event locally
}
if(event_type == "hold Lights"){
// Handle this event locally
}
if(event_type == "click Security"){
// Handle this event locally
}
if(event_type == "double_click Security"){
// Handle this event locally
}
if(event_type == "triple_click Security"){
// Handle this event locally
}
if(event_type == "hold Security"){
// Handle this event locally
}
- id: !extend 'bar2_right_btn_event'
on_event:
then:
- lambda: |-
if(event_type == "click Start"){
// Handle this event locally
}
if(event_type == "double_click Start"){
// Handle this event locally
}
if(event_type == "triple_click Start"){
// Handle this event locally
}
if(event_type == "hold Start"){
// Handle this event locally
}
if(event_type == "click Music"){
// Handle this event locally
}
if(event_type == "double_click Music"){
// Handle this event locally
}
if(event_type == "triple_click Music"){
// Handle this event locally
}
if(event_type == "hold Music"){
// Handle this event locally
}
if(event_type == "click Lights"){
// Handle this event locally
}
if(event_type == "double_click Lights"){
// Handle this event locally
}
if(event_type == "triple_click Lights"){
// Handle this event locally
}
if(event_type == "hold Lights"){
// Handle this event locally
}
if(event_type == "click Security"){
// Handle this event locally
}
if(event_type == "double_click Security"){
// Handle this event locally
}
if(event_type == "triple_click Security"){
// Handle this event locally
}
if(event_type == "hold Security"){
// Handle this event locally
}
- id: !extend 'bar3_left_btn_event'
on_event:
then:
- lambda: |-
if(event_type == "click Start"){
// Handle this event locally
}
if(event_type == "double_click Start"){
// Handle this event locally
}
if(event_type == "triple_click Start"){
// Handle this event locally
}
if(event_type == "hold Start"){
// Handle this event locally
}
if(event_type == "click Music"){
// Handle this event locally
}
if(event_type == "double_click Music"){
// Handle this event locally
}
if(event_type == "triple_click Music"){
// Handle this event locally
}
if(event_type == "hold Music"){
// Handle this event locally
}
if(event_type == "click Lights"){
// Handle this event locally
}
if(event_type == "double_click Lights"){
// Handle this event locally
}
if(event_type == "triple_click Lights"){
// Handle this event locally
}
if(event_type == "hold Lights"){
// Handle this event locally
}
if(event_type == "click Security"){
// Handle this event locally
}
if(event_type == "double_click Security"){
// Handle this event locally
}
if(event_type == "triple_click Security"){
// Handle this event locally
}
if(event_type == "hold Security"){
// Handle this event locally
}
- id: !extend 'bar3_right_btn_event'
on_event:
then:
- lambda: |-
if(event_type == "click Start"){
// Handle this event locally
}
if(event_type == "double_click Start"){
// Handle this event locally
}
if(event_type == "triple_click Start"){
// Handle this event locally
}
if(event_type == "hold Start"){
// Handle this event locally
}
if(event_type == "click Music"){
// Handle this event locally
}
if(event_type == "double_click Music"){
// Handle this event locally
}
if(event_type == "triple_click Music"){
// Handle this event locally
}
if(event_type == "hold Music"){
// Handle this event locally
}
if(event_type == "click Lights"){
// Handle this event locally
}
if(event_type == "double_click Lights"){
// Handle this event locally
}
if(event_type == "triple_click Lights"){
// Handle this event locally
}
if(event_type == "hold Lights"){
// Handle this event locally
}
if(event_type == "click Security"){
// Handle this event locally
}
if(event_type == "double_click Security"){
// Handle this event locally
}
if(event_type == "triple_click Security"){
// Handle this event locally
}
if(event_type == "hold Security"){
// Handle this event locally
}