From a1b6a91642dd326ba87815d37718b04b527f200e Mon Sep 17 00:00:00 2001 From: Aalian Khan <39784853+AalianKhan@users.noreply.github.com> Date: Mon, 13 May 2019 14:51:21 -0400 Subject: [PATCH 1/5] Update nextion.h --- esphome/components/nextion/nextion.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/esphome/components/nextion/nextion.h b/esphome/components/nextion/nextion.h index d8fe3762c9..91aaecb96a 100644 --- a/esphome/components/nextion/nextion.h +++ b/esphome/components/nextion/nextion.h @@ -23,6 +23,8 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * Set the text of a component to a static string. * @param component The component name. * @param text The static text to set. + * Example: `it.set_component_text("textview", "Hello World!");` + * Component named `textview` `txt` value has been changed to `Hello World`. */ void set_component_text(const char *component, const char *text); /** @@ -30,18 +32,25 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param component The component name. * @param format The printf-style format string. * @param ... The arguments to the format. + * Example: `it.set_component_text_printf("textview", "The uptime is: %.1f", id(uptime_sensor).state);` + * Component named `textview` has been changed to `The uptime is:` Then the value of `uptime_sensor`. + * For example when `uptime_sensor` = 506, then, `The uptime is: 506` will be displayed. */ void set_component_text_printf(const char *component, const char *format, ...) __attribute__((format(printf, 3, 4))); /** * Set the integer value of a component * @param component The component name. * @param value The value to set. + * Example: `it.set_component_value("gauge", 50);` + * Component named `gauge` has changed the `val`to 50. */ void set_component_value(const char *component, int value); /** * Set the picture of an image component. * @param component The component name. * @param value The picture name. + * Example: `it.set_component_picture("pic", "4");` + * The picture component named `pic`, has changed the image which has the ID `4`, Which was set in the Nextion editor. */ void set_component_picture(const char *component, const char *picture) { this->send_command_printf("%s.val=%s", component, picture); @@ -50,12 +59,18 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * Set the background color of a component. * @param component The component name. * @param color The color (as a string). + * Example: `it.set_component_background_color("button", "17013"); + * The background color of component named `button`, has been changed to blue. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ void set_component_background_color(const char *component, const char *color); /** * Set the pressed background color of a component. * @param component The component name. * @param color The color (as a string). + * Example: `it.set_component_pressed_background_color("button", "17013"` + * The pressed background color of the component named `button` has been changed to blue. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors */ void set_component_pressed_background_color(const char *component, const char *color); /** From 6fff2e5957369b6b8928e13eeb2654b2e4840975 Mon Sep 17 00:00:00 2001 From: Aalian Khan <39784853+AalianKhan@users.noreply.github.com> Date: Mon, 13 May 2019 21:24:45 -0400 Subject: [PATCH 2/5] Added more examples --- esphome/components/nextion/nextion.h | 42 ++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/esphome/components/nextion/nextion.h b/esphome/components/nextion/nextion.h index 91aaecb96a..b5bc86ec62 100644 --- a/esphome/components/nextion/nextion.h +++ b/esphome/components/nextion/nextion.h @@ -68,8 +68,8 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * Set the pressed background color of a component. * @param component The component name. * @param color The color (as a string). - * Example: `it.set_component_pressed_background_color("button", "17013"` - * The pressed background color of the component named `button` has been changed to blue. + * Example: `it.set_component_pressed_background_color("button", "17013"); + * The pressed background color of the component named `button` has been changed to blue. So when the button is pressed, the background color will change to blue. * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors */ void set_component_pressed_background_color(const char *component, const char *color); @@ -77,12 +77,18 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * Set the font color of a component. * @param component The component name. * @param color The color (as a string). + * Example: `it.set_component_font_color("textview", "17013); + * The font color of component named `textview` has been changed to blue. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors */ void set_component_font_color(const char *component, const char *color); /** * Set the pressed font color of a component. * @param component The component name. * @param color The color (as a string). + * Example: `it.set_component_pressed_font_color("button", "17013");` + * The pressed font color for component named button has been changed to blue. So when `button` is pressed, the font color will change to blue + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors */ void set_component_pressed_font_color(const char *component, const char *color); /** @@ -90,12 +96,16 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param component The component name. * @param x The x coordinate. * @param y The y coordinate. + * Example: `it.set_component_coordinates("pic", 55, 100);` + * The component named `pic` has moved to the x coordinate `55` and y coordinate `100`. */ void set_component_coordinates(const char *component, int x, int y); /** * Set the font id for a component. * @param component The component name. * @param font_id The ID of the font (number). + * Example: `it.set_component_font("textview", "3");` + * Changes the font of the component named `textveiw`. Font IDs are set in the Nextion Editor. */ void set_component_font(const char *component, uint8_t font_id); #ifdef USE_TIME @@ -109,26 +119,36 @@ class Nextion : public PollingComponent, public uart::UARTDevice { /** * Show the page with a given name. * @param page The name of the page. + * Example: `it.goto_page("main");` + * Switches to the page named `main`. Pages are named in the Nextion Editor. */ void goto_page(const char *page); /** * Hide a component. * @param component The component name. + * Example: `hide_component("button");` + * Hides the component named `button`. */ void hide_component(const char *component); /** * Show a component. * @param component The component name. + * Example: `show_component("button");` + * Shows the component named `button`. */ void show_component(const char *component); /** * Enable touch for a component. * @param component The component name. + * Example: `enable_component_touch("button");` + * Enables touch for component named `button`. */ void enable_component_touch(const char *component); /** * Disable touch for a component. * @param component The component name. + * Examlple: `disable_component_touch("button");` + * Disables touch for component named `button`. */ void disable_component_touch(const char *component); /** @@ -143,6 +163,8 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param picture_id The picture id. * @param x1 The x coordinate. * @param y1 The y coordniate. + * Example: `display_picture(2, 15, 25);` + * Displays the picture who has the id `2` at the x coordinates `15` and y coordinates `25`. */ void display_picture(int picture_id, int x_start, int y_start); /** @@ -152,6 +174,9 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param width The width to draw. * @param height The height to draw. * @param color The color to draw with (as a string). + * Example: `fill_area(50, 50, 100, 100, "17013");` + * Fills an area that starts at x coordiante `50` and y coordinate `50` with a height of `100` and width of `100` with the color of blue. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors */ void fill_area(int x1, int y1, int width, int height, const char *color); /** @@ -161,6 +186,9 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param x2 The ending x coordinate. * @param y2 The ending y coordinate. * @param color The color to draw with (as a string). + * Example: `it.line(50, 50, 75, 75, "17013");` + * Makes a line that starts at x coordinate `50` and y coordinate `50` and ends at x coordinate `75` and y coordinate `75` with the color of blue. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ void line(int x1, int y1, int x2, int y2, const char *color); /** @@ -170,6 +198,9 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param width The width of the rectangle. * @param height The height of the rectangle. * @param color The color to draw with (as a string). + * Example: `it.rectangle(25, 35, 40, 50, "17013");` + * Makes a outline of a rectangle that starts at x coordinate `25` and y coordinate `35` and has a width of `40` and a length of `50` with color of blue. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ void rectangle(int x1, int y1, int width, int height, const char *color); /** @@ -186,17 +217,24 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param center_y The center y coordinate. * @param radius The circle radius. * @param color The color to draw with (as a string). + * Example: `it.filled_cricle(25, 25, 10, "17013");` + * Makes a filled circle at the x cordinates `25` and y coordinate `25` with a radius of `10` with a color of blue. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ void filled_circle(int center_x, int center_y, int radius, const char *color); /** Set the brightness of the backlight. * * @param brightness The brightness, from 0 to 100. + * Example: `it.set_backlight_brightness(30);` + * Changes the brightness of the display to 30%. */ void set_backlight_brightness(uint8_t brightness); /** * Set the touch sleep timeout of the display. * @param timeout Timeout in seconds. + * Example: `it.set_touch_sleep_timeout(30);` + * After 30 seconds the display will go to sleep. Note: the display will only wakeup by a restart or by setting up `thup`. */ void set_touch_sleep_timeout(uint16_t timeout); From 7b5c4359c67c10e851bd3cf57e73b16a27a423b9 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 27 May 2019 15:39:01 +0200 Subject: [PATCH 3/5] Update nextion.h --- esphome/components/nextion/nextion.h | 171 ++++++++++++++++++++++----- 1 file changed, 139 insertions(+), 32 deletions(-) diff --git a/esphome/components/nextion/nextion.h b/esphome/components/nextion/nextion.h index b5bc86ec62..2286e4a7d2 100644 --- a/esphome/components/nextion/nextion.h +++ b/esphome/components/nextion/nextion.h @@ -32,8 +32,14 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param component The component name. * @param format The printf-style format string. * @param ... The arguments to the format. - * Example: `it.set_component_text_printf("textview", "The uptime is: %.1f", id(uptime_sensor).state);` - * Component named `textview` has been changed to `The uptime is:` Then the value of `uptime_sensor`. + * + * Example: + * ```cpp + * it.set_component_text_printf("textview", "The uptime is: %.0f", id(uptime_sensor).state); + * ``` + * + * This will change the text on the component named `textview` to `The uptime is:` Then the value of `uptime_sensor`. + * with zero decimals of accuracy (whole number). * For example when `uptime_sensor` = 506, then, `The uptime is: 506` will be displayed. */ void set_component_text_printf(const char *component, const char *format, ...) __attribute__((format(printf, 3, 4))); @@ -41,16 +47,26 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * Set the integer value of a component * @param component The component name. * @param value The value to set. - * Example: `it.set_component_value("gauge", 50);` - * Component named `gauge` has changed the `val`to 50. + * + * Example: + * ```cpp + * it.set_component_value("gauge", 50); + * ``` + * + * This will change the property `value` of the component `gauge` to 50. */ void set_component_value(const char *component, int value); /** * Set the picture of an image component. * @param component The component name. * @param value The picture name. - * Example: `it.set_component_picture("pic", "4");` - * The picture component named `pic`, has changed the image which has the ID `4`, Which was set in the Nextion editor. + * + * Example: + * ```cpp + * it.set_component_picture("pic", "4"); + * ``` + * + * This will change the image of the component `pic` to the image with ID `4`. */ void set_component_picture(const char *component, const char *picture) { this->send_command_printf("%s.val=%s", component, picture); @@ -59,8 +75,13 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * Set the background color of a component. * @param component The component name. * @param color The color (as a string). - * Example: `it.set_component_background_color("button", "17013"); - * The background color of component named `button`, has been changed to blue. + * + * Example: + * ```cpp + * it.set_component_background_color("button", "17013"); + * ``` + * + * This will change the background color of the component `button` to blue. * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ void set_component_background_color(const char *component, const char *color); @@ -68,27 +89,43 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * Set the pressed background color of a component. * @param component The component name. * @param color The color (as a string). - * Example: `it.set_component_pressed_background_color("button", "17013"); - * The pressed background color of the component named `button` has been changed to blue. So when the button is pressed, the background color will change to blue. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors + * + * Example: + * ```cpp + * it.set_component_pressed_background_color("button", "17013"); + * ``` + * + * This will change the pressed background color of the component `button` to blue. This is the background color that is shown when the + * component is pressed. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ void set_component_pressed_background_color(const char *component, const char *color); /** * Set the font color of a component. * @param component The component name. * @param color The color (as a string). - * Example: `it.set_component_font_color("textview", "17013); - * The font color of component named `textview` has been changed to blue. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors + * + * Example: + * ```cpp + * it.set_component_font_color("textview", "17013"); + * ``` + * + * This will change the font color of the component `textview` to a blue color. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ void set_component_font_color(const char *component, const char *color); /** * Set the pressed font color of a component. * @param component The component name. * @param color The color (as a string). - * Example: `it.set_component_pressed_font_color("button", "17013");` - * The pressed font color for component named button has been changed to blue. So when `button` is pressed, the font color will change to blue - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors + * + * Example: + * ```cpp + * it.set_component_pressed_font_color("button", "17013"); + * ``` + * + * This will change the pressed font color of the component `button` to a blue color. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ void set_component_pressed_font_color(const char *component, const char *color); /** @@ -96,15 +133,25 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param component The component name. * @param x The x coordinate. * @param y The y coordinate. - * Example: `it.set_component_coordinates("pic", 55, 100);` - * The component named `pic` has moved to the x coordinate `55` and y coordinate `100`. + * + * Example: + * ```cpp + * it.set_component_coordinates("pic", 55, 100); + * ``` + * + * This will move the position of the component `pic` to the x coordinate `55` and y coordinate `100`. */ void set_component_coordinates(const char *component, int x, int y); /** * Set the font id for a component. * @param component The component name. * @param font_id The ID of the font (number). - * Example: `it.set_component_font("textview", "3");` + * + * Example: + * ```cpp + * it.set_component_font("textview", "3"); + * ``` + * * Changes the font of the component named `textveiw`. Font IDs are set in the Nextion Editor. */ void set_component_font(const char *component, uint8_t font_id); @@ -119,35 +166,60 @@ class Nextion : public PollingComponent, public uart::UARTDevice { /** * Show the page with a given name. * @param page The name of the page. - * Example: `it.goto_page("main");` + * + * Example: + * ```cpp + * it.goto_page("main"); + * ``` + * * Switches to the page named `main`. Pages are named in the Nextion Editor. */ void goto_page(const char *page); /** * Hide a component. * @param component The component name. - * Example: `hide_component("button");` + * + * Example: + * ```cpp + * hide_component("button"); + * ``` + * * Hides the component named `button`. */ void hide_component(const char *component); /** * Show a component. * @param component The component name. - * Example: `show_component("button");` + * + * Example: + * ```cpp + * show_component("button"); + * ``` + * * Shows the component named `button`. */ void show_component(const char *component); /** * Enable touch for a component. * @param component The component name. - * Example: `enable_component_touch("button");` + * + * Example: + * ```cpp + * enable_component_touch("button"); + * ``` + * * Enables touch for component named `button`. */ void enable_component_touch(const char *component); /** * Disable touch for a component. * @param component The component name. - * Examlple: `disable_component_touch("button");` + * + * Example: + * ```cpp + * disable_component_touch("button"); + * ``` + * * Disables touch for component named `button`. */ void disable_component_touch(const char *component); @@ -163,7 +235,12 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param picture_id The picture id. * @param x1 The x coordinate. * @param y1 The y coordniate. - * Example: `display_picture(2, 15, 25);` + * + * Example: + * ```cpp + * display_picture(2, 15, 25); + * ``` + * * Displays the picture who has the id `2` at the x coordinates `15` and y coordinates `25`. */ void display_picture(int picture_id, int x_start, int y_start); @@ -174,7 +251,12 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param width The width to draw. * @param height The height to draw. * @param color The color to draw with (as a string). - * Example: `fill_area(50, 50, 100, 100, "17013");` + * + * Example: + * ```cpp + * fill_area(50, 50, 100, 100, "17013"); + * ``` + * * Fills an area that starts at x coordiante `50` and y coordinate `50` with a height of `100` and width of `100` with the color of blue. * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors */ @@ -186,7 +268,12 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param x2 The ending x coordinate. * @param y2 The ending y coordinate. * @param color The color to draw with (as a string). - * Example: `it.line(50, 50, 75, 75, "17013");` + * + * Example: + * ```cpp + * it.line(50, 50, 75, 75, "17013"); + * ``` + * * Makes a line that starts at x coordinate `50` and y coordinate `50` and ends at x coordinate `75` and y coordinate `75` with the color of blue. * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ @@ -198,7 +285,12 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param width The width of the rectangle. * @param height The height of the rectangle. * @param color The color to draw with (as a string). - * Example: `it.rectangle(25, 35, 40, 50, "17013");` + * + * Example: + * ```cpp + * it.rectangle(25, 35, 40, 50, "17013"); + * ``` + * * Makes a outline of a rectangle that starts at x coordinate `25` and y coordinate `35` and has a width of `40` and a length of `50` with color of blue. * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ @@ -217,7 +309,12 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param center_y The center y coordinate. * @param radius The circle radius. * @param color The color to draw with (as a string). - * Example: `it.filled_cricle(25, 25, 10, "17013");` + * + * Example: + * ```cpp + * it.filled_cricle(25, 25, 10, "17013"); + * ``` + * * Makes a filled circle at the x cordinates `25` and y coordinate `25` with a radius of `10` with a color of blue. * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. */ @@ -226,14 +323,24 @@ class Nextion : public PollingComponent, public uart::UARTDevice { /** Set the brightness of the backlight. * * @param brightness The brightness, from 0 to 100. - * Example: `it.set_backlight_brightness(30);` + * + * Example: + * ```cpp + * it.set_backlight_brightness(30); + * ``` + * * Changes the brightness of the display to 30%. */ void set_backlight_brightness(uint8_t brightness); /** * Set the touch sleep timeout of the display. * @param timeout Timeout in seconds. - * Example: `it.set_touch_sleep_timeout(30);` + * + * Example: + * ```cpp + * it.set_touch_sleep_timeout(30); + * ``` + * * After 30 seconds the display will go to sleep. Note: the display will only wakeup by a restart or by setting up `thup`. */ void set_touch_sleep_timeout(uint16_t timeout); From 0d9f5ef363f8c78b98a3d4f204e37149a85a7df5 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 27 May 2019 16:51:01 +0200 Subject: [PATCH 4/5] Update nextion.h --- esphome/components/nextion/nextion.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/esphome/components/nextion/nextion.h b/esphome/components/nextion/nextion.h index 2286e4a7d2..68d412cb47 100644 --- a/esphome/components/nextion/nextion.h +++ b/esphome/components/nextion/nextion.h @@ -23,8 +23,13 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * Set the text of a component to a static string. * @param component The component name. * @param text The static text to set. - * Example: `it.set_component_text("textview", "Hello World!");` - * Component named `textview` `txt` value has been changed to `Hello World`. + * + * Example: + * ```cpp + * it.set_component_text("textview", "Hello World!"); + * ``` + * + * This will set the `txt` property of the component `textview` to `Hello World`. */ void set_component_text(const char *component, const char *text); /** From 28f2a7f99cb6551f3bb1273c95f4b5517b657af7 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 27 May 2019 19:12:43 +0200 Subject: [PATCH 5/5] Update nextion.h --- esphome/components/nextion/nextion.h | 45 +++++++++++++++++----------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/esphome/components/nextion/nextion.h b/esphome/components/nextion/nextion.h index 68d412cb47..92b41a88af 100644 --- a/esphome/components/nextion/nextion.h +++ b/esphome/components/nextion/nextion.h @@ -57,7 +57,7 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * ```cpp * it.set_component_value("gauge", 50); * ``` - * + * * This will change the property `value` of the component `gauge` to 50. */ void set_component_value(const char *component, int value); @@ -87,7 +87,8 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * ``` * * This will change the background color of the component `button` to blue. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to + * Nextion HMI colors. */ void set_component_background_color(const char *component, const char *color); /** @@ -100,9 +101,10 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * it.set_component_pressed_background_color("button", "17013"); * ``` * - * This will change the pressed background color of the component `button` to blue. This is the background color that is shown when the - * component is pressed. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. + * This will change the pressed background color of the component `button` to blue. This is the background color that + * is shown when the component is pressed. Use this [color + * picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI + * colors. */ void set_component_pressed_background_color(const char *component, const char *color); /** @@ -116,7 +118,8 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * ``` * * This will change the font color of the component `textview` to a blue color. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to + * Nextion HMI colors. */ void set_component_font_color(const char *component, const char *color); /** @@ -124,13 +127,14 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * @param component The component name. * @param color The color (as a string). * - * Example: + * Example: * ```cpp * it.set_component_pressed_font_color("button", "17013"); * ``` * * This will change the pressed font color of the component `button` to a blue color. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to + * Nextion HMI colors. */ void set_component_pressed_font_color(const char *component, const char *color); /** @@ -184,7 +188,7 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * Hide a component. * @param component The component name. * - * Example: + * Example: * ```cpp * hide_component("button"); * ``` @@ -262,8 +266,9 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * fill_area(50, 50, 100, 100, "17013"); * ``` * - * Fills an area that starts at x coordiante `50` and y coordinate `50` with a height of `100` and width of `100` with the color of blue. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors + * Fills an area that starts at x coordiante `50` and y coordinate `50` with a height of `100` and width of `100` with + * the color of blue. Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to + * convert color codes to Nextion HMI colors */ void fill_area(int x1, int y1, int width, int height, const char *color); /** @@ -279,8 +284,10 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * it.line(50, 50, 75, 75, "17013"); * ``` * - * Makes a line that starts at x coordinate `50` and y coordinate `50` and ends at x coordinate `75` and y coordinate `75` with the color of blue. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. + * Makes a line that starts at x coordinate `50` and y coordinate `50` and ends at x coordinate `75` and y coordinate + * `75` with the color of blue. Use this [color + * picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI + * colors. */ void line(int x1, int y1, int x2, int y2, const char *color); /** @@ -296,8 +303,10 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * it.rectangle(25, 35, 40, 50, "17013"); * ``` * - * Makes a outline of a rectangle that starts at x coordinate `25` and y coordinate `35` and has a width of `40` and a length of `50` with color of blue. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. + * Makes a outline of a rectangle that starts at x coordinate `25` and y coordinate `35` and has a width of `40` and a + * length of `50` with color of blue. Use this [color + * picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI + * colors. */ void rectangle(int x1, int y1, int width, int height, const char *color); /** @@ -321,7 +330,8 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * ``` * * Makes a filled circle at the x cordinates `25` and y coordinate `25` with a radius of `10` with a color of blue. - * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. + * Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to + * Nextion HMI colors. */ void filled_circle(int center_x, int center_y, int radius, const char *color); @@ -346,7 +356,8 @@ class Nextion : public PollingComponent, public uart::UARTDevice { * it.set_touch_sleep_timeout(30); * ``` * - * After 30 seconds the display will go to sleep. Note: the display will only wakeup by a restart or by setting up `thup`. + * After 30 seconds the display will go to sleep. Note: the display will only wakeup by a restart or by setting up + * `thup`. */ void set_touch_sleep_timeout(uint16_t timeout);