Home page values update with same engine as chips

Solves #963
This commit is contained in:
Edward Firmo
2023-12-16 19:43:36 +01:00
parent 17115e09cc
commit d29c6382f7
2 changed files with 46 additions and 59 deletions

View File

@@ -516,8 +516,8 @@ api:
disp1->send_command_printf("%stext.picc=%u", id.c_str(), bg_pic);
disp1->send_command_printf("%sicon.picc=%u", id.c_str(), bg_pic);
disp1->send_command_printf("%sicon.font=%" PRIu32, id.c_str(), icon_font);
disp1->send_command_printf("%sbri.pco=%u", id.c_str(), txt_color);
disp1->send_command_printf("%stext.pco=%u", id.c_str(), txt_color);
disp1->set_component_foreground_color(btnbri.c_str(), txt_color);
disp1->set_component_foreground_color(btntext.c_str(), txt_color);
set_component_color->execute(btnicon.c_str(), icon_color);
disp1->set_component_text_printf(btnicon.c_str(), "%s", icon.c_str());
display_wrapped_text->execute(btntext.c_str(), label.c_str(), 10);
@@ -529,7 +529,6 @@ api:
ESP_LOGW(TAG, "Skipping button `%s.%s` as page has changed to %s.", page.c_str(), id.c_str(), current_page->state.c_str());
}
##### SERVICE TO WAKE UP THE DISPLAY #####
- service: wake_up
variables:
@@ -670,12 +669,12 @@ api:
// on/off button
if (supported_features & 128 and state == "off") //TURN_ON
{
disp1->set_component_color("bt_on_off", 65535);
disp1->set_component_foreground_color("bt_on_off", 65535);
disp1->show_component("bt_on_off");
}
else if (supported_features & 256 and state != "off") //TURN_OFF
{
disp1->set_component_color("bt_on_off", 10597);
disp1->set_component_foreground_color("bt_on_off", 10597);
disp1->show_component("bt_on_off");
}
else disp1->hide_component("bt_on_off");