18 static const char *
const NEXTION_QUEUE_TYPE_STRINGS[] = {
"NO_RESULT",
"SENSOR",
"BINARY_SENSOR",
19 "SWITCH",
"TEXT_SENSOR",
"WAVEFORM_SENSOR"};
34 void set_variable_name(
const std::string &variable_name,
const std::string &variable_name_to_send =
"") {
35 variable_name_ = variable_name;
36 if (variable_name_to_send.empty()) {
37 variable_name_to_send_ = variable_name;
39 variable_name_to_send_ = variable_name_to_send;
48 virtual void process_touch(uint8_t page_id, uint8_t component_id,
bool on){};
49 virtual void process_text(
const std::string &variable_name,
const std::string &text_value){};
50 virtual void process_bool(
const std::string &variable_name,
bool on){};
62 virtual void set_state(
const std::string &
state,
bool publish,
bool send_to_nextion){};
73 if (this->wave_buffer_.size() <= buffer_sent) {
74 this->wave_buffer_.clear();
76 this->wave_buffer_.erase(this->wave_buffer_.begin(), this->wave_buffer_.begin() + buffer_sent);
95 uint8_t component_id_ = 0;
96 uint8_t wave_chan_id_ = UINT8_MAX;
98 int wave_max_length_ = 255;
std::string variable_name_
virtual void process_text(const std::string &variable_name, const std::string &text_value)
virtual void set_state(const std::string &state, bool publish)
uint8_t get_wave_channel_id()
virtual ~NextionQueue()=default
void clear_wave_buffer(size_t buffer_sent)
virtual void process_bool(const std::string &variable_name, bool on)
bool needs_to_send_update_
std::vector< uint8_t > wave_buffer_
virtual void set_state(bool state)
virtual void process_sensor(const std::string &variable_name, int state)
virtual std::string get_queue_type_string()
std::string variable_name_to_send_
virtual void set_state(bool state, bool publish, bool send_to_nextion)
std::string get_variable_name()
virtual void update_component_settings(bool force_update)
void set_wave_channel_id(uint8_t wave_chan_id)
virtual void set_state_from_string(const std::string &state_value, bool publish, bool send_to_nextion)
size_t get_wave_buffer_size()
virtual void set_state(bool state, bool publish)
std::vector< uint8_t > get_wave_buffer()
std::string get_variable_name_to_send()
virtual void set_state(const std::string &state)
virtual void send_state_to_nextion()
virtual void update_component()
uint8_t get_component_id()
void set_wave_max_length(int wave_max_length)
virtual NextionQueueType get_queue_type()
virtual void set_state(float state)
virtual void set_state(float state, bool publish, bool send_to_nextion)
virtual void update_component_settings()
virtual void set_state_from_int(int state_value, bool publish, bool send_to_nextion)
bool get_needs_to_send_update()
NextionComponentBase * component
Implementation of SPI Controller mode.
virtual void set_state(float state, bool publish)
void set_component_id(uint8_t component_id)
virtual void set_state(const std::string &state, bool publish, bool send_to_nextion)
void set_variable_name(const std::string &variable_name, const std::string &variable_name_to_send="")
virtual void process_touch(uint8_t page_id, uint8_t component_id, bool on)
uint8_t get_wave_chan_id()