47 this->
trigger(page_id, component_id, touch_event);
58 void play(Ts...
x)
override {
59 this->component_->set_brightness(this->brightness_.value(
x...));
60 this->component_->set_backlight_brightness(this->brightness_.value(
x...));
63 void set_brightness(std::function<
void(Ts...,
float)> brightness) { this->brightness_ = brightness; }
73 TEMPLATABLE_VALUE(
float,
state)
74 TEMPLATABLE_VALUE(
bool, publish_state)
75 TEMPLATABLE_VALUE(
bool, send_to_nextion)
77 void play(Ts...
x)
override {
78 this->component_->set_state(this->state_.value(x...), this->publish_state_.value(x...),
79 this->send_to_nextion_.value(x...));
83 void set_publish_state(std::function<
void(Ts...,
bool)> publish_state) { this->publish_state_ = publish_state; }
85 this->send_to_nextion_ = send_to_nextion;
96 TEMPLATABLE_VALUE(
const char *,
state)
97 TEMPLATABLE_VALUE(
bool, publish_state)
98 TEMPLATABLE_VALUE(
bool, send_to_nextion)
100 void play(Ts...
x)
override {
101 this->component_->set_state(this->state_.value(x...), this->publish_state_.value(x...),
102 this->send_to_nextion_.value(x...));
106 void set_publish_state(std::function<
void(Ts...,
bool)> publish_state) { this->publish_state_ = publish_state; }
108 this->send_to_nextion_ = send_to_nextion;
119 TEMPLATABLE_VALUE(
bool,
state)
120 TEMPLATABLE_VALUE(
bool, publish_state)
121 TEMPLATABLE_VALUE(
bool, send_to_nextion)
123 void play(Ts...
x)
override {
124 this->component_->set_state(this->state_.value(x...), this->publish_state_.value(x...),
125 this->send_to_nextion_.value(x...));
129 void set_publish_state(std::function<
void(Ts...,
bool)> publish_state) { this->publish_state_ = publish_state; }
131 this->send_to_nextion_ = send_to_nextion;
void set_brightness(std::function< void(Ts..., float)> brightness)
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.
TEMPLATABLE_VALUE(float, brightness) void play(Ts... x) override
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)
NextionSetBrightnessAction(Nextion *component)
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)