Fix names on button pages

Fix names when a name is not provided in the blueprint settings.
This commit is contained in:
Edward Firmo
2023-09-15 10:03:50 +02:00
parent 76a9520557
commit e8193c2bb7
2 changed files with 5 additions and 2 deletions

View File

@@ -347,7 +347,9 @@ api:
#entity: string
then:
- lambda: |-
// ESP_LOGV("nextion", "set button %s", btn_id.c_str());
ESP_LOGD("service.set_button", "Starting");
ESP_LOGD("service.set_button", "btn_id: %s", btn_id.c_str());
ESP_LOGD("service.set_button", "btn_label: %s", btn_label.c_str());
std::string btnicon = btn_id.c_str() + std::string("icon");
std::string btntext = btn_id.c_str() + std::string("text");
std::string btnbri = btn_id.c_str() + std::string("bri");
@@ -365,6 +367,7 @@ api:
id(disp1).set_component_text_printf(btnbri.c_str(), " ");
id(disp1).set_component_value(btnconf.c_str(), (btn_confirm) ? 1 : 0);
//id(disp1).set_component_text_printf(btnentity.c_str(), "%s", entity.c_str());
ESP_LOGD("service.set_button", "Finished");
##### SERVICE TO WAKE UP THE DISPLAY #####
- service: wake_up