Hi there,
I’m trying make a wireless, battery powered media player dashboard with Wemos D1 Mini, 256x64 OLED display and ESPHome.
Track, Album and Artist name displayed properly. Also Play and Pause status shown as icon.
It has scroll text effects for long names. (needs to some corrections)
But I have a small problem
I cannot put line limitation for long text. As you can see last image, track name and speaker icon overlapped. Is it possible to set line width limitation in “in.print” command section?
Here is the code:
display:
- platform: ssd1322_spi
model: "SSD1322 256x64"
reset_pin: D1
cs_pin: D8
dc_pin: D6
lambda: |-
if (id(albumname).has_state()) {
std::string printout = id(mediatitle).state;
int clength = printout.length();
id(length)=clength*5;
it.print((id(coords)+15), 0, id(font2), printout.c_str());
it.printf(0, 2, id(mat1), "");
it.printf(15, 20, id(font2), "%s", id(albumname).state.c_str());
it.printf(0, 22, id(mat1), "");
it.printf(15, 40, id(font2), "%s", id(mediaartist).state.c_str());
it.printf(0, 42, id(mat1), "");
if (id(mediadurum).state == "playing") {
it.printf(200, 7, id(font0), "");
}
thanks in advance