ESPHome  2022.11.3
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
159 #ifdef USE_BLUETOOTH_PROXY
161 #endif
162 #ifdef USE_BLUETOOTH_PROXY
164 #endif
165 #ifdef USE_BLUETOOTH_PROXY
167 #endif
168 #ifdef USE_BLUETOOTH_PROXY
170 #endif
171 #ifdef USE_BLUETOOTH_PROXY
173 #endif
174 #ifdef USE_BLUETOOTH_PROXY
176 #endif
177 #ifdef USE_BLUETOOTH_PROXY
179 #endif
180 #ifdef USE_BLUETOOTH_PROXY
182 #endif
183 #ifdef USE_BLUETOOTH_PROXY
185 #endif
186 #ifdef USE_BLUETOOTH_PROXY
188 #endif
189 #ifdef USE_BLUETOOTH_PROXY
191 #endif
192 #ifdef USE_BLUETOOTH_PROXY
194 #endif
195 #ifdef USE_BLUETOOTH_PROXY
197 #endif
198 #ifdef USE_BLUETOOTH_PROXY
200 #endif
201 #ifdef USE_BLUETOOTH_PROXY
203 #endif
204 #ifdef USE_BLUETOOTH_PROXY
206 #endif
207 #ifdef USE_BLUETOOTH_PROXY
209 #endif
210 #ifdef USE_BLUETOOTH_PROXY
212 #endif
213  protected:
214  bool read_message(uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) override;
215 };
216 
218  public:
219  virtual HelloResponse hello(const HelloRequest &msg) = 0;
220  virtual ConnectResponse connect(const ConnectRequest &msg) = 0;
221  virtual DisconnectResponse disconnect(const DisconnectRequest &msg) = 0;
222  virtual PingResponse ping(const PingRequest &msg) = 0;
223  virtual DeviceInfoResponse device_info(const DeviceInfoRequest &msg) = 0;
224  virtual void list_entities(const ListEntitiesRequest &msg) = 0;
225  virtual void subscribe_states(const SubscribeStatesRequest &msg) = 0;
226  virtual void subscribe_logs(const SubscribeLogsRequest &msg) = 0;
227  virtual void subscribe_homeassistant_services(const SubscribeHomeassistantServicesRequest &msg) = 0;
228  virtual void subscribe_home_assistant_states(const SubscribeHomeAssistantStatesRequest &msg) = 0;
229  virtual GetTimeResponse get_time(const GetTimeRequest &msg) = 0;
230  virtual void execute_service(const ExecuteServiceRequest &msg) = 0;
231 #ifdef USE_COVER
232  virtual void cover_command(const CoverCommandRequest &msg) = 0;
233 #endif
234 #ifdef USE_FAN
235  virtual void fan_command(const FanCommandRequest &msg) = 0;
236 #endif
237 #ifdef USE_LIGHT
238  virtual void light_command(const LightCommandRequest &msg) = 0;
239 #endif
240 #ifdef USE_SWITCH
241  virtual void switch_command(const SwitchCommandRequest &msg) = 0;
242 #endif
243 #ifdef USE_ESP32_CAMERA
244  virtual void camera_image(const CameraImageRequest &msg) = 0;
245 #endif
246 #ifdef USE_CLIMATE
247  virtual void climate_command(const ClimateCommandRequest &msg) = 0;
248 #endif
249 #ifdef USE_NUMBER
250  virtual void number_command(const NumberCommandRequest &msg) = 0;
251 #endif
252 #ifdef USE_SELECT
253  virtual void select_command(const SelectCommandRequest &msg) = 0;
254 #endif
255 #ifdef USE_BUTTON
256  virtual void button_command(const ButtonCommandRequest &msg) = 0;
257 #endif
258 #ifdef USE_LOCK
259  virtual void lock_command(const LockCommandRequest &msg) = 0;
260 #endif
261 #ifdef USE_MEDIA_PLAYER
262  virtual void media_player_command(const MediaPlayerCommandRequest &msg) = 0;
263 #endif
264  virtual void subscribe_bluetooth_le_advertisements(const SubscribeBluetoothLEAdvertisementsRequest &msg) = 0;
265 #ifdef USE_BLUETOOTH_PROXY
266  virtual void bluetooth_device_request(const BluetoothDeviceRequest &msg) = 0;
267 #endif
268 #ifdef USE_BLUETOOTH_PROXY
269  virtual void bluetooth_gatt_get_services(const BluetoothGATTGetServicesRequest &msg) = 0;
270 #endif
271 #ifdef USE_BLUETOOTH_PROXY
272  virtual void bluetooth_gatt_read(const BluetoothGATTReadRequest &msg) = 0;
273 #endif
274 #ifdef USE_BLUETOOTH_PROXY
275  virtual void bluetooth_gatt_write(const BluetoothGATTWriteRequest &msg) = 0;
276 #endif
277 #ifdef USE_BLUETOOTH_PROXY
278  virtual void bluetooth_gatt_read_descriptor(const BluetoothGATTReadDescriptorRequest &msg) = 0;
279 #endif
280 #ifdef USE_BLUETOOTH_PROXY
281  virtual void bluetooth_gatt_write_descriptor(const BluetoothGATTWriteDescriptorRequest &msg) = 0;
282 #endif
283 #ifdef USE_BLUETOOTH_PROXY
284  virtual void bluetooth_gatt_notify(const BluetoothGATTNotifyRequest &msg) = 0;
285 #endif
286 #ifdef USE_BLUETOOTH_PROXY
287  virtual BluetoothConnectionsFreeResponse subscribe_bluetooth_connections_free(
289 #endif
290  protected:
291  void on_hello_request(const HelloRequest &msg) override;
292  void on_connect_request(const ConnectRequest &msg) override;
293  void on_disconnect_request(const DisconnectRequest &msg) override;
294  void on_ping_request(const PingRequest &msg) override;
295  void on_device_info_request(const DeviceInfoRequest &msg) override;
296  void on_list_entities_request(const ListEntitiesRequest &msg) override;
297  void on_subscribe_states_request(const SubscribeStatesRequest &msg) override;
298  void on_subscribe_logs_request(const SubscribeLogsRequest &msg) override;
301  void on_get_time_request(const GetTimeRequest &msg) override;
302  void on_execute_service_request(const ExecuteServiceRequest &msg) override;
303 #ifdef USE_COVER
304  void on_cover_command_request(const CoverCommandRequest &msg) override;
305 #endif
306 #ifdef USE_FAN
307  void on_fan_command_request(const FanCommandRequest &msg) override;
308 #endif
309 #ifdef USE_LIGHT
310  void on_light_command_request(const LightCommandRequest &msg) override;
311 #endif
312 #ifdef USE_SWITCH
313  void on_switch_command_request(const SwitchCommandRequest &msg) override;
314 #endif
315 #ifdef USE_ESP32_CAMERA
316  void on_camera_image_request(const CameraImageRequest &msg) override;
317 #endif
318 #ifdef USE_CLIMATE
319  void on_climate_command_request(const ClimateCommandRequest &msg) override;
320 #endif
321 #ifdef USE_NUMBER
322  void on_number_command_request(const NumberCommandRequest &msg) override;
323 #endif
324 #ifdef USE_SELECT
325  void on_select_command_request(const SelectCommandRequest &msg) override;
326 #endif
327 #ifdef USE_BUTTON
328  void on_button_command_request(const ButtonCommandRequest &msg) override;
329 #endif
330 #ifdef USE_LOCK
331  void on_lock_command_request(const LockCommandRequest &msg) override;
332 #endif
333 #ifdef USE_MEDIA_PLAYER
335 #endif
337 #ifdef USE_BLUETOOTH_PROXY
338  void on_bluetooth_device_request(const BluetoothDeviceRequest &msg) override;
339 #endif
340 #ifdef USE_BLUETOOTH_PROXY
342 #endif
343 #ifdef USE_BLUETOOTH_PROXY
345 #endif
346 #ifdef USE_BLUETOOTH_PROXY
348 #endif
349 #ifdef USE_BLUETOOTH_PROXY
351 #endif
352 #ifdef USE_BLUETOOTH_PROXY
354 #endif
355 #ifdef USE_BLUETOOTH_PROXY
357 #endif
358 #ifdef USE_BLUETOOTH_PROXY
360 #endif
361 };
362 
363 } // namespace api
364 } // 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_bluetooth_device_request(const BluetoothDeviceRequest &value)
bool send_bluetooth_gatt_notify_data_response(const BluetoothGATTNotifyDataResponse &msg)
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)
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_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)
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)
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_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)
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)