ESPHome 2026.2.2
Loading...
Searching...
No Matches
api_pb2_service.h
Go to the documentation of this file.
1// This file was automatically generated with a tool.
2// See script/api_protobuf/api_protobuf.py
3#pragma once
4
6
7#include "api_pb2.h"
8
9namespace esphome::api {
10
12 public:
13#ifdef HAS_PROTO_MESSAGE_DUMP
14 protected:
15 void log_send_message_(const char *name, const char *dump);
16 void log_receive_message_(const LogString *name, const ProtoMessage &msg);
17 void log_receive_message_(const LogString *name);
18
19 public:
20#endif
21
22 bool send_message(const ProtoMessage &msg, uint8_t message_type) {
23#ifdef HAS_PROTO_MESSAGE_DUMP
24 DumpBuffer dump_buf;
25 this->log_send_message_(msg.message_name(), msg.dump_to(dump_buf));
26#endif
27 return this->send_message_impl(msg, message_type);
28 }
29
30 virtual void on_hello_request(const HelloRequest &value){};
31
32 virtual void on_disconnect_request(){};
33 virtual void on_disconnect_response(){};
34 virtual void on_ping_request(){};
35 virtual void on_ping_response(){};
36 virtual void on_device_info_request(){};
37
38 virtual void on_list_entities_request(){};
39
41
42#ifdef USE_COVER
43 virtual void on_cover_command_request(const CoverCommandRequest &value){};
44#endif
45
46#ifdef USE_FAN
47 virtual void on_fan_command_request(const FanCommandRequest &value){};
48#endif
49
50#ifdef USE_LIGHT
51 virtual void on_light_command_request(const LightCommandRequest &value){};
52#endif
53
54#ifdef USE_SWITCH
55 virtual void on_switch_command_request(const SwitchCommandRequest &value){};
56#endif
57
58 virtual void on_subscribe_logs_request(const SubscribeLogsRequest &value){};
59
60#ifdef USE_API_NOISE
62#endif
63
64#ifdef USE_API_HOMEASSISTANT_SERVICES
66#endif
67
68#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES
70#endif
71#ifdef USE_API_HOMEASSISTANT_STATES
73#endif
74
75#ifdef USE_API_HOMEASSISTANT_STATES
77#endif
78
79 virtual void on_get_time_response(const GetTimeResponse &value){};
80
81#ifdef USE_API_USER_DEFINED_ACTIONS
83#endif
84
85#ifdef USE_CAMERA
86 virtual void on_camera_image_request(const CameraImageRequest &value){};
87#endif
88
89#ifdef USE_CLIMATE
91#endif
92
93#ifdef USE_WATER_HEATER
95#endif
96
97#ifdef USE_NUMBER
98 virtual void on_number_command_request(const NumberCommandRequest &value){};
99#endif
100
101#ifdef USE_SELECT
103#endif
104
105#ifdef USE_SIREN
106 virtual void on_siren_command_request(const SirenCommandRequest &value){};
107#endif
108
109#ifdef USE_LOCK
110 virtual void on_lock_command_request(const LockCommandRequest &value){};
111#endif
112
113#ifdef USE_BUTTON
115#endif
116
117#ifdef USE_MEDIA_PLAYER
119#endif
120#ifdef USE_BLUETOOTH_PROXY
123#endif
124
125#ifdef USE_BLUETOOTH_PROXY
127#endif
128
129#ifdef USE_BLUETOOTH_PROXY
131#endif
132
133#ifdef USE_BLUETOOTH_PROXY
135#endif
136
137#ifdef USE_BLUETOOTH_PROXY
139#endif
140#ifdef USE_BLUETOOTH_PROXY
142#endif
143#ifdef USE_BLUETOOTH_PROXY
145#endif
146#ifdef USE_BLUETOOTH_PROXY
148#endif
149
150#ifdef USE_BLUETOOTH_PROXY
152#endif
153
154#ifdef USE_BLUETOOTH_PROXY
156#endif
157
158#ifdef USE_BLUETOOTH_PROXY
160#endif
161#ifdef USE_VOICE_ASSISTANT
163#endif
164
165#ifdef USE_VOICE_ASSISTANT
167#endif
168#ifdef USE_VOICE_ASSISTANT
170#endif
171#ifdef USE_VOICE_ASSISTANT
172 virtual void on_voice_assistant_audio(const VoiceAssistantAudio &value){};
173#endif
174#ifdef USE_VOICE_ASSISTANT
176#endif
177#ifdef USE_VOICE_ASSISTANT
179#endif
180
181#ifdef USE_VOICE_ASSISTANT
183#endif
184
185#ifdef USE_VOICE_ASSISTANT
187#endif
188
189#ifdef USE_ALARM_CONTROL_PANEL
191#endif
192
193#ifdef USE_TEXT
194 virtual void on_text_command_request(const TextCommandRequest &value){};
195#endif
196
197#ifdef USE_DATETIME_DATE
198 virtual void on_date_command_request(const DateCommandRequest &value){};
199#endif
200
201#ifdef USE_DATETIME_TIME
202 virtual void on_time_command_request(const TimeCommandRequest &value){};
203#endif
204
205#ifdef USE_VALVE
206 virtual void on_valve_command_request(const ValveCommandRequest &value){};
207#endif
208
209#ifdef USE_DATETIME_DATETIME
211#endif
212
213#ifdef USE_UPDATE
215#endif
216#ifdef USE_ZWAVE_PROXY
217 virtual void on_z_wave_proxy_frame(const ZWaveProxyFrame &value){};
218#endif
219#ifdef USE_ZWAVE_PROXY
220 virtual void on_z_wave_proxy_request(const ZWaveProxyRequest &value){};
221#endif
222
223#ifdef USE_IR_RF
225#endif
226
227 protected:
228 void read_message(uint32_t msg_size, uint32_t msg_type, const uint8_t *msg_data) override;
229};
230
231} // namespace esphome::api
virtual void on_voice_assistant_configuration_request(const VoiceAssistantConfigurationRequest &value)
virtual void on_bluetooth_gatt_get_services_request(const BluetoothGATTGetServicesRequest &value)
virtual void on_alarm_control_panel_command_request(const AlarmControlPanelCommandRequest &value)
virtual void on_siren_command_request(const SirenCommandRequest &value)
virtual void on_hello_request(const HelloRequest &value)
virtual void on_bluetooth_gatt_notify_request(const BluetoothGATTNotifyRequest &value)
virtual void on_bluetooth_device_request(const BluetoothDeviceRequest &value)
virtual void on_home_assistant_state_response(const HomeAssistantStateResponse &value)
virtual void on_get_time_response(const GetTimeResponse &value)
void read_message(uint32_t msg_size, uint32_t msg_type, const uint8_t *msg_data) override
virtual void on_homeassistant_action_response(const HomeassistantActionResponse &value)
virtual void on_voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &value)
virtual void on_bluetooth_gatt_read_descriptor_request(const BluetoothGATTReadDescriptorRequest &value)
virtual void on_noise_encryption_set_key_request(const NoiseEncryptionSetKeyRequest &value)
virtual void on_z_wave_proxy_frame(const ZWaveProxyFrame &value)
bool send_message(const ProtoMessage &msg, uint8_t message_type)
virtual void on_infrared_rf_transmit_raw_timings_request(const InfraredRFTransmitRawTimingsRequest &value)
virtual void on_lock_command_request(const LockCommandRequest &value)
virtual void on_media_player_command_request(const MediaPlayerCommandRequest &value)
virtual void on_water_heater_command_request(const WaterHeaterCommandRequest &value)
virtual void on_bluetooth_gatt_write_request(const BluetoothGATTWriteRequest &value)
virtual void on_valve_command_request(const ValveCommandRequest &value)
virtual void on_bluetooth_gatt_read_request(const BluetoothGATTReadRequest &value)
virtual void on_subscribe_bluetooth_connections_free_request()
virtual void on_cover_command_request(const CoverCommandRequest &value)
virtual void on_subscribe_bluetooth_le_advertisements_request(const SubscribeBluetoothLEAdvertisementsRequest &value)
virtual void on_text_command_request(const TextCommandRequest &value)
virtual void on_select_command_request(const SelectCommandRequest &value)
virtual void on_fan_command_request(const FanCommandRequest &value)
virtual void on_subscribe_homeassistant_services_request()
virtual void on_camera_image_request(const CameraImageRequest &value)
virtual void on_subscribe_logs_request(const SubscribeLogsRequest &value)
virtual void on_unsubscribe_bluetooth_le_advertisements_request()
virtual void on_bluetooth_gatt_write_descriptor_request(const BluetoothGATTWriteDescriptorRequest &value)
virtual void on_voice_assistant_audio(const VoiceAssistantAudio &value)
virtual void on_subscribe_voice_assistant_request(const SubscribeVoiceAssistantRequest &value)
virtual void on_voice_assistant_announce_request(const VoiceAssistantAnnounceRequest &value)
virtual void on_climate_command_request(const ClimateCommandRequest &value)
virtual void on_voice_assistant_response(const VoiceAssistantResponse &value)
virtual void on_light_command_request(const LightCommandRequest &value)
virtual void on_date_time_command_request(const DateTimeCommandRequest &value)
virtual void on_subscribe_home_assistant_states_request()
virtual void on_switch_command_request(const SwitchCommandRequest &value)
virtual void on_voice_assistant_timer_event_response(const VoiceAssistantTimerEventResponse &value)
virtual void on_button_command_request(const ButtonCommandRequest &value)
virtual void on_voice_assistant_event_response(const VoiceAssistantEventResponse &value)
void log_send_message_(const char *name, const char *dump)
virtual void on_z_wave_proxy_request(const ZWaveProxyRequest &value)
virtual void on_number_command_request(const NumberCommandRequest &value)
virtual void on_execute_service_request(const ExecuteServiceRequest &value)
virtual void on_bluetooth_scanner_set_mode_request(const BluetoothScannerSetModeRequest &value)
virtual void on_date_command_request(const DateCommandRequest &value)
void log_receive_message_(const LogString *name, const ProtoMessage &msg)
virtual void on_update_command_request(const UpdateCommandRequest &value)
virtual void on_time_command_request(const TimeCommandRequest &value)
Fixed-size buffer for message dumps - avoids heap allocation.
Definition proto.h:350
virtual const char * message_name() const
Definition proto.h:424
virtual const char * dump_to(DumpBuffer &out) const =0
virtual bool send_message_impl(const ProtoMessage &msg, uint8_t message_type)=0
Send a protobuf message by calculating its size, allocating a buffer, encoding, and sending.