diff --git a/nspanel_esphome_core.yaml b/nspanel_esphome_core.yaml index a1d4bc2..538c60f 100644 --- a/nspanel_esphome_core.yaml +++ b/nspanel_esphome_core.yaml @@ -226,6 +226,9 @@ api: // Alarm page - Header update_alarm_icon->execute("icon_state", state.c_str()); + if (page_title.find("\\r") != std::string::npos) { + page_title = page_title.replace(page_title.find("\\r"), 2, " "); + } 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"); @@ -432,6 +435,9 @@ api: detailed_entity->publish_state(entity); std::string cmd_page = std::string("page ") + page.c_str(); disp1->send_command_printf(cmd_page.c_str()); + if (page_label.find("\\r") != std::string::npos) { + page_label = page_label.replace(page_label.find("\\r"), 2, " "); + } disp1->set_component_text_printf("page_label", "%s", page_label.c_str()); disp1->set_component_text_printf("back_page", "%s", back_page.c_str()); if (page == "climate")