LOL see that’s the thing, if you don’t know, you don’t know.
Thats so cool thanks!
Once I got it working, I can understand it a bit better and changed the limit from 35 to 20, which looks better for me.
I’m just wondering is anyone can help me to create code for the following.
replace [ and ] with nothing
replace “,” with “~” to perform the line break.
Would that work?
That simple change would give me just a list right?
Even if this is as far as I get, its still really cool, so thanks for that
EDIT
How did you figure this out LOL??? Im looking at the ESPHome doco and if has nothing about line breaks ect
Oh ok, I think I misinterpreted your code here. It seemed like you were saying that anytime ESPHome sees ~ it performs a line break. But that must be wrong lol
However adding
| replace('[','') | replace(']','') | replace(',','~') }}"
To the value template did allow me to get rid of some of those characters which is great. I just need to know how to turn “,” into a line break
EDIT
Sorry that I’m basically adding my working for everyone to scroll past HAHA
So its “\n” that needs to be added. I cant do the value template thing, it doesn’t seem to work.
If anyone knows, Id appreciate it
EDIT again,
Ok, giving up for today lol, ChatGPT gave me this;
std::string shopping_list = id(alexa_shopping_list).state;
std::replace(shopping_list.begin(), shopping_list.end(), ',', '\n');
it.printf(20, 440, id(font_small_bold), TextAlign::BASELINE_LEFT, "%s", shopping_list.c_str());
And it displays, but does not return the line, just turns the comma into an X character of some kind