47 this->
trigger(page_id, component_id, touch_event);
56 TEMPLATABLE_VALUE(
float,
state)
57 TEMPLATABLE_VALUE(
bool, publish_state)
58 TEMPLATABLE_VALUE(
bool, send_to_nextion)
60 void play(Ts...
x)
override {
61 this->component_->set_state(this->state_.value(x...), this->publish_state_.value(x...),
62 this->send_to_nextion_.value(x...));
66 void set_publish_state(std::function<
void(Ts...,
bool)> publish_state) { this->publish_state_ = publish_state; }
68 this->send_to_nextion_ = send_to_nextion;
79 TEMPLATABLE_VALUE(
const char *,
state)
80 TEMPLATABLE_VALUE(
bool, publish_state)
81 TEMPLATABLE_VALUE(
bool, send_to_nextion)
83 void play(Ts...
x)
override {
84 this->component_->set_state(this->state_.value(x...), this->publish_state_.value(x...),
85 this->send_to_nextion_.value(x...));
89 void set_publish_state(std::function<
void(Ts...,
bool)> publish_state) { this->publish_state_ = publish_state; }
91 this->send_to_nextion_ = send_to_nextion;
102 TEMPLATABLE_VALUE(
bool,
state)
103 TEMPLATABLE_VALUE(
bool, publish_state)
104 TEMPLATABLE_VALUE(
bool, send_to_nextion)
106 void play(Ts...
x)
override {
107 this->component_->set_state(this->state_.value(x...), this->publish_state_.value(x...),
108 this->send_to_nextion_.value(x...));
112 void set_publish_state(std::function<
void(Ts...,
bool)> publish_state) { this->publish_state_ = publish_state; }
114 this->send_to_nextion_ = send_to_nextion;
void add_new_page_callback(std::function< void(uint8_t)> &&callback)
Add a callback to be notified when the nextion changes pages.
void set_publish_state(std::function< void(Ts..., bool)> publish_state)
void add_wake_state_callback(std::function< void()> &&callback)
Add a callback to be notified of wake state changes.
void add_setup_state_callback(std::function< void()> &&callback)
Add a callback to be notified when the nextion completes its initialize setup.
void set_state(std::function< void(Ts..., const char *)> state)
void add_buffer_overflow_event_callback(std::function< void()> &&callback)
Add a callback to be notified when the nextion reports a buffer overflow.
void trigger(Ts... x)
Inform the parent automation that the event has triggered.
void set_state(std::function< void(Ts..., float)> state)
void add_sleep_state_callback(std::function< void()> &&callback)
Add a callback to be notified of sleep state changes.
void set_send_to_nextion(std::function< void(Ts..., bool)> send_to_nextion)
WakeTrigger(Nextion *nextion)
void set_publish_state(std::function< void(Ts..., bool)> publish_state)
NextionPublishBoolAction(NextionComponent *component)
void set_send_to_nextion(std::function< void(Ts..., bool)> send_to_nextion)
NextionPublishTextAction(NextionComponent *component)
NextionComponent * component_
NextionComponent * component_
void set_state(std::function< void(Ts..., bool)> state)
PageTrigger(Nextion *nextion)
void add_touch_event_callback(std::function< void(uint8_t, uint8_t, bool)> &&callback)
Add a callback to be notified when Nextion has a touch event.
NextionComponent * component_
void set_publish_state(std::function< void(Ts..., bool)> publish_state)
NextionPublishFloatAction(NextionComponent *component)
SleepTrigger(Nextion *nextion)
Implementation of SPI Controller mode.
BufferOverflowTrigger(Nextion *nextion)
SetupTrigger(Nextion *nextion)
TouchTrigger(Nextion *nextion)
void set_send_to_nextion(std::function< void(Ts..., bool)> send_to_nextion)