mirror of
https://github.com/esphome/esphome.git
synced 2026-09-28 23:40:25 +00:00
[nextion] Keep add_waveform_data() available without a waveform sensor (#19590)
This commit is contained in:
@@ -614,7 +614,6 @@ class Nextion final : public NextionBase, public PollingComponent, public uart::
|
||||
*/
|
||||
void disable_component_touch(const char *component);
|
||||
|
||||
#ifdef USE_NEXTION_WAVEFORM
|
||||
/**
|
||||
* Add waveform data to a waveform component
|
||||
* @param component_id The integer component id.
|
||||
@@ -624,7 +623,6 @@ class Nextion final : public NextionBase, public PollingComponent, public uart::
|
||||
void add_waveform_data(uint8_t component_id, uint8_t channel_number, uint8_t value);
|
||||
|
||||
void open_waveform_channel(uint8_t component_id, uint8_t channel_number, uint8_t value);
|
||||
#endif // USE_NEXTION_WAVEFORM
|
||||
|
||||
/**
|
||||
* Display a picture at coordinates.
|
||||
|
||||
@@ -217,7 +217,6 @@ void Nextion::set_component_value(const char *component, int32_t value) {
|
||||
this->add_no_result_to_queue_with_printf_(".val", "%s.val=%" PRId32, component, value);
|
||||
}
|
||||
|
||||
#ifdef USE_NEXTION_WAVEFORM
|
||||
void Nextion::add_waveform_data(uint8_t component_id, uint8_t channel_number, uint8_t value) {
|
||||
this->add_no_result_to_queue_with_printf_("add", "add %" PRIu8 ",%" PRIu8 ",%" PRIu8, component_id, channel_number,
|
||||
value);
|
||||
@@ -227,7 +226,6 @@ void Nextion::open_waveform_channel(uint8_t component_id, uint8_t channel_number
|
||||
this->add_no_result_to_queue_with_printf_("addt", "addt %" PRIu8 ",%" PRIu8 ",%" PRIu8, component_id, channel_number,
|
||||
value);
|
||||
}
|
||||
#endif // USE_NEXTION_WAVEFORM
|
||||
|
||||
void Nextion::set_component_coordinates(const char *component, uint16_t x, uint16_t y) {
|
||||
this->add_no_result_to_queue_with_printf_(".xcen", "%s.xcen=%" PRIu16, component, x);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Waveform commands from a lambda with no waveform sensor configured, so
|
||||
# USE_NEXTION_WAVEFORM is not defined.
|
||||
display:
|
||||
- platform: nextion
|
||||
id: main_lcd
|
||||
lambda: |-
|
||||
id(main_lcd).open_waveform_channel(37, 0, 10);
|
||||
id(main_lcd).add_waveform_data(37, 0, 42);
|
||||
@@ -0,0 +1,3 @@
|
||||
packages:
|
||||
uart: !include ../../test_build_components/common/uart/esp32-idf.yaml
|
||||
waveform_lambda: !include common_waveform_lambda.yaml
|
||||
Reference in New Issue
Block a user