1
0
mirror of https://github.com/esphome/esphome.git synced 2024-10-06 10:50:58 +01:00

Update nextion.h

This commit is contained in:
Otto Winter 2019-05-27 19:12:43 +02:00 committed by GitHub
parent 0d9f5ef363
commit 28f2a7f99c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,7 @@ class Nextion : public PollingComponent, public uart::UARTDevice {
* ```cpp * ```cpp
* it.set_component_value("gauge", 50); * it.set_component_value("gauge", 50);
* ``` * ```
* *
* This will change the property `value` of the component `gauge` to 50. * This will change the property `value` of the component `gauge` to 50.
*/ */
void set_component_value(const char *component, int value); 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. * 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); 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"); * 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 * This will change the pressed background color of the component `button` to blue. This is the background color that
* component is pressed. * is shown when the component is pressed. Use this [color
* Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. * 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); 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. * 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); 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 component The component name.
* @param color The color (as a string). * @param color The color (as a string).
* *
* Example: * Example:
* ```cpp * ```cpp
* it.set_component_pressed_font_color("button", "17013"); * it.set_component_pressed_font_color("button", "17013");
* ``` * ```
* *
* This will change the pressed font color of the component `button` to a blue color. * 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); 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. * Hide a component.
* @param component The component name. * @param component The component name.
* *
* Example: * Example:
* ```cpp * ```cpp
* hide_component("button"); * hide_component("button");
* ``` * ```
@ -262,8 +266,9 @@ class Nextion : public PollingComponent, public uart::UARTDevice {
* fill_area(50, 50, 100, 100, "17013"); * 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. * Fills an area that starts at x coordiante `50` and y coordinate `50` with a height of `100` and width of `100` with
* Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors * 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); 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"); * 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. * Makes a line that starts at x coordinate `50` and y coordinate `50` and ends at x coordinate `75` and y coordinate
* Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. * `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); 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"); * 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. * Makes a outline of a rectangle that starts at x coordinate `25` and y coordinate `35` and has a width of `40` and a
* Use this [color picker](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to convert color codes to Nextion HMI colors. * 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); 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. * 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); 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); * 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); void set_touch_sleep_timeout(uint16_t timeout);