ESPHome  2024.11.1
automation.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "sml.h"
5 
6 #include <vector>
7 
8 namespace esphome {
9 namespace sml {
10 
11 class DataTrigger : public Trigger<const std::vector<uint8_t> &, bool> {
12  public:
13  explicit DataTrigger(Sml *sml) {
14  sml->add_on_data_callback([this](const std::vector<uint8_t> &data, bool valid) { this->trigger(data, valid); });
15  }
16 };
17 
18 } // namespace sml
19 } // namespace esphome
void trigger(Ts... x)
Inform the parent automation that the event has triggered.
Definition: automation.h:95
void add_on_data_callback(std::function< void(std::vector< uint8_t >, bool)> &&callback)
Definition: sml.cpp:65
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7