ESPHome  2024.10.2
automation.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace modbus_controller {
9 
10 class ModbusCommandSentTrigger : public Trigger<int, int> {
11  public:
13  a_modbuscontroller->add_on_command_sent_callback(
14  [this](int function_code, int address) { this->trigger(function_code, address); });
15  }
16 };
17 
18 } // namespace modbus_controller
19 } // namespace esphome
ModbusCommandSentTrigger(ModbusController *a_modbuscontroller)
Definition: automation.h:12
void trigger(Ts... x)
Inform the parent automation that the event has triggered.
Definition: automation.h:95
void add_on_command_sent_callback(std::function< void(int, int)> &&callback)
Set callback for commands.
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
uint8_t address
Definition: bl0906.h:211