ESPHome 2025.5.0
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace modbus_controller {
9
10class 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
18class ModbusOnlineTrigger : public Trigger<int, int> {
19 public:
21 a_modbuscontroller->add_on_online_callback(
22 [this](int function_code, int address) { this->trigger(function_code, address); });
23 }
24};
25
26class ModbusOfflineTrigger : public Trigger<int, int> {
27 public:
29 a_modbuscontroller->add_on_offline_callback(
30 [this](int function_code, int address) { this->trigger(function_code, address); });
31 }
32};
33
34} // namespace modbus_controller
35} // namespace esphome
uint8_t address
Definition bl0906.h:4
ModbusCommandSentTrigger(ModbusController *a_modbuscontroller)
Definition automation.h:12
void add_on_online_callback(std::function< void(int, int)> &&callback)
Set callback for online changes.
void add_on_offline_callback(std::function< void(int, int)> &&callback)
Set callback for offline changes.
void add_on_command_sent_callback(std::function< void(int, int)> &&callback)
Set callback for commands.
ModbusOfflineTrigger(ModbusController *a_modbuscontroller)
Definition automation.h:28
ModbusOnlineTrigger(ModbusController *a_modbuscontroller)
Definition automation.h:20
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7