ESPHome
2024.10.2
esphome
esphome
components
modbus_controller
automation.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/core/automation.h
"
5
#include "
esphome/components/modbus_controller/modbus_controller.h
"
6
7
namespace
esphome
{
8
namespace
modbus_controller {
9
10
class
ModbusCommandSentTrigger
:
public
Trigger
<int, int> {
11
public
:
12
ModbusCommandSentTrigger
(
ModbusController
*a_modbuscontroller) {
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
automation.h
modbus_controller.h
esphome::modbus_controller::ModbusCommandSentTrigger::ModbusCommandSentTrigger
ModbusCommandSentTrigger(ModbusController *a_modbuscontroller)
Definition:
automation.h:12
esphome::Trigger< int, int >::trigger
void trigger(Ts... x)
Inform the parent automation that the event has triggered.
Definition:
automation.h:95
esphome::modbus_controller::ModbusController
Modbus controller class.
Definition:
modbus_controller.h:430
esphome::modbus_controller::ModbusController::add_on_command_sent_callback
void add_on_command_sent_callback(std::function< void(int, int)> &&callback)
Set callback for commands.
Definition:
modbus_controller.cpp:669
esphome::modbus_controller::ModbusCommandSentTrigger
Definition:
automation.h:10
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
esphome::Trigger
Definition:
automation.h:92
component.h
address
uint8_t address
Definition:
bl0906.h:211
Generated by
1.8.13