mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-07 05:13:31 +02:00
Nextion upload and sensors (#1464)
Co-authored-by: Senex Crenshaw <senexcrenshaw@gmail.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
#include "esphome/core/automation.h"
|
||||
#include "nextion.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace nextion {
|
||||
|
||||
class SetupTrigger : public Trigger<> {
|
||||
public:
|
||||
explicit SetupTrigger(Nextion *nextion) {
|
||||
nextion->add_setup_state_callback([this]() { this->trigger(); });
|
||||
}
|
||||
};
|
||||
|
||||
class SleepTrigger : public Trigger<> {
|
||||
public:
|
||||
explicit SleepTrigger(Nextion *nextion) {
|
||||
nextion->add_sleep_state_callback([this]() { this->trigger(); });
|
||||
}
|
||||
};
|
||||
|
||||
class WakeTrigger : public Trigger<> {
|
||||
public:
|
||||
explicit WakeTrigger(Nextion *nextion) {
|
||||
nextion->add_wake_state_callback([this]() { this->trigger(); });
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace nextion
|
||||
} // namespace esphome
|
||||
Reference in New Issue
Block a user