Bump version to 4.1.4
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
#####################################################################################################
|
||||
##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint #####
|
||||
##### ADVANCED CONFIG + FULL ESPHOME CODE! #####
|
||||
##### ESPHOME CORE #####
|
||||
##### PLEASE only make changes if it is necessary and also the required knowledge is available. #####
|
||||
##### For normal use with the Blueprint, no changes are necessary. #####
|
||||
#####################################################################################################
|
||||
|
||||
substitutions:
|
||||
##### DON'T CHANGE THIS #####
|
||||
version: "4.1.3"
|
||||
version: "4.1.4"
|
||||
#############################
|
||||
|
||||
#external_components:
|
||||
@@ -2094,23 +2094,27 @@ script:
|
||||
int startPos = 0;
|
||||
int endPos = 0;
|
||||
std::string wrappedText = "";
|
||||
while (startPos < text_to_display.length()) {
|
||||
while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; }
|
||||
int endPos = startPos + line_length_limit;
|
||||
if (endPos >= text_to_display.length()) endPos = text_to_display.length();
|
||||
else
|
||||
{
|
||||
while (endPos > startPos && text_to_display[endPos] != ' ') { endPos--; }
|
||||
if (endPos == startPos) endPos = startPos + line_length_limit; // Handle case of long word
|
||||
}
|
||||
wrappedText += text_to_display.substr(startPos, endPos-startPos);
|
||||
if (endPos < text_to_display.length())
|
||||
{
|
||||
while (text_to_display[endPos] == ' ') { endPos--; }
|
||||
if (endPos >= startPos) wrappedText += "\\r";
|
||||
}
|
||||
startPos = endPos + 1; // Skip the space
|
||||
while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; }
|
||||
if (text_to_display.find("\\r") != std::string::npos) {
|
||||
wrappedText = text_to_display;
|
||||
} else {
|
||||
while (startPos < text_to_display.length()) {
|
||||
while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; }
|
||||
int endPos = startPos + line_length_limit;
|
||||
if (endPos >= text_to_display.length()) endPos = text_to_display.length();
|
||||
else
|
||||
{
|
||||
while (endPos > startPos && text_to_display[endPos] != ' ') { endPos--; }
|
||||
if (endPos == startPos) endPos = startPos + line_length_limit; // Handle case of long word
|
||||
}
|
||||
wrappedText += text_to_display.substr(startPos, endPos-startPos);
|
||||
if (endPos < text_to_display.length())
|
||||
{
|
||||
while (text_to_display[endPos] == ' ') { endPos--; }
|
||||
if (endPos >= startPos) wrappedText += "\\r";
|
||||
}
|
||||
startPos = endPos + 1; // Skip the space
|
||||
while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; }
|
||||
}
|
||||
}
|
||||
disp1->set_component_text_printf(component.c_str(), "%s", wrappedText.c_str());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user