|
|
|
|
@@ -5,6 +5,7 @@
|
|
|
|
|
##### For normal use with the Blueprint, no changes are necessary. #####
|
|
|
|
|
#####################################################################################################
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
substitutions:
|
|
|
|
|
##### DON'T CHANGE THIS #####
|
|
|
|
|
version: "4.2dev"
|
|
|
|
|
@@ -171,14 +172,14 @@ api:
|
|
|
|
|
disp1->set_component_value(component.c_str(), val);
|
|
|
|
|
|
|
|
|
|
##### Service to send a command "hide componente" directly to the display #####
|
|
|
|
|
- service: send_command_hide ### unused ###
|
|
|
|
|
- service: send_command_hide
|
|
|
|
|
variables:
|
|
|
|
|
component: string
|
|
|
|
|
then:
|
|
|
|
|
- lambda: 'disp1->hide_component(component.c_str());'
|
|
|
|
|
|
|
|
|
|
##### Service to send a command "show componente" directly to the display #####
|
|
|
|
|
- service: send_command_show ### unused ###
|
|
|
|
|
- service: send_command_show
|
|
|
|
|
variables:
|
|
|
|
|
component: string
|
|
|
|
|
then:
|
|
|
|
|
@@ -210,11 +211,11 @@ api:
|
|
|
|
|
code_format: string
|
|
|
|
|
code_arm_required: bool
|
|
|
|
|
entity: string
|
|
|
|
|
mui_alarm: string[] #std::vector<std::string> #std::map
|
|
|
|
|
mui_alarm: string[]
|
|
|
|
|
then:
|
|
|
|
|
- lambda: |-
|
|
|
|
|
// Is page Alarm visible?
|
|
|
|
|
if (current_page->state == "alarm") // To do: This page constructor should be moved to Blueprint
|
|
|
|
|
if (current_page->state == "alarm") // To do: This page constructor should be moved to Blueprint
|
|
|
|
|
{ // Update alarm page
|
|
|
|
|
detailed_entity->publish_state(entity);
|
|
|
|
|
|
|
|
|
|
@@ -225,7 +226,8 @@ api:
|
|
|
|
|
}
|
|
|
|
|
disp1->set_component_text_printf("page_label", "%s", page_title.c_str());
|
|
|
|
|
disp1->set_component_text_printf("code_format", "%s", code_format.c_str());
|
|
|
|
|
if (code_arm_required) disp1->set_component_text_printf("code_arm_req", "1"); else disp1->set_component_text_printf("code_arm_req", "0");
|
|
|
|
|
if (code_arm_required) disp1->set_component_text_printf("code_arm_req", "1");
|
|
|
|
|
else disp1->set_component_text_printf("code_arm_req", "0");
|
|
|
|
|
|
|
|
|
|
// Alarm page - Button's text
|
|
|
|
|
display_wrapped_text->execute("bt_home_text", mui_alarm[0].c_str(), 10);
|
|
|
|
|
@@ -355,7 +357,7 @@ api:
|
|
|
|
|
|
|
|
|
|
- if:
|
|
|
|
|
condition:
|
|
|
|
|
- text_sensor.state: # Is boot page visible?
|
|
|
|
|
- text_sensor.state: # Is boot page visible?
|
|
|
|
|
id: current_page
|
|
|
|
|
state: boot
|
|
|
|
|
then:
|
|
|
|
|
@@ -365,13 +367,13 @@ api:
|
|
|
|
|
- wait_until:
|
|
|
|
|
condition:
|
|
|
|
|
- not:
|
|
|
|
|
- text_sensor.state: # Is boot page visible?
|
|
|
|
|
- text_sensor.state: # Is boot page visible?
|
|
|
|
|
id: current_page
|
|
|
|
|
state: 'boot'
|
|
|
|
|
timeout: 2s
|
|
|
|
|
- if:
|
|
|
|
|
condition:
|
|
|
|
|
- text_sensor.state: # Avoid this being called twice by multiple boot triggers
|
|
|
|
|
- text_sensor.state: # Avoid this being called twice by multiple boot triggers
|
|
|
|
|
id: current_page
|
|
|
|
|
state: 'boot'
|
|
|
|
|
then:
|
|
|
|
|
@@ -484,7 +486,7 @@ api:
|
|
|
|
|
climate_icon: !lambda "return climate_icon;"
|
|
|
|
|
embedded_climate: !lambda "return embedded_climate;"
|
|
|
|
|
|
|
|
|
|
#### Service to set the buttons ####
|
|
|
|
|
#### Service to set the buttons ####
|
|
|
|
|
- service: set_button
|
|
|
|
|
variables:
|
|
|
|
|
page: string
|
|
|
|
|
@@ -619,7 +621,6 @@ api:
|
|
|
|
|
- service: page_settings
|
|
|
|
|
variables:
|
|
|
|
|
reboot: string
|
|
|
|
|
#sleep_mode: string
|
|
|
|
|
brightness: string
|
|
|
|
|
bright: string
|
|
|
|
|
dim: string
|
|
|
|
|
@@ -1632,7 +1633,7 @@ script:
|
|
|
|
|
timer_dim->execute(page.c_str(), int(timeout_dim->state));
|
|
|
|
|
timer_sleep->execute(page.c_str(), int(timeout_sleep->state));
|
|
|
|
|
|
|
|
|
|
- id: timer_page # Handle the fallback to home page after a timeout
|
|
|
|
|
- id: timer_page # Handles the fallback to home page after a timeout
|
|
|
|
|
mode: restart
|
|
|
|
|
parameters:
|
|
|
|
|
page: string
|
|
|
|
|
@@ -1663,7 +1664,7 @@ script:
|
|
|
|
|
ESP_LOGD("script.timer_page", "Fallback to page Home");
|
|
|
|
|
disp1->goto_page("home");
|
|
|
|
|
}
|
|
|
|
|
- id: timer_dim # Handle the brightness dimming after a timeout
|
|
|
|
|
- id: timer_dim # Handles the brightness dimming after a timeout
|
|
|
|
|
mode: restart
|
|
|
|
|
parameters:
|
|
|
|
|
page: string
|
|
|
|
|
@@ -1690,7 +1691,7 @@ script:
|
|
|
|
|
timeout >= 1) {
|
|
|
|
|
set_brightness->execute(id(display_dim_brightness_global));
|
|
|
|
|
}
|
|
|
|
|
- id: timer_sleep # Handle the sleep (go to screensaver page) after a timeout
|
|
|
|
|
- id: timer_sleep # Handles the sleep (go to screensaver page) after a timeout
|
|
|
|
|
mode: restart
|
|
|
|
|
parameters:
|
|
|
|
|
page: string
|
|
|
|
|
@@ -1794,20 +1795,34 @@ script:
|
|
|
|
|
disp1->set_component_text_printf("home.meridiem", "%s", meridiem_text.c_str());
|
|
|
|
|
}
|
|
|
|
|
else { disp1->set_component_text_printf("home.meridiem", " "); }
|
|
|
|
|
if (time_format_str.find("%-H") != std::string::npos) { time_format_str = time_format_str.replace(time_format_str.find("%-H"), sizeof("%-H")-1, to_string((int)(id(time_provider).now().hour))); }
|
|
|
|
|
if (time_format_str.find("%-H") != std::string::npos) {
|
|
|
|
|
time_format_str = time_format_str.replace(time_format_str.find("%-H"),
|
|
|
|
|
sizeof("%-H")-1,
|
|
|
|
|
to_string((int)(id(time_provider).now().hour))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
if (time_format_str.find("%-I") != std::string::npos)
|
|
|
|
|
{
|
|
|
|
|
if (id(time_provider).now().hour>12)
|
|
|
|
|
{
|
|
|
|
|
time_format_str = time_format_str.replace(time_format_str.find("%-I"), sizeof("%-I")-1, to_string((int)(id(time_provider).now().hour-12)));
|
|
|
|
|
time_format_str = time_format_str.replace(time_format_str.find("%-I"),
|
|
|
|
|
sizeof("%-I")-1,
|
|
|
|
|
to_string((int)(id(time_provider).now().hour-12))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else if (id(time_provider).now().hour==0)
|
|
|
|
|
{
|
|
|
|
|
time_format_str = time_format_str.replace(time_format_str.find("%-I"), sizeof("%-I")-1, "12");
|
|
|
|
|
time_format_str = time_format_str.replace(time_format_str.find("%-I"),
|
|
|
|
|
sizeof("%-I")-1,
|
|
|
|
|
"12"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
time_format_str = time_format_str.replace(time_format_str.find("%-I"), sizeof("%-I")-1, to_string((int)(id(time_provider).now().hour)));
|
|
|
|
|
time_format_str = time_format_str.replace(time_format_str.find("%-I"),
|
|
|
|
|
sizeof("%-I")-1,
|
|
|
|
|
to_string((int)(id(time_provider).now().hour))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
std::string time_text = id(time_provider).now().strftime(time_format_str);
|
|
|
|
|
@@ -2085,7 +2100,11 @@ script:
|
|
|
|
|
- lambda: |-
|
|
|
|
|
int fg565 = -1;
|
|
|
|
|
// Foreground
|
|
|
|
|
if (foreground.size() == 3 and foreground[0] >= 0 and foreground[1] >= 0 and foreground[2] >= 0) fg565 = ((foreground[0] & 0b11111000) << 8) | ((foreground[1] & 0b11111100) << 3) | (foreground[2] >> 3);
|
|
|
|
|
if (foreground.size() == 3 and
|
|
|
|
|
foreground[0] >= 0 and
|
|
|
|
|
foreground[1] >= 0 and
|
|
|
|
|
foreground[2] >= 0)
|
|
|
|
|
fg565 = ((foreground[0] & 0b11111000) << 8) | ((foreground[1] & 0b11111100) << 3) | (foreground[2] >> 3);
|
|
|
|
|
else if (foreground.size() == 1) fg565 = foreground[0];
|
|
|
|
|
else fg565 = -1;
|
|
|
|
|
if (fg565 >= 0) disp1->set_component_font_color(component.c_str(), fg565);
|
|
|
|
|
|