This commit is contained in:
Edward Firmo
2023-12-18 17:42:45 +01:00
parent 25567fa381
commit 98d3a9189c
6 changed files with 42 additions and 19 deletions

View File

@@ -7,6 +7,7 @@
##### ATTENTION: This will add climate elements to the core system and requires the core part. #####
#####################################################################################################
---
substitutions:
### Local thermostat defaults ###
# https://esphome.io/components/climate/thermostat.html

View File

@@ -7,8 +7,8 @@
##### ATTENTION: This will add advanced elements to the core system and requires the core part. #####
#####################################################################################################
---
substitutions:
################## Defaults ##################
# Just in case user forgets to set something #
nextion_update_url: "http://github.com/Blackymas/NSPanel_HA_Blueprint/raw/main/custom_configuration/nspanel_eu.tft"

View File

@@ -7,6 +7,7 @@
##### ATTENTION: This will add advanced elements to the core system and requires the core part. #####
#####################################################################################################
---
button:
##### EXIT REPARSE TFT DISPLAY #####
- name: ${device_name} Exit reparse

View File

@@ -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,7 +211,7 @@ 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?
@@ -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);
@@ -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);

View File

@@ -7,6 +7,7 @@
##### ATTENTION: This will add climate elements to the core system and requires the core part. #####
#####################################################################################################
---
substitutions:
### Local thermostat defaults ###
# https://esphome.io/components/climate/thermostat.html

View File

@@ -7,6 +7,7 @@
##### ATTENTION: This will add climate elements to the core system and requires the core part. #####
#####################################################################################################
---
substitutions:
### Local thermostat defaults ###
# https://esphome.io/components/climate/thermostat.html