This is a simplified version of `send_command_printf` without the `printf` support.
Manually send a raw command to the display.
param command The pcommand, like "page 0"
return Whether the send was successful.
This fixes the call to the Nextion display to change the pic id from a component.
It was previously changing the attribute `val`, which is related to something else.
In addition, I've changed the parameter for picture_id to be uint_8, as Nextion requires an integer from 0 to 255 on this attribute.
* Nextion TFT upload IDF memory optimization
This optimizes the memory in use for TFT upload when using `esp-idf` framework.
Basically, the engine establishes 3 connections to the the http/https server:
1. Fetch the file size (used to manage chunks and file size)
2. Transfer the 1st chunk (when it evaluates Nextion response to define either to continue from that point or to another point in the file)
3. Transfer the remaining data.
Until now, connection 1 was kept open during the whole process taking aprox 40kb of heap in a esp32dev (NSPanel in my tests) and the same amount of memory was needed to the 2nd and 3rd connections (which never competes to each other).
With this change, each connection is closed and released before opening the next one with a significant reduction on the required heap needed for this transfer.
This can still be improved to use a persistent connection, but I will look at this in the future, so it is not part of this change.
In addition to the better connection management, I've added quite a lot of log (mostly at VERBOSE level), which was used for troubleshooting here.
I was unsure about removing this. As it can be useful for others, I decided to keep it, but I will be fine about removing it if this is now in line with ESPHome best practices.
* clang-format
* Log response length
* Nextion `queue_size` function
Returns the size of Nextion queue.
For troubleshooting only.
* Move `queue_size` to `nextion.h`
This is where the queue is
* Inline doc
* clang-format
* Add `foreground` color
- Adds `set_component_foreground_color` and `set_component_pressed_foreground_color` which does the same as `set_component_font_color` and `set_component_pressed_font_color` but with a more intuitive name, as this can be used for any component and not only the ones with a text (font).
- I've also reviewed some docstring when related to colors.
* Add numeric color to drawing methods
Should I've used uint32_t instead? In order to keep consistency?
* component color support to uint6_t
This is the right format and is now consistent with colors on drawings.
I'm keeping uint32_t also to avoid breaking changes.
* Enforces uint16_t for colors
uint32_t is incorrect for Nextion display colors.
* Fix clang-format
* Prep-work for datetime entities
* Fix some includes and remove some restrictions on printing time on displays
* format
* format
* More formatting
* Move function contents
* Ignore clang-tidy