Is there any full documentation on Lambda functions for displays in ESPhome?
On this page on official site there are scattered little bits of useful things like:
But is there any full documentation on functions of this “it.” object? Like, can I rotate one line of text to 45°? Or any other object? Or scale image? Or anything else?
I totally understand that I can use C++ syntax for if/else, loops and other stuff… But what is this “it.” object?
‘it’ is an object (display buffer, basically) defined within ESPHome and passed to the YAML-macro’s lambda on each callback.
If you let ESPHome manage the display (and you should), then all display actions should go through ‘it.’
Thank you to everyone! Yes, I missed ESPHome API page entirely.
Now I can see everything. But, how I understand, there are no way to rotate text 45°, or do any other non-basic stuff.
Looks like only workaround would be, is to generate everything as image in other place (e.g. Home Assistant) and display this image on the ESP32 screen
Display lambdas are additionally passed a variable called it which represents the rendering engine object.
I then went to the search box and failed to find out anything about a variable called “it”.
If you learn (like me) by looking at source code, and you find the statement it.print(blah) , then you try to find the whereabouts of the it object. Only by googling did I find this article which led me to your link, referencing a variable, rather than an object.