ESPHome  2023.5.5
api_pb2_service.h
Go to the documentation of this file.
1 // This file was automatically generated with a tool.
2 // See scripts/api_protobuf/api_protobuf.py
3 #pragma once
4 
5 #include "api_pb2.h"
6 #include "esphome/core/defines.h"
7 
8 namespace esphome {
9 namespace api {
10 
12  public:
13  virtual void on_hello_request(const HelloRequest &value){};
14  bool send_hello_response(const HelloResponse &msg);
15  virtual void on_connect_request(const ConnectRequest &value){};
16  bool send_connect_response(const ConnectResponse &msg);
18  virtual void on_disconnect_request(const DisconnectRequest &value){};
20  virtual void on_disconnect_response(const DisconnectResponse &value){};
21  bool send_ping_request(const PingRequest &msg);
22  virtual void on_ping_request(const PingRequest &value){};
23  bool send_ping_response(const PingResponse &msg);
24  virtual void on_ping_response(const PingResponse &value){};
25  virtual void on_device_info_request(const DeviceInfoRequest &value){};
27  virtual void on_list_entities_request(const ListEntitiesRequest &value){};
30 #ifdef USE_BINARY_SENSOR
32 #endif
33 #ifdef USE_BINARY_SENSOR
35 #endif
36 #ifdef USE_COVER
38 #endif
39 #ifdef USE_COVER
41 #endif
42 #ifdef USE_COVER
43  virtual void on_cover_command_request(const CoverCommandRequest &value){};
44 #endif
45 #ifdef USE_FAN
47 #endif
48 #ifdef USE_FAN
50 #endif
51 #ifdef USE_FAN
52  virtual void on_fan_command_request(const FanCommandRequest &value){};
53 #endif
54 #ifdef USE_LIGHT
56 #endif
57 #ifdef USE_LIGHT
59 #endif
60 #ifdef USE_LIGHT
61  virtual void on_light_command_request(const LightCommandRequest &value){};
62 #endif
63 #ifdef USE_SENSOR
65 #endif
66 #ifdef USE_SENSOR
68 #endif
69 #ifdef USE_SWITCH
71 #endif
72 #ifdef USE_SWITCH
74 #endif
75 #ifdef USE_SWITCH
76  virtual void on_switch_command_request(const SwitchCommandRequest &value){};
77 #endif
78 #ifdef USE_TEXT_SENSOR
80 #endif
81 #ifdef USE_TEXT_SENSOR
83 #endif
84  virtual void on_subscribe_logs_request(const SubscribeLogsRequest &value){};
91  bool send_get_time_request(const GetTimeRequest &msg);
92  virtual void on_get_time_request(const GetTimeRequest &value){};
93  bool send_get_time_response(const GetTimeResponse &msg);
94  virtual void on_get_time_response(const GetTimeResponse &value){};
96  virtual void on_execute_service_request(const ExecuteServiceRequest &value){};
97 #ifdef USE_ESP32_CAMERA
99 #endif
100 #ifdef USE_ESP32_CAMERA
102 #endif
103 #ifdef USE_ESP32_CAMERA
104  virtual void on_camera_image_request(const CameraImageRequest &value){};
105 #endif
106 #ifdef USE_CLIMATE
108 #endif
109 #ifdef USE_CLIMATE
111 #endif
112 #ifdef USE_CLIMATE
113  virtual void on_climate_command_request(const ClimateCommandRequest &value){};
114 #endif
115 #ifdef USE_NUMBER
117 #endif
118 #ifdef USE_NUMBER
120 #endif
121 #ifdef USE_NUMBER
122  virtual void on_number_command_request(const NumberCommandRequest &value){};
123 #endif
124 #ifdef USE_SELECT
126 #endif
127 #ifdef USE_SELECT
129 #endif
130 #ifdef USE_SELECT
131  virtual void on_select_command_request(const SelectCommandRequest &value){};
132 #endif
133 #ifdef USE_LOCK
135 #endif
136 #ifdef USE_LOCK
138 #endif
139 #ifdef USE_LOCK
140  virtual void on_lock_command_request(const LockCommandRequest &value){};
141 #endif
142 #ifdef USE_BUTTON
144 #endif
145 #ifdef USE_BUTTON
146  virtual void on_button_command_request(const ButtonCommandRequest &value){};
147 #endif
148 #ifdef USE_MEDIA_PLAYER
150 #endif
151 #ifdef USE_MEDIA_PLAYER
153 #endif
154 #ifdef USE_MEDIA_PLAYER
156 #endif
157 #ifdef USE_BLUETOOTH_PROXY
160 #endif
161 #ifdef USE_BLUETOOTH_PROXY
163 #endif
164 #ifdef USE_BLUETOOTH_PROXY
166 #endif
167 #ifdef USE_BLUETOOTH_PROXY
169 #endif
170 #ifdef USE_BLUETOOTH_PROXY
172 #endif
173 #ifdef USE_BLUETOOTH_PROXY
175 #endif
176 #ifdef USE_BLUETOOTH_PROXY
178 #endif
179 #ifdef USE_BLUETOOTH_PROXY
181 #endif
182 #ifdef USE_BLUETOOTH_PROXY
184 #endif
185 #ifdef USE_BLUETOOTH_PROXY
187 #endif
188 #ifdef USE_BLUETOOTH_PROXY
190 #endif
191 #ifdef USE_BLUETOOTH_PROXY
193 #endif
194 #ifdef USE_BLUETOOTH_PROXY
196 #endif
197 #ifdef USE_BLUETOOTH_PROXY
199 #endif
200 #ifdef USE_BLUETOOTH_PROXY
202 #endif
203 #ifdef USE_BLUETOOTH_PROXY
205 #endif
206 #ifdef USE_BLUETOOTH_PROXY
208 #endif
209 #ifdef USE_BLUETOOTH_PROXY
211 #endif
212 #ifdef USE_BLUETOOTH_PROXY
214 #endif
215 #ifdef USE_BLUETOOTH_PROXY
217 #endif
218 #ifdef USE_BLUETOOTH_PROXY
220 #endif
221 #ifdef USE_BLUETOOTH_PROXY
224 #endif
225 #ifdef USE_BLUETOOTH_PROXY
227 #endif
228 #ifdef USE_VOICE_ASSISTANT
230 #endif
231 #ifdef USE_VOICE_ASSISTANT
233 #endif
234 #ifdef USE_VOICE_ASSISTANT
236 #endif
237 #ifdef USE_VOICE_ASSISTANT
239 #endif
240  protected:
241  bool read_message(uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) override;
242 };
243 
245  public:
246  virtual HelloResponse hello(const HelloRequest &msg) = 0;
247  virtual ConnectResponse connect(const ConnectRequest &msg) = 0;
248  virtual DisconnectResponse disconnect(const DisconnectRequest &msg) = 0;
249  virtual PingResponse ping(const PingRequest &msg) = 0;
250  virtual DeviceInfoResponse device_info(const DeviceInfoRequest &msg) = 0;
251  virtual void list_entities(const ListEntitiesRequest &msg) = 0;
252  virtual void subscribe_states(const SubscribeStatesRequest &msg) = 0;
253  virtual void subscribe_logs(const SubscribeLogsRequest &msg) = 0;
254  virtual void subscribe_homeassistant_services(const SubscribeHomeassistantServicesRequest &msg) = 0;
255  virtual void subscribe_home_assistant_states(const SubscribeHomeAssistantStatesRequest &msg) = 0;
256  virtual GetTimeResponse get_time(const GetTimeRequest &msg) = 0;
257  virtual void execute_service(const ExecuteServiceRequest &msg) = 0;
258 #ifdef USE_COVER
259  virtual void cover_command(const CoverCommandRequest &msg) = 0;
260 #endif
261 #ifdef USE_FAN
262  virtual void fan_command(const FanCommandRequest &msg) = 0;
263 #endif
264 #ifdef USE_LIGHT
265  virtual void light_command(const LightCommandRequest &msg) = 0;
266 #endif
267 #ifdef USE_SWITCH
268  virtual void switch_command(const SwitchCommandRequest &msg) = 0;
269 #endif
270 #ifdef USE_ESP32_CAMERA
271  virtual void camera_image(const CameraImageRequest &msg) = 0;
272 #endif
273 #ifdef USE_CLIMATE
274  virtual void climate_command(const ClimateCommandRequest &msg) = 0;
275 #endif
276 #ifdef USE_NUMBER
277  virtual void number_command(const NumberCommandRequest &msg) = 0;
278 #endif
279 #ifdef USE_SELECT
280  virtual void select_command(const SelectCommandRequest &msg) = 0;
281 #endif
282 #ifdef USE_BUTTON
283  virtual void button_command(const ButtonCommandRequest &msg) = 0;
284 #endif
285 #ifdef USE_LOCK
286  virtual void lock_command(const LockCommandRequest &msg) = 0;
287 #endif
288 #ifdef USE_MEDIA_PLAYER
289  virtual void media_player_command(const MediaPlayerCommandRequest &msg) = 0;
290 #endif
291 #ifdef USE_BLUETOOTH_PROXY
292  virtual void subscribe_bluetooth_le_advertisements(const SubscribeBluetoothLEAdvertisementsRequest &msg) = 0;
293 #endif
294 #ifdef USE_BLUETOOTH_PROXY
295  virtual void bluetooth_device_request(const BluetoothDeviceRequest &msg) = 0;
296 #endif
297 #ifdef USE_BLUETOOTH_PROXY
298  virtual void bluetooth_gatt_get_services(const BluetoothGATTGetServicesRequest &msg) = 0;
299 #endif
300 #ifdef USE_BLUETOOTH_PROXY
301  virtual void bluetooth_gatt_read(const BluetoothGATTReadRequest &msg) = 0;
302 #endif
303 #ifdef USE_BLUETOOTH_PROXY
304  virtual void bluetooth_gatt_write(const BluetoothGATTWriteRequest &msg) = 0;
305 #endif
306 #ifdef USE_BLUETOOTH_PROXY
307  virtual void bluetooth_gatt_read_descriptor(const BluetoothGATTReadDescriptorRequest &msg) = 0;
308 #endif
309 #ifdef USE_BLUETOOTH_PROXY
310  virtual void bluetooth_gatt_write_descriptor(const BluetoothGATTWriteDescriptorRequest &msg) = 0;
311 #endif
312 #ifdef USE_BLUETOOTH_PROXY
313  virtual void bluetooth_gatt_notify(const BluetoothGATTNotifyRequest &msg) = 0;
314 #endif
315 #ifdef USE_BLUETOOTH_PROXY
316  virtual BluetoothConnectionsFreeResponse subscribe_bluetooth_connections_free(
318 #endif
319 #ifdef USE_BLUETOOTH_PROXY
320  virtual void unsubscribe_bluetooth_le_advertisements(const UnsubscribeBluetoothLEAdvertisementsRequest &msg) = 0;
321 #endif
322 #ifdef USE_VOICE_ASSISTANT
323  virtual void subscribe_voice_assistant(const SubscribeVoiceAssistantRequest &msg) = 0;
324 #endif
325  protected:
326  void on_hello_request(const HelloRequest &msg) override;
327  void on_connect_request(const ConnectRequest &msg) override;
328  void on_disconnect_request(const DisconnectRequest &msg) override;
329  void on_ping_request(const PingRequest &msg) override;
330  void on_device_info_request(const DeviceInfoRequest &msg) override;
331  void on_list_entities_request(const ListEntitiesRequest &msg) override;
332  void on_subscribe_states_request(const SubscribeStatesRequest &msg) override;
333  void on_subscribe_logs_request(const SubscribeLogsRequest &msg) override;
336  void on_get_time_request(const GetTimeRequest &msg) override;
337  void on_execute_service_request(const ExecuteServiceRequest &msg) override;
338 #ifdef USE_COVER
339  void on_cover_command_request(const CoverCommandRequest &msg) override;
340 #endif
341 #ifdef USE_FAN
342  void on_fan_command_request(const FanCommandRequest &msg) override;
343 #endif
344 #ifdef USE_LIGHT
345  void on_light_command_request(const LightCommandRequest &msg) override;
346 #endif
347 #ifdef USE_SWITCH
348  void on_switch_command_request(const SwitchCommandRequest &msg) override;
349 #endif
350 #ifdef USE_ESP32_CAMERA
351  void on_camera_image_request(const CameraImageRequest &msg) override;
352 #endif
353 #ifdef USE_CLIMATE
354  void on_climate_command_request(const ClimateCommandRequest &msg) override;
355 #endif
356 #ifdef USE_NUMBER
357  void on_number_command_request(const NumberCommandRequest &msg) override;
358 #endif
359 #ifdef USE_SELECT
360  void on_select_command_request(const SelectCommandRequest &msg) override;
361 #endif
362 #ifdef USE_BUTTON
363  void on_button_command_request(const ButtonCommandRequest &msg) override;
364 #endif
365 #ifdef USE_LOCK
366  void on_lock_command_request(const LockCommandRequest &msg) override;
367 #endif
368 #ifdef USE_MEDIA_PLAYER
370 #endif
371 #ifdef USE_BLUETOOTH_PROXY
373 #endif
374 #ifdef USE_BLUETOOTH_PROXY
375  void on_bluetooth_device_request(const BluetoothDeviceRequest &msg) override;
376 #endif
377 #ifdef USE_BLUETOOTH_PROXY
379 #endif
380 #ifdef USE_BLUETOOTH_PROXY
382 #endif
383 #ifdef USE_BLUETOOTH_PROXY
385 #endif
386 #ifdef USE_BLUETOOTH_PROXY
388 #endif
389 #ifdef USE_BLUETOOTH_PROXY
391 #endif
392 #ifdef USE_BLUETOOTH_PROXY
394 #endif
395 #ifdef USE_BLUETOOTH_PROXY
397 #endif
398 #ifdef USE_BLUETOOTH_PROXY
400  const UnsubscribeBluetoothLEAdvertisementsRequest &msg) override;
401 #endif
402 #ifdef USE_VOICE_ASSISTANT
404 #endif
405 };
406 
407 } // namespace api
408 } // namespace esphome
bool send_list_entities_binary_sensor_response(const ListEntitiesBinarySensorResponse &msg)
virtual void on_climate_command_request(const ClimateCommandRequest &value)
virtual void on_subscribe_home_assistant_states_request(const SubscribeHomeAssistantStatesRequest &value)
bool send_fan_state_response(const FanStateResponse &msg)
bool send_ping_response(const PingResponse &msg)
virtual void on_subscribe_homeassistant_services_request(const SubscribeHomeassistantServicesRequest &value)
bool send_bluetooth_gatt_read_response(const BluetoothGATTReadResponse &msg)
virtual void on_hello_request(const HelloRequest &value)
bool send_get_time_response(const GetTimeResponse &msg)
bool send_ping_request(const PingRequest &msg)
virtual void on_unsubscribe_bluetooth_le_advertisements_request(const UnsubscribeBluetoothLEAdvertisementsRequest &value)
virtual void on_bluetooth_device_request(const BluetoothDeviceRequest &value)
bool send_bluetooth_gatt_notify_data_response(const BluetoothGATTNotifyDataResponse &msg)
virtual void on_voice_assistant_response(const VoiceAssistantResponse &value)
virtual void on_ping_response(const PingResponse &value)
virtual void on_light_command_request(const LightCommandRequest &value)
bool send_subscribe_logs_response(const SubscribeLogsResponse &msg)
bool send_climate_state_response(const ClimateStateResponse &msg)
bool send_binary_sensor_state_response(const BinarySensorStateResponse &msg)
bool send_bluetooth_gatt_error_response(const BluetoothGATTErrorResponse &msg)
bool send_list_entities_fan_response(const ListEntitiesFanResponse &msg)
bool send_number_state_response(const NumberStateResponse &msg)
virtual void on_home_assistant_state_response(const HomeAssistantStateResponse &value)
bool send_list_entities_select_response(const ListEntitiesSelectResponse &msg)
bool send_homeassistant_service_response(const HomeassistantServiceResponse &msg)
bool send_bluetooth_gatt_write_response(const BluetoothGATTWriteResponse &msg)
virtual void on_bluetooth_gatt_write_request(const BluetoothGATTWriteRequest &value)
bool send_bluetooth_device_connection_response(const BluetoothDeviceConnectionResponse &msg)
virtual void on_connect_request(const ConnectRequest &value)
bool send_list_entities_done_response(const ListEntitiesDoneResponse &msg)
bool send_device_info_response(const DeviceInfoResponse &msg)
virtual void on_subscribe_voice_assistant_request(const SubscribeVoiceAssistantRequest &value)
bool send_connect_response(const ConnectResponse &msg)
virtual void on_subscribe_bluetooth_le_advertisements_request(const SubscribeBluetoothLEAdvertisementsRequest &value)
virtual void on_list_entities_request(const ListEntitiesRequest &value)
virtual void on_disconnect_request(const DisconnectRequest &value)
virtual void on_select_command_request(const SelectCommandRequest &value)
virtual void on_disconnect_response(const DisconnectResponse &value)
virtual void on_bluetooth_gatt_get_services_request(const BluetoothGATTGetServicesRequest &value)
bool send_bluetooth_le_advertisement_response(const BluetoothLEAdvertisementResponse &msg)
virtual void on_camera_image_request(const CameraImageRequest &value)
bool send_list_entities_services_response(const ListEntitiesServicesResponse &msg)
virtual void on_lock_command_request(const LockCommandRequest &value)
bool send_bluetooth_gatt_get_services_response(const BluetoothGATTGetServicesResponse &msg)
virtual void on_media_player_command_request(const MediaPlayerCommandRequest &value)
bool send_list_entities_text_sensor_response(const ListEntitiesTextSensorResponse &msg)
virtual void on_subscribe_bluetooth_connections_free_request(const SubscribeBluetoothConnectionsFreeRequest &value)
bool send_bluetooth_device_unpairing_response(const BluetoothDeviceUnpairingResponse &msg)
bool send_list_entities_light_response(const ListEntitiesLightResponse &msg)
virtual void on_cover_command_request(const CoverCommandRequest &value)
bool send_text_sensor_state_response(const TextSensorStateResponse &msg)
virtual void on_voice_assistant_event_response(const VoiceAssistantEventResponse &value)
bool send_bluetooth_gatt_notify_response(const BluetoothGATTNotifyResponse &msg)
bool send_list_entities_cover_response(const ListEntitiesCoverResponse &msg)
bool send_disconnect_request(const DisconnectRequest &msg)
bool send_list_entities_camera_response(const ListEntitiesCameraResponse &msg)
bool send_list_entities_button_response(const ListEntitiesButtonResponse &msg)
bool send_list_entities_media_player_response(const ListEntitiesMediaPlayerResponse &msg)
bool send_voice_assistant_request(const VoiceAssistantRequest &msg)
virtual void on_execute_service_request(const ExecuteServiceRequest &value)
bool send_list_entities_number_response(const ListEntitiesNumberResponse &msg)
bool send_switch_state_response(const SwitchStateResponse &msg)
bool read_message(uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) override
bool send_camera_image_response(const CameraImageResponse &msg)
bool send_list_entities_lock_response(const ListEntitiesLockResponse &msg)
bool send_list_entities_sensor_response(const ListEntitiesSensorResponse &msg)
virtual void on_subscribe_states_request(const SubscribeStatesRequest &value)
bool send_select_state_response(const SelectStateResponse &msg)
bool send_bluetooth_connections_free_response(const BluetoothConnectionsFreeResponse &msg)
virtual void on_bluetooth_gatt_read_descriptor_request(const BluetoothGATTReadDescriptorRequest &value)
virtual void on_bluetooth_gatt_write_descriptor_request(const BluetoothGATTWriteDescriptorRequest &value)
bool send_light_state_response(const LightStateResponse &msg)
virtual void on_bluetooth_gatt_notify_request(const BluetoothGATTNotifyRequest &value)
virtual void on_number_command_request(const NumberCommandRequest &value)
bool send_media_player_state_response(const MediaPlayerStateResponse &msg)
bool send_subscribe_home_assistant_state_response(const SubscribeHomeAssistantStateResponse &msg)
bool send_get_time_request(const GetTimeRequest &msg)
bool send_list_entities_switch_response(const ListEntitiesSwitchResponse &msg)
virtual void on_get_time_request(const GetTimeRequest &value)
virtual void on_fan_command_request(const FanCommandRequest &value)
Definition: a4988.cpp:4
bool send_sensor_state_response(const SensorStateResponse &msg)
bool send_cover_state_response(const CoverStateResponse &msg)
bool send_hello_response(const HelloResponse &msg)
bool send_list_entities_climate_response(const ListEntitiesClimateResponse &msg)
bool send_disconnect_response(const DisconnectResponse &msg)
bool send_bluetooth_device_pairing_response(const BluetoothDevicePairingResponse &msg)
bool send_bluetooth_gatt_get_services_done_response(const BluetoothGATTGetServicesDoneResponse &msg)
virtual void on_button_command_request(const ButtonCommandRequest &value)
bool send_lock_state_response(const LockStateResponse &msg)
bool send_bluetooth_device_clear_cache_response(const BluetoothDeviceClearCacheResponse &msg)
virtual void on_device_info_request(const DeviceInfoRequest &value)
virtual void on_switch_command_request(const SwitchCommandRequest &value)
virtual void on_get_time_response(const GetTimeResponse &value)
virtual void on_bluetooth_gatt_read_request(const BluetoothGATTReadRequest &value)
virtual void on_ping_request(const PingRequest &value)
virtual void on_subscribe_logs_request(const SubscribeLogsRequest &value)