7 static const char *
const TAG =
"nextion";
20 ESP_LOGD(TAG,
"Sleep timeout out of bounds, range 3-65535");
39 const uint8_t to_send[3] = {0xFF, 0xFF, 0xFF};
45 this->
write_str(
"DRAKJHSUYDGBNCJHGJKSHBDN");
119 va_start(arg, format);
121 int ret = vsnprintf(buffer,
sizeof(buffer), format, arg);
132 if (brightness < 0 || brightness > 1.0) {
133 ESP_LOGD(TAG,
"Brightness out of bounds, percentage range 0-1.0");
196 this->
add_no_result_to_queue_with_printf_(
"fill_area",
"fill %d,%d,%d,%d,%s", x1, y1, width, height, color);
200 this->
add_no_result_to_queue_with_printf_(
"fill_area",
"fill %d,%d,%d,%d,%d", x1, y1, width, height,
205 this->
add_no_result_to_queue_with_printf_(
"line",
"line %d,%d,%d,%d,%s", x1, y1, x2, y2, color);
209 this->
add_no_result_to_queue_with_printf_(
"line",
"line %d,%d,%d,%d,%d", x1, y1, x2, y2,
214 this->
add_no_result_to_queue_with_printf_(
"draw",
"draw %d,%d,%d,%d,%s", x1, y1, x1 + width, y1 + height, color);
218 this->
add_no_result_to_queue_with_printf_(
"draw",
"draw %d,%d,%d,%d,%d", x1, y1, x1 + width, y1 + height,
void goto_page(const char *page)
Show the page with a given name.
void set_nextion_rtc_time(ESPTime time)
Send the current time to the nextion display.
void write_str(const char *str)
void line(int x1, int y1, int x2, int y2, const char *color)
Draw a line on the screen.
void set_protocol_reparse_mode(bool active_mode)
Sets Nextion Protocol Reparse mode between active or passive.
void set_component_pic(const char *component, uint8_t pic_id)
Set the picture id of a component.
void write_array(const uint8_t *data, size_t len)
static uint16_t color_to_565(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
void hide_component(const char *component) override
Hide a component.
void add_no_result_to_queue_with_set(NextionComponentBase *component, int state_value) override
void circle(int center_x, int center_y, int radius, const char *color)
Draw a circle outline.
void set_component_pressed_background_color(const char *component, uint32_t color)
Set the pressed background color of a component.
void filled_circle(int center_x, int center_y, int radius, const char *color)
Draw a filled circled.
A more user-friendly version of struct tm from time.h.
bool send_command_(const std::string &command)
Manually send a raw command to the display and don't wait for an acknowledgement packet.
void set_component_coordinates(const char *component, int x, int y)
Set the coordinates of a component on screen.
void set_component_picc(const char *component, uint8_t pic_id)
Set the background picture id of component.
void sleep(bool sleep)
Sets Nextion mode between sleep and awake.
void disable_component_touch(const char *component)
Disable touch for a component.
bool void add_no_result_to_queue_with_set_internal_(const std::string &variable_name, const std::string &variable_name_to_send, int state_value, bool is_sleep_safe=false)
void set_component_picture(const char *component, const char *picture)
Set the picture of an image component.
void set_component_pressed_font_color(const char *component, uint32_t color)
Set the pressed font color of a component.
void show_component(const char *component) override
Show a component.
void rectangle(int x1, int y1, int width, int height, const char *color)
Draw a rectangle outline.
void void set_component_value(const char *component, int value)
Set the integer value of a component.
void open_waveform_channel(int component_id, uint8_t channel_number, uint8_t value)
bool add_no_result_to_queue_with_printf_(const std::string &variable_name, const char *format,...) __attribute__((format(printf
Sends a formatted command to the nextion.
void add_waveform_data(int component_id, uint8_t channel_number, uint8_t value)
Add waveform data to a waveform component.
void set_component_text_printf(const char *component, const char *format,...) __attribute__((format(printf
Set the text of a component to a formatted string.
void set_component_background_color(const char *component, uint32_t color)
Set the background color of a component.
uint8_t second
seconds after the minute [0-60]
void display_picture(int picture_id, int x_start, int y_start)
Display a picture at coordinates.
void set_component_text(const char *component, const char *text)
Set the text of a component to a static string.
uint8_t minute
minutes after the hour [0-59]
void fill_area(int x1, int y1, int width, int height, const char *color)
Fill a rectangle with a color.
void set_component_font(const char *component, uint8_t font_id) override
Set the font id for a component.
void enable_component_touch(const char *component)
Enable touch for a component.
void set_backlight_brightness(float brightness)
Set the brightness of the backlight.
void soft_reset()
Softreset the Nextion.
void set_touch_sleep_timeout(uint16_t timeout)
Set the touch sleep timeout of the display.
void set_wake_up_page(uint8_t page_id=255)
Sets which page Nextion loads when exiting sleep mode.
void set_auto_wake_on_touch(bool auto_wake)
Sets if Nextion should auto-wake from sleep when touch press occurs.
Implementation of SPI Controller mode.
void set_start_up_page(uint8_t page_id=255)
Sets which page Nextion loads when connecting to ESPHome.
uint8_t month
month; january=1 [1-12]
uint8_t hour
hours since midnight [0-23]
uint8_t day_of_month
day of the month [1-31]
void set_component_font_color(const char *component, uint32_t color)
Set the font color of a component.