Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Nextion set_component_picture call #6378

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions esphome/components/nextion/nextion.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ class Nextion : public NextionBase, public PollingComponent, public uart::UARTDe
/**
* Set the picture of an image component.
* @param component The component name.
* @param value The picture name.
* @param value The picture id.
*
* Example:
* ```cpp
* it.set_component_picture("pic", "4");
* 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);
void set_component_picture(const char *component, uint8_t picture_id);
/**
* Set the background color of a component.
* @param component The component name.
Expand Down
4 changes: 2 additions & 2 deletions esphome/components/nextion/nextion_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ void Nextion::disable_component_touch(const char *component) {
this->add_no_result_to_queue_with_printf_("disable_component_touch", "tsw %s,0", component);
}

void Nextion::set_component_picture(const char *component, const char *picture) {
this->add_no_result_to_queue_with_printf_("set_component_picture", "%s.val=%s", component, picture);
void Nextion::set_component_picture(const char *component, uint8_t picture_id) {
this->add_no_result_to_queue_with_printf_("set_component_picture", "%s.pic=%d", component, picture_id);
}

void Nextion::set_component_text(const char *component, const char *text) {
Expand Down