mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-20 21:13:28 +02:00
0a7d883633
Co-authored-by: Leo Schelvis <leo.schelvis@gmail.com>
20 lines
555 B
C++
20 lines
555 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/core/automation.h"
|
|
#include "esphome/components/modbus_controller/modbus_controller.h"
|
|
|
|
namespace esphome {
|
|
namespace modbus_controller {
|
|
|
|
class ModbusCommandSentTrigger : public Trigger<int, int> {
|
|
public:
|
|
ModbusCommandSentTrigger(ModbusController *a_modbuscontroller) {
|
|
a_modbuscontroller->add_on_command_sent_callback(
|
|
[this](int function_code, int address) { this->trigger(function_code, address); });
|
|
}
|
|
};
|
|
|
|
} // namespace modbus_controller
|
|
} // namespace esphome
|