* 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
* Add macros header with more usable Arduino version defines
* Change Arduino version checking to use our version defines
* Add missing ESP8266 check
* Rename Arduino version macro to ARDUINO_VERSION_CODE
* Upgrade clang-tidy to use Arduino 3
* Fix clang-tidy warnings
* Upgrade NeoPixelBus to upstream 2.6.7
* Use Arduino-version-appropriate API to set redirect flags
* Remove now unnecessary CLANG_TIDY ifdefs
* Add preprocessor hackery to avoid including pgmspace.h
* Bump base image to 4.1.1 and update lint
* Fix nfctag
* Fix make_unique ambiguous
* Fix ignore name
* Fix ambiguous v2
* Remove unused begin
* Cast time_t to prevent issues on platforms where time_t is 32bit
Co-authored-by: Otto winter <otto@otto-winter.com>