Nextion on_touch trigger (#5833)

This commit is contained in:
Edward Firmo
2023-11-28 05:14:59 +01:00
committed by GitHub
parent a8bc5ef46f
commit d1be686c54
4 changed files with 40 additions and 0 deletions
+9
View File
@@ -33,5 +33,14 @@ class PageTrigger : public Trigger<uint8_t> {
}
};
class TouchTrigger : public Trigger<uint8_t, uint8_t, bool> {
public:
explicit TouchTrigger(Nextion *nextion) {
nextion->add_touch_event_callback([this](uint8_t page_id, uint8_t component_id, bool touch_event) {
this->trigger(page_id, component_id, touch_event);
});
}
};
} // namespace nextion
} // namespace esphome