ESPHome  2024.7.1
api_pb2_service.cpp
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 #include "api_pb2_service.h"
4 #include "esphome/core/log.h"
5 
6 namespace esphome {
7 namespace api {
8 
9 static const char *const TAG = "api.service";
10 
12 #ifdef HAS_PROTO_MESSAGE_DUMP
13  ESP_LOGVV(TAG, "send_hello_response: %s", msg.dump().c_str());
14 #endif
15  return this->send_message_<HelloResponse>(msg, 2);
16 }
18 #ifdef HAS_PROTO_MESSAGE_DUMP
19  ESP_LOGVV(TAG, "send_connect_response: %s", msg.dump().c_str());
20 #endif
21  return this->send_message_<ConnectResponse>(msg, 4);
22 }
24 #ifdef HAS_PROTO_MESSAGE_DUMP
25  ESP_LOGVV(TAG, "send_disconnect_request: %s", msg.dump().c_str());
26 #endif
27  return this->send_message_<DisconnectRequest>(msg, 5);
28 }
30 #ifdef HAS_PROTO_MESSAGE_DUMP
31  ESP_LOGVV(TAG, "send_disconnect_response: %s", msg.dump().c_str());
32 #endif
33  return this->send_message_<DisconnectResponse>(msg, 6);
34 }
36 #ifdef HAS_PROTO_MESSAGE_DUMP
37  ESP_LOGVV(TAG, "send_ping_request: %s", msg.dump().c_str());
38 #endif
39  return this->send_message_<PingRequest>(msg, 7);
40 }
42 #ifdef HAS_PROTO_MESSAGE_DUMP
43  ESP_LOGVV(TAG, "send_ping_response: %s", msg.dump().c_str());
44 #endif
45  return this->send_message_<PingResponse>(msg, 8);
46 }
48 #ifdef HAS_PROTO_MESSAGE_DUMP
49  ESP_LOGVV(TAG, "send_device_info_response: %s", msg.dump().c_str());
50 #endif
51  return this->send_message_<DeviceInfoResponse>(msg, 10);
52 }
54 #ifdef HAS_PROTO_MESSAGE_DUMP
55  ESP_LOGVV(TAG, "send_list_entities_done_response: %s", msg.dump().c_str());
56 #endif
57  return this->send_message_<ListEntitiesDoneResponse>(msg, 19);
58 }
59 #ifdef USE_BINARY_SENSOR
61 #ifdef HAS_PROTO_MESSAGE_DUMP
62  ESP_LOGVV(TAG, "send_list_entities_binary_sensor_response: %s", msg.dump().c_str());
63 #endif
64  return this->send_message_<ListEntitiesBinarySensorResponse>(msg, 12);
65 }
66 #endif
67 #ifdef USE_BINARY_SENSOR
69 #ifdef HAS_PROTO_MESSAGE_DUMP
70  ESP_LOGVV(TAG, "send_binary_sensor_state_response: %s", msg.dump().c_str());
71 #endif
72  return this->send_message_<BinarySensorStateResponse>(msg, 21);
73 }
74 #endif
75 #ifdef USE_COVER
77 #ifdef HAS_PROTO_MESSAGE_DUMP
78  ESP_LOGVV(TAG, "send_list_entities_cover_response: %s", msg.dump().c_str());
79 #endif
80  return this->send_message_<ListEntitiesCoverResponse>(msg, 13);
81 }
82 #endif
83 #ifdef USE_COVER
85 #ifdef HAS_PROTO_MESSAGE_DUMP
86  ESP_LOGVV(TAG, "send_cover_state_response: %s", msg.dump().c_str());
87 #endif
88  return this->send_message_<CoverStateResponse>(msg, 22);
89 }
90 #endif
91 #ifdef USE_COVER
92 #endif
93 #ifdef USE_FAN
95 #ifdef HAS_PROTO_MESSAGE_DUMP
96  ESP_LOGVV(TAG, "send_list_entities_fan_response: %s", msg.dump().c_str());
97 #endif
98  return this->send_message_<ListEntitiesFanResponse>(msg, 14);
99 }
100 #endif
101 #ifdef USE_FAN
103 #ifdef HAS_PROTO_MESSAGE_DUMP
104  ESP_LOGVV(TAG, "send_fan_state_response: %s", msg.dump().c_str());
105 #endif
106  return this->send_message_<FanStateResponse>(msg, 23);
107 }
108 #endif
109 #ifdef USE_FAN
110 #endif
111 #ifdef USE_LIGHT
113 #ifdef HAS_PROTO_MESSAGE_DUMP
114  ESP_LOGVV(TAG, "send_list_entities_light_response: %s", msg.dump().c_str());
115 #endif
116  return this->send_message_<ListEntitiesLightResponse>(msg, 15);
117 }
118 #endif
119 #ifdef USE_LIGHT
121 #ifdef HAS_PROTO_MESSAGE_DUMP
122  ESP_LOGVV(TAG, "send_light_state_response: %s", msg.dump().c_str());
123 #endif
124  return this->send_message_<LightStateResponse>(msg, 24);
125 }
126 #endif
127 #ifdef USE_LIGHT
128 #endif
129 #ifdef USE_SENSOR
131 #ifdef HAS_PROTO_MESSAGE_DUMP
132  ESP_LOGVV(TAG, "send_list_entities_sensor_response: %s", msg.dump().c_str());
133 #endif
134  return this->send_message_<ListEntitiesSensorResponse>(msg, 16);
135 }
136 #endif
137 #ifdef USE_SENSOR
139 #ifdef HAS_PROTO_MESSAGE_DUMP
140  ESP_LOGVV(TAG, "send_sensor_state_response: %s", msg.dump().c_str());
141 #endif
142  return this->send_message_<SensorStateResponse>(msg, 25);
143 }
144 #endif
145 #ifdef USE_SWITCH
147 #ifdef HAS_PROTO_MESSAGE_DUMP
148  ESP_LOGVV(TAG, "send_list_entities_switch_response: %s", msg.dump().c_str());
149 #endif
150  return this->send_message_<ListEntitiesSwitchResponse>(msg, 17);
151 }
152 #endif
153 #ifdef USE_SWITCH
155 #ifdef HAS_PROTO_MESSAGE_DUMP
156  ESP_LOGVV(TAG, "send_switch_state_response: %s", msg.dump().c_str());
157 #endif
158  return this->send_message_<SwitchStateResponse>(msg, 26);
159 }
160 #endif
161 #ifdef USE_SWITCH
162 #endif
163 #ifdef USE_TEXT_SENSOR
165 #ifdef HAS_PROTO_MESSAGE_DUMP
166  ESP_LOGVV(TAG, "send_list_entities_text_sensor_response: %s", msg.dump().c_str());
167 #endif
168  return this->send_message_<ListEntitiesTextSensorResponse>(msg, 18);
169 }
170 #endif
171 #ifdef USE_TEXT_SENSOR
173 #ifdef HAS_PROTO_MESSAGE_DUMP
174  ESP_LOGVV(TAG, "send_text_sensor_state_response: %s", msg.dump().c_str());
175 #endif
176  return this->send_message_<TextSensorStateResponse>(msg, 27);
177 }
178 #endif
180  return this->send_message_<SubscribeLogsResponse>(msg, 29);
181 }
183 #ifdef HAS_PROTO_MESSAGE_DUMP
184  ESP_LOGVV(TAG, "send_homeassistant_service_response: %s", msg.dump().c_str());
185 #endif
186  return this->send_message_<HomeassistantServiceResponse>(msg, 35);
187 }
190 #ifdef HAS_PROTO_MESSAGE_DUMP
191  ESP_LOGVV(TAG, "send_subscribe_home_assistant_state_response: %s", msg.dump().c_str());
192 #endif
193  return this->send_message_<SubscribeHomeAssistantStateResponse>(msg, 39);
194 }
196 #ifdef HAS_PROTO_MESSAGE_DUMP
197  ESP_LOGVV(TAG, "send_get_time_request: %s", msg.dump().c_str());
198 #endif
199  return this->send_message_<GetTimeRequest>(msg, 36);
200 }
202 #ifdef HAS_PROTO_MESSAGE_DUMP
203  ESP_LOGVV(TAG, "send_get_time_response: %s", msg.dump().c_str());
204 #endif
205  return this->send_message_<GetTimeResponse>(msg, 37);
206 }
208 #ifdef HAS_PROTO_MESSAGE_DUMP
209  ESP_LOGVV(TAG, "send_list_entities_services_response: %s", msg.dump().c_str());
210 #endif
211  return this->send_message_<ListEntitiesServicesResponse>(msg, 41);
212 }
213 #ifdef USE_ESP32_CAMERA
215 #ifdef HAS_PROTO_MESSAGE_DUMP
216  ESP_LOGVV(TAG, "send_list_entities_camera_response: %s", msg.dump().c_str());
217 #endif
218  return this->send_message_<ListEntitiesCameraResponse>(msg, 43);
219 }
220 #endif
221 #ifdef USE_ESP32_CAMERA
223 #ifdef HAS_PROTO_MESSAGE_DUMP
224  ESP_LOGVV(TAG, "send_camera_image_response: %s", msg.dump().c_str());
225 #endif
226  return this->send_message_<CameraImageResponse>(msg, 44);
227 }
228 #endif
229 #ifdef USE_ESP32_CAMERA
230 #endif
231 #ifdef USE_CLIMATE
233 #ifdef HAS_PROTO_MESSAGE_DUMP
234  ESP_LOGVV(TAG, "send_list_entities_climate_response: %s", msg.dump().c_str());
235 #endif
236  return this->send_message_<ListEntitiesClimateResponse>(msg, 46);
237 }
238 #endif
239 #ifdef USE_CLIMATE
241 #ifdef HAS_PROTO_MESSAGE_DUMP
242  ESP_LOGVV(TAG, "send_climate_state_response: %s", msg.dump().c_str());
243 #endif
244  return this->send_message_<ClimateStateResponse>(msg, 47);
245 }
246 #endif
247 #ifdef USE_CLIMATE
248 #endif
249 #ifdef USE_NUMBER
251 #ifdef HAS_PROTO_MESSAGE_DUMP
252  ESP_LOGVV(TAG, "send_list_entities_number_response: %s", msg.dump().c_str());
253 #endif
254  return this->send_message_<ListEntitiesNumberResponse>(msg, 49);
255 }
256 #endif
257 #ifdef USE_NUMBER
259 #ifdef HAS_PROTO_MESSAGE_DUMP
260  ESP_LOGVV(TAG, "send_number_state_response: %s", msg.dump().c_str());
261 #endif
262  return this->send_message_<NumberStateResponse>(msg, 50);
263 }
264 #endif
265 #ifdef USE_NUMBER
266 #endif
267 #ifdef USE_SELECT
269 #ifdef HAS_PROTO_MESSAGE_DUMP
270  ESP_LOGVV(TAG, "send_list_entities_select_response: %s", msg.dump().c_str());
271 #endif
272  return this->send_message_<ListEntitiesSelectResponse>(msg, 52);
273 }
274 #endif
275 #ifdef USE_SELECT
277 #ifdef HAS_PROTO_MESSAGE_DUMP
278  ESP_LOGVV(TAG, "send_select_state_response: %s", msg.dump().c_str());
279 #endif
280  return this->send_message_<SelectStateResponse>(msg, 53);
281 }
282 #endif
283 #ifdef USE_SELECT
284 #endif
285 #ifdef USE_LOCK
287 #ifdef HAS_PROTO_MESSAGE_DUMP
288  ESP_LOGVV(TAG, "send_list_entities_lock_response: %s", msg.dump().c_str());
289 #endif
290  return this->send_message_<ListEntitiesLockResponse>(msg, 58);
291 }
292 #endif
293 #ifdef USE_LOCK
295 #ifdef HAS_PROTO_MESSAGE_DUMP
296  ESP_LOGVV(TAG, "send_lock_state_response: %s", msg.dump().c_str());
297 #endif
298  return this->send_message_<LockStateResponse>(msg, 59);
299 }
300 #endif
301 #ifdef USE_LOCK
302 #endif
303 #ifdef USE_BUTTON
305 #ifdef HAS_PROTO_MESSAGE_DUMP
306  ESP_LOGVV(TAG, "send_list_entities_button_response: %s", msg.dump().c_str());
307 #endif
308  return this->send_message_<ListEntitiesButtonResponse>(msg, 61);
309 }
310 #endif
311 #ifdef USE_BUTTON
312 #endif
313 #ifdef USE_MEDIA_PLAYER
315 #ifdef HAS_PROTO_MESSAGE_DUMP
316  ESP_LOGVV(TAG, "send_list_entities_media_player_response: %s", msg.dump().c_str());
317 #endif
318  return this->send_message_<ListEntitiesMediaPlayerResponse>(msg, 63);
319 }
320 #endif
321 #ifdef USE_MEDIA_PLAYER
323 #ifdef HAS_PROTO_MESSAGE_DUMP
324  ESP_LOGVV(TAG, "send_media_player_state_response: %s", msg.dump().c_str());
325 #endif
326  return this->send_message_<MediaPlayerStateResponse>(msg, 64);
327 }
328 #endif
329 #ifdef USE_MEDIA_PLAYER
330 #endif
331 #ifdef USE_BLUETOOTH_PROXY
332 #endif
333 #ifdef USE_BLUETOOTH_PROXY
335 #ifdef HAS_PROTO_MESSAGE_DUMP
336  ESP_LOGVV(TAG, "send_bluetooth_le_advertisement_response: %s", msg.dump().c_str());
337 #endif
338  return this->send_message_<BluetoothLEAdvertisementResponse>(msg, 67);
339 }
340 #endif
341 #ifdef USE_BLUETOOTH_PROXY
344 #ifdef HAS_PROTO_MESSAGE_DUMP
345  ESP_LOGVV(TAG, "send_bluetooth_le_raw_advertisements_response: %s", msg.dump().c_str());
346 #endif
347  return this->send_message_<BluetoothLERawAdvertisementsResponse>(msg, 93);
348 }
349 #endif
350 #ifdef USE_BLUETOOTH_PROXY
351 #endif
352 #ifdef USE_BLUETOOTH_PROXY
354 #ifdef HAS_PROTO_MESSAGE_DUMP
355  ESP_LOGVV(TAG, "send_bluetooth_device_connection_response: %s", msg.dump().c_str());
356 #endif
357  return this->send_message_<BluetoothDeviceConnectionResponse>(msg, 69);
358 }
359 #endif
360 #ifdef USE_BLUETOOTH_PROXY
361 #endif
362 #ifdef USE_BLUETOOTH_PROXY
364 #ifdef HAS_PROTO_MESSAGE_DUMP
365  ESP_LOGVV(TAG, "send_bluetooth_gatt_get_services_response: %s", msg.dump().c_str());
366 #endif
367  return this->send_message_<BluetoothGATTGetServicesResponse>(msg, 71);
368 }
369 #endif
370 #ifdef USE_BLUETOOTH_PROXY
373 #ifdef HAS_PROTO_MESSAGE_DUMP
374  ESP_LOGVV(TAG, "send_bluetooth_gatt_get_services_done_response: %s", msg.dump().c_str());
375 #endif
376  return this->send_message_<BluetoothGATTGetServicesDoneResponse>(msg, 72);
377 }
378 #endif
379 #ifdef USE_BLUETOOTH_PROXY
380 #endif
381 #ifdef USE_BLUETOOTH_PROXY
383 #ifdef HAS_PROTO_MESSAGE_DUMP
384  ESP_LOGVV(TAG, "send_bluetooth_gatt_read_response: %s", msg.dump().c_str());
385 #endif
386  return this->send_message_<BluetoothGATTReadResponse>(msg, 74);
387 }
388 #endif
389 #ifdef USE_BLUETOOTH_PROXY
390 #endif
391 #ifdef USE_BLUETOOTH_PROXY
392 #endif
393 #ifdef USE_BLUETOOTH_PROXY
394 #endif
395 #ifdef USE_BLUETOOTH_PROXY
396 #endif
397 #ifdef USE_BLUETOOTH_PROXY
399 #ifdef HAS_PROTO_MESSAGE_DUMP
400  ESP_LOGVV(TAG, "send_bluetooth_gatt_notify_data_response: %s", msg.dump().c_str());
401 #endif
402  return this->send_message_<BluetoothGATTNotifyDataResponse>(msg, 79);
403 }
404 #endif
405 #ifdef USE_BLUETOOTH_PROXY
406 #endif
407 #ifdef USE_BLUETOOTH_PROXY
409 #ifdef HAS_PROTO_MESSAGE_DUMP
410  ESP_LOGVV(TAG, "send_bluetooth_connections_free_response: %s", msg.dump().c_str());
411 #endif
412  return this->send_message_<BluetoothConnectionsFreeResponse>(msg, 81);
413 }
414 #endif
415 #ifdef USE_BLUETOOTH_PROXY
417 #ifdef HAS_PROTO_MESSAGE_DUMP
418  ESP_LOGVV(TAG, "send_bluetooth_gatt_error_response: %s", msg.dump().c_str());
419 #endif
420  return this->send_message_<BluetoothGATTErrorResponse>(msg, 82);
421 }
422 #endif
423 #ifdef USE_BLUETOOTH_PROXY
425 #ifdef HAS_PROTO_MESSAGE_DUMP
426  ESP_LOGVV(TAG, "send_bluetooth_gatt_write_response: %s", msg.dump().c_str());
427 #endif
428  return this->send_message_<BluetoothGATTWriteResponse>(msg, 83);
429 }
430 #endif
431 #ifdef USE_BLUETOOTH_PROXY
433 #ifdef HAS_PROTO_MESSAGE_DUMP
434  ESP_LOGVV(TAG, "send_bluetooth_gatt_notify_response: %s", msg.dump().c_str());
435 #endif
436  return this->send_message_<BluetoothGATTNotifyResponse>(msg, 84);
437 }
438 #endif
439 #ifdef USE_BLUETOOTH_PROXY
441 #ifdef HAS_PROTO_MESSAGE_DUMP
442  ESP_LOGVV(TAG, "send_bluetooth_device_pairing_response: %s", msg.dump().c_str());
443 #endif
444  return this->send_message_<BluetoothDevicePairingResponse>(msg, 85);
445 }
446 #endif
447 #ifdef USE_BLUETOOTH_PROXY
449 #ifdef HAS_PROTO_MESSAGE_DUMP
450  ESP_LOGVV(TAG, "send_bluetooth_device_unpairing_response: %s", msg.dump().c_str());
451 #endif
452  return this->send_message_<BluetoothDeviceUnpairingResponse>(msg, 86);
453 }
454 #endif
455 #ifdef USE_BLUETOOTH_PROXY
456 #endif
457 #ifdef USE_BLUETOOTH_PROXY
459 #ifdef HAS_PROTO_MESSAGE_DUMP
460  ESP_LOGVV(TAG, "send_bluetooth_device_clear_cache_response: %s", msg.dump().c_str());
461 #endif
462  return this->send_message_<BluetoothDeviceClearCacheResponse>(msg, 88);
463 }
464 #endif
465 #ifdef USE_VOICE_ASSISTANT
466 #endif
467 #ifdef USE_VOICE_ASSISTANT
469 #ifdef HAS_PROTO_MESSAGE_DUMP
470  ESP_LOGVV(TAG, "send_voice_assistant_request: %s", msg.dump().c_str());
471 #endif
472  return this->send_message_<VoiceAssistantRequest>(msg, 90);
473 }
474 #endif
475 #ifdef USE_VOICE_ASSISTANT
476 #endif
477 #ifdef USE_VOICE_ASSISTANT
478 #endif
479 #ifdef USE_VOICE_ASSISTANT
481 #ifdef HAS_PROTO_MESSAGE_DUMP
482  ESP_LOGVV(TAG, "send_voice_assistant_audio: %s", msg.dump().c_str());
483 #endif
484  return this->send_message_<VoiceAssistantAudio>(msg, 106);
485 }
486 #endif
487 #ifdef USE_VOICE_ASSISTANT
488 #endif
489 #ifdef USE_ALARM_CONTROL_PANEL
492 #ifdef HAS_PROTO_MESSAGE_DUMP
493  ESP_LOGVV(TAG, "send_list_entities_alarm_control_panel_response: %s", msg.dump().c_str());
494 #endif
495  return this->send_message_<ListEntitiesAlarmControlPanelResponse>(msg, 94);
496 }
497 #endif
498 #ifdef USE_ALARM_CONTROL_PANEL
500 #ifdef HAS_PROTO_MESSAGE_DUMP
501  ESP_LOGVV(TAG, "send_alarm_control_panel_state_response: %s", msg.dump().c_str());
502 #endif
503  return this->send_message_<AlarmControlPanelStateResponse>(msg, 95);
504 }
505 #endif
506 #ifdef USE_ALARM_CONTROL_PANEL
507 #endif
508 #ifdef USE_TEXT
510 #ifdef HAS_PROTO_MESSAGE_DUMP
511  ESP_LOGVV(TAG, "send_list_entities_text_response: %s", msg.dump().c_str());
512 #endif
513  return this->send_message_<ListEntitiesTextResponse>(msg, 97);
514 }
515 #endif
516 #ifdef USE_TEXT
518 #ifdef HAS_PROTO_MESSAGE_DUMP
519  ESP_LOGVV(TAG, "send_text_state_response: %s", msg.dump().c_str());
520 #endif
521  return this->send_message_<TextStateResponse>(msg, 98);
522 }
523 #endif
524 #ifdef USE_TEXT
525 #endif
526 #ifdef USE_DATETIME_DATE
528 #ifdef HAS_PROTO_MESSAGE_DUMP
529  ESP_LOGVV(TAG, "send_list_entities_date_response: %s", msg.dump().c_str());
530 #endif
531  return this->send_message_<ListEntitiesDateResponse>(msg, 100);
532 }
533 #endif
534 #ifdef USE_DATETIME_DATE
536 #ifdef HAS_PROTO_MESSAGE_DUMP
537  ESP_LOGVV(TAG, "send_date_state_response: %s", msg.dump().c_str());
538 #endif
539  return this->send_message_<DateStateResponse>(msg, 101);
540 }
541 #endif
542 #ifdef USE_DATETIME_DATE
543 #endif
544 #ifdef USE_DATETIME_TIME
546 #ifdef HAS_PROTO_MESSAGE_DUMP
547  ESP_LOGVV(TAG, "send_list_entities_time_response: %s", msg.dump().c_str());
548 #endif
549  return this->send_message_<ListEntitiesTimeResponse>(msg, 103);
550 }
551 #endif
552 #ifdef USE_DATETIME_TIME
554 #ifdef HAS_PROTO_MESSAGE_DUMP
555  ESP_LOGVV(TAG, "send_time_state_response: %s", msg.dump().c_str());
556 #endif
557  return this->send_message_<TimeStateResponse>(msg, 104);
558 }
559 #endif
560 #ifdef USE_DATETIME_TIME
561 #endif
562 #ifdef USE_EVENT
564 #ifdef HAS_PROTO_MESSAGE_DUMP
565  ESP_LOGVV(TAG, "send_list_entities_event_response: %s", msg.dump().c_str());
566 #endif
567  return this->send_message_<ListEntitiesEventResponse>(msg, 107);
568 }
569 #endif
570 #ifdef USE_EVENT
572 #ifdef HAS_PROTO_MESSAGE_DUMP
573  ESP_LOGVV(TAG, "send_event_response: %s", msg.dump().c_str());
574 #endif
575  return this->send_message_<EventResponse>(msg, 108);
576 }
577 #endif
578 #ifdef USE_VALVE
580 #ifdef HAS_PROTO_MESSAGE_DUMP
581  ESP_LOGVV(TAG, "send_list_entities_valve_response: %s", msg.dump().c_str());
582 #endif
583  return this->send_message_<ListEntitiesValveResponse>(msg, 109);
584 }
585 #endif
586 #ifdef USE_VALVE
588 #ifdef HAS_PROTO_MESSAGE_DUMP
589  ESP_LOGVV(TAG, "send_valve_state_response: %s", msg.dump().c_str());
590 #endif
591  return this->send_message_<ValveStateResponse>(msg, 110);
592 }
593 #endif
594 #ifdef USE_VALVE
595 #endif
596 #ifdef USE_DATETIME_DATETIME
598 #ifdef HAS_PROTO_MESSAGE_DUMP
599  ESP_LOGVV(TAG, "send_list_entities_date_time_response: %s", msg.dump().c_str());
600 #endif
601  return this->send_message_<ListEntitiesDateTimeResponse>(msg, 112);
602 }
603 #endif
604 #ifdef USE_DATETIME_DATETIME
606 #ifdef HAS_PROTO_MESSAGE_DUMP
607  ESP_LOGVV(TAG, "send_date_time_state_response: %s", msg.dump().c_str());
608 #endif
609  return this->send_message_<DateTimeStateResponse>(msg, 113);
610 }
611 #endif
612 #ifdef USE_DATETIME_DATETIME
613 #endif
614 #ifdef USE_UPDATE
616 #ifdef HAS_PROTO_MESSAGE_DUMP
617  ESP_LOGVV(TAG, "send_list_entities_update_response: %s", msg.dump().c_str());
618 #endif
619  return this->send_message_<ListEntitiesUpdateResponse>(msg, 116);
620 }
621 #endif
622 #ifdef USE_UPDATE
624 #ifdef HAS_PROTO_MESSAGE_DUMP
625  ESP_LOGVV(TAG, "send_update_state_response: %s", msg.dump().c_str());
626 #endif
627  return this->send_message_<UpdateStateResponse>(msg, 117);
628 }
629 #endif
630 #ifdef USE_UPDATE
631 #endif
632 bool APIServerConnectionBase::read_message(uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) {
633  switch (msg_type) {
634  case 1: {
635  HelloRequest msg;
636  msg.decode(msg_data, msg_size);
637 #ifdef HAS_PROTO_MESSAGE_DUMP
638  ESP_LOGVV(TAG, "on_hello_request: %s", msg.dump().c_str());
639 #endif
640  this->on_hello_request(msg);
641  break;
642  }
643  case 3: {
644  ConnectRequest msg;
645  msg.decode(msg_data, msg_size);
646 #ifdef HAS_PROTO_MESSAGE_DUMP
647  ESP_LOGVV(TAG, "on_connect_request: %s", msg.dump().c_str());
648 #endif
649  this->on_connect_request(msg);
650  break;
651  }
652  case 5: {
653  DisconnectRequest msg;
654  msg.decode(msg_data, msg_size);
655 #ifdef HAS_PROTO_MESSAGE_DUMP
656  ESP_LOGVV(TAG, "on_disconnect_request: %s", msg.dump().c_str());
657 #endif
658  this->on_disconnect_request(msg);
659  break;
660  }
661  case 6: {
662  DisconnectResponse msg;
663  msg.decode(msg_data, msg_size);
664 #ifdef HAS_PROTO_MESSAGE_DUMP
665  ESP_LOGVV(TAG, "on_disconnect_response: %s", msg.dump().c_str());
666 #endif
667  this->on_disconnect_response(msg);
668  break;
669  }
670  case 7: {
671  PingRequest msg;
672  msg.decode(msg_data, msg_size);
673 #ifdef HAS_PROTO_MESSAGE_DUMP
674  ESP_LOGVV(TAG, "on_ping_request: %s", msg.dump().c_str());
675 #endif
676  this->on_ping_request(msg);
677  break;
678  }
679  case 8: {
680  PingResponse msg;
681  msg.decode(msg_data, msg_size);
682 #ifdef HAS_PROTO_MESSAGE_DUMP
683  ESP_LOGVV(TAG, "on_ping_response: %s", msg.dump().c_str());
684 #endif
685  this->on_ping_response(msg);
686  break;
687  }
688  case 9: {
689  DeviceInfoRequest msg;
690  msg.decode(msg_data, msg_size);
691 #ifdef HAS_PROTO_MESSAGE_DUMP
692  ESP_LOGVV(TAG, "on_device_info_request: %s", msg.dump().c_str());
693 #endif
694  this->on_device_info_request(msg);
695  break;
696  }
697  case 11: {
699  msg.decode(msg_data, msg_size);
700 #ifdef HAS_PROTO_MESSAGE_DUMP
701  ESP_LOGVV(TAG, "on_list_entities_request: %s", msg.dump().c_str());
702 #endif
703  this->on_list_entities_request(msg);
704  break;
705  }
706  case 20: {
708  msg.decode(msg_data, msg_size);
709 #ifdef HAS_PROTO_MESSAGE_DUMP
710  ESP_LOGVV(TAG, "on_subscribe_states_request: %s", msg.dump().c_str());
711 #endif
712  this->on_subscribe_states_request(msg);
713  break;
714  }
715  case 28: {
717  msg.decode(msg_data, msg_size);
718 #ifdef HAS_PROTO_MESSAGE_DUMP
719  ESP_LOGVV(TAG, "on_subscribe_logs_request: %s", msg.dump().c_str());
720 #endif
721  this->on_subscribe_logs_request(msg);
722  break;
723  }
724  case 30: {
725 #ifdef USE_COVER
727  msg.decode(msg_data, msg_size);
728 #ifdef HAS_PROTO_MESSAGE_DUMP
729  ESP_LOGVV(TAG, "on_cover_command_request: %s", msg.dump().c_str());
730 #endif
731  this->on_cover_command_request(msg);
732 #endif
733  break;
734  }
735  case 31: {
736 #ifdef USE_FAN
737  FanCommandRequest msg;
738  msg.decode(msg_data, msg_size);
739 #ifdef HAS_PROTO_MESSAGE_DUMP
740  ESP_LOGVV(TAG, "on_fan_command_request: %s", msg.dump().c_str());
741 #endif
742  this->on_fan_command_request(msg);
743 #endif
744  break;
745  }
746  case 32: {
747 #ifdef USE_LIGHT
749  msg.decode(msg_data, msg_size);
750 #ifdef HAS_PROTO_MESSAGE_DUMP
751  ESP_LOGVV(TAG, "on_light_command_request: %s", msg.dump().c_str());
752 #endif
753  this->on_light_command_request(msg);
754 #endif
755  break;
756  }
757  case 33: {
758 #ifdef USE_SWITCH
760  msg.decode(msg_data, msg_size);
761 #ifdef HAS_PROTO_MESSAGE_DUMP
762  ESP_LOGVV(TAG, "on_switch_command_request: %s", msg.dump().c_str());
763 #endif
764  this->on_switch_command_request(msg);
765 #endif
766  break;
767  }
768  case 34: {
770  msg.decode(msg_data, msg_size);
771 #ifdef HAS_PROTO_MESSAGE_DUMP
772  ESP_LOGVV(TAG, "on_subscribe_homeassistant_services_request: %s", msg.dump().c_str());
773 #endif
775  break;
776  }
777  case 36: {
778  GetTimeRequest msg;
779  msg.decode(msg_data, msg_size);
780 #ifdef HAS_PROTO_MESSAGE_DUMP
781  ESP_LOGVV(TAG, "on_get_time_request: %s", msg.dump().c_str());
782 #endif
783  this->on_get_time_request(msg);
784  break;
785  }
786  case 37: {
787  GetTimeResponse msg;
788  msg.decode(msg_data, msg_size);
789 #ifdef HAS_PROTO_MESSAGE_DUMP
790  ESP_LOGVV(TAG, "on_get_time_response: %s", msg.dump().c_str());
791 #endif
792  this->on_get_time_response(msg);
793  break;
794  }
795  case 38: {
797  msg.decode(msg_data, msg_size);
798 #ifdef HAS_PROTO_MESSAGE_DUMP
799  ESP_LOGVV(TAG, "on_subscribe_home_assistant_states_request: %s", msg.dump().c_str());
800 #endif
802  break;
803  }
804  case 40: {
806  msg.decode(msg_data, msg_size);
807 #ifdef HAS_PROTO_MESSAGE_DUMP
808  ESP_LOGVV(TAG, "on_home_assistant_state_response: %s", msg.dump().c_str());
809 #endif
811  break;
812  }
813  case 42: {
815  msg.decode(msg_data, msg_size);
816 #ifdef HAS_PROTO_MESSAGE_DUMP
817  ESP_LOGVV(TAG, "on_execute_service_request: %s", msg.dump().c_str());
818 #endif
819  this->on_execute_service_request(msg);
820  break;
821  }
822  case 45: {
823 #ifdef USE_ESP32_CAMERA
824  CameraImageRequest msg;
825  msg.decode(msg_data, msg_size);
826 #ifdef HAS_PROTO_MESSAGE_DUMP
827  ESP_LOGVV(TAG, "on_camera_image_request: %s", msg.dump().c_str());
828 #endif
829  this->on_camera_image_request(msg);
830 #endif
831  break;
832  }
833  case 48: {
834 #ifdef USE_CLIMATE
836  msg.decode(msg_data, msg_size);
837 #ifdef HAS_PROTO_MESSAGE_DUMP
838  ESP_LOGVV(TAG, "on_climate_command_request: %s", msg.dump().c_str());
839 #endif
840  this->on_climate_command_request(msg);
841 #endif
842  break;
843  }
844  case 51: {
845 #ifdef USE_NUMBER
847  msg.decode(msg_data, msg_size);
848 #ifdef HAS_PROTO_MESSAGE_DUMP
849  ESP_LOGVV(TAG, "on_number_command_request: %s", msg.dump().c_str());
850 #endif
851  this->on_number_command_request(msg);
852 #endif
853  break;
854  }
855  case 54: {
856 #ifdef USE_SELECT
858  msg.decode(msg_data, msg_size);
859 #ifdef HAS_PROTO_MESSAGE_DUMP
860  ESP_LOGVV(TAG, "on_select_command_request: %s", msg.dump().c_str());
861 #endif
862  this->on_select_command_request(msg);
863 #endif
864  break;
865  }
866  case 60: {
867 #ifdef USE_LOCK
868  LockCommandRequest msg;
869  msg.decode(msg_data, msg_size);
870 #ifdef HAS_PROTO_MESSAGE_DUMP
871  ESP_LOGVV(TAG, "on_lock_command_request: %s", msg.dump().c_str());
872 #endif
873  this->on_lock_command_request(msg);
874 #endif
875  break;
876  }
877  case 62: {
878 #ifdef USE_BUTTON
880  msg.decode(msg_data, msg_size);
881 #ifdef HAS_PROTO_MESSAGE_DUMP
882  ESP_LOGVV(TAG, "on_button_command_request: %s", msg.dump().c_str());
883 #endif
884  this->on_button_command_request(msg);
885 #endif
886  break;
887  }
888  case 65: {
889 #ifdef USE_MEDIA_PLAYER
891  msg.decode(msg_data, msg_size);
892 #ifdef HAS_PROTO_MESSAGE_DUMP
893  ESP_LOGVV(TAG, "on_media_player_command_request: %s", msg.dump().c_str());
894 #endif
896 #endif
897  break;
898  }
899  case 66: {
900 #ifdef USE_BLUETOOTH_PROXY
902  msg.decode(msg_data, msg_size);
903 #ifdef HAS_PROTO_MESSAGE_DUMP
904  ESP_LOGVV(TAG, "on_subscribe_bluetooth_le_advertisements_request: %s", msg.dump().c_str());
905 #endif
907 #endif
908  break;
909  }
910  case 68: {
911 #ifdef USE_BLUETOOTH_PROXY
913  msg.decode(msg_data, msg_size);
914 #ifdef HAS_PROTO_MESSAGE_DUMP
915  ESP_LOGVV(TAG, "on_bluetooth_device_request: %s", msg.dump().c_str());
916 #endif
917  this->on_bluetooth_device_request(msg);
918 #endif
919  break;
920  }
921  case 70: {
922 #ifdef USE_BLUETOOTH_PROXY
924  msg.decode(msg_data, msg_size);
925 #ifdef HAS_PROTO_MESSAGE_DUMP
926  ESP_LOGVV(TAG, "on_bluetooth_gatt_get_services_request: %s", msg.dump().c_str());
927 #endif
929 #endif
930  break;
931  }
932  case 73: {
933 #ifdef USE_BLUETOOTH_PROXY
935  msg.decode(msg_data, msg_size);
936 #ifdef HAS_PROTO_MESSAGE_DUMP
937  ESP_LOGVV(TAG, "on_bluetooth_gatt_read_request: %s", msg.dump().c_str());
938 #endif
940 #endif
941  break;
942  }
943  case 75: {
944 #ifdef USE_BLUETOOTH_PROXY
946  msg.decode(msg_data, msg_size);
947 #ifdef HAS_PROTO_MESSAGE_DUMP
948  ESP_LOGVV(TAG, "on_bluetooth_gatt_write_request: %s", msg.dump().c_str());
949 #endif
951 #endif
952  break;
953  }
954  case 76: {
955 #ifdef USE_BLUETOOTH_PROXY
957  msg.decode(msg_data, msg_size);
958 #ifdef HAS_PROTO_MESSAGE_DUMP
959  ESP_LOGVV(TAG, "on_bluetooth_gatt_read_descriptor_request: %s", msg.dump().c_str());
960 #endif
962 #endif
963  break;
964  }
965  case 77: {
966 #ifdef USE_BLUETOOTH_PROXY
968  msg.decode(msg_data, msg_size);
969 #ifdef HAS_PROTO_MESSAGE_DUMP
970  ESP_LOGVV(TAG, "on_bluetooth_gatt_write_descriptor_request: %s", msg.dump().c_str());
971 #endif
973 #endif
974  break;
975  }
976  case 78: {
977 #ifdef USE_BLUETOOTH_PROXY
979  msg.decode(msg_data, msg_size);
980 #ifdef HAS_PROTO_MESSAGE_DUMP
981  ESP_LOGVV(TAG, "on_bluetooth_gatt_notify_request: %s", msg.dump().c_str());
982 #endif
984 #endif
985  break;
986  }
987  case 80: {
988 #ifdef USE_BLUETOOTH_PROXY
990  msg.decode(msg_data, msg_size);
991 #ifdef HAS_PROTO_MESSAGE_DUMP
992  ESP_LOGVV(TAG, "on_subscribe_bluetooth_connections_free_request: %s", msg.dump().c_str());
993 #endif
995 #endif
996  break;
997  }
998  case 87: {
999 #ifdef USE_BLUETOOTH_PROXY
1001  msg.decode(msg_data, msg_size);
1002 #ifdef HAS_PROTO_MESSAGE_DUMP
1003  ESP_LOGVV(TAG, "on_unsubscribe_bluetooth_le_advertisements_request: %s", msg.dump().c_str());
1004 #endif
1006 #endif
1007  break;
1008  }
1009  case 89: {
1010 #ifdef USE_VOICE_ASSISTANT
1012  msg.decode(msg_data, msg_size);
1013 #ifdef HAS_PROTO_MESSAGE_DUMP
1014  ESP_LOGVV(TAG, "on_subscribe_voice_assistant_request: %s", msg.dump().c_str());
1015 #endif
1017 #endif
1018  break;
1019  }
1020  case 91: {
1021 #ifdef USE_VOICE_ASSISTANT
1023  msg.decode(msg_data, msg_size);
1024 #ifdef HAS_PROTO_MESSAGE_DUMP
1025  ESP_LOGVV(TAG, "on_voice_assistant_response: %s", msg.dump().c_str());
1026 #endif
1027  this->on_voice_assistant_response(msg);
1028 #endif
1029  break;
1030  }
1031  case 92: {
1032 #ifdef USE_VOICE_ASSISTANT
1034  msg.decode(msg_data, msg_size);
1035 #ifdef HAS_PROTO_MESSAGE_DUMP
1036  ESP_LOGVV(TAG, "on_voice_assistant_event_response: %s", msg.dump().c_str());
1037 #endif
1039 #endif
1040  break;
1041  }
1042  case 96: {
1043 #ifdef USE_ALARM_CONTROL_PANEL
1045  msg.decode(msg_data, msg_size);
1046 #ifdef HAS_PROTO_MESSAGE_DUMP
1047  ESP_LOGVV(TAG, "on_alarm_control_panel_command_request: %s", msg.dump().c_str());
1048 #endif
1050 #endif
1051  break;
1052  }
1053  case 99: {
1054 #ifdef USE_TEXT
1055  TextCommandRequest msg;
1056  msg.decode(msg_data, msg_size);
1057 #ifdef HAS_PROTO_MESSAGE_DUMP
1058  ESP_LOGVV(TAG, "on_text_command_request: %s", msg.dump().c_str());
1059 #endif
1060  this->on_text_command_request(msg);
1061 #endif
1062  break;
1063  }
1064  case 102: {
1065 #ifdef USE_DATETIME_DATE
1066  DateCommandRequest msg;
1067  msg.decode(msg_data, msg_size);
1068 #ifdef HAS_PROTO_MESSAGE_DUMP
1069  ESP_LOGVV(TAG, "on_date_command_request: %s", msg.dump().c_str());
1070 #endif
1071  this->on_date_command_request(msg);
1072 #endif
1073  break;
1074  }
1075  case 105: {
1076 #ifdef USE_DATETIME_TIME
1077  TimeCommandRequest msg;
1078  msg.decode(msg_data, msg_size);
1079 #ifdef HAS_PROTO_MESSAGE_DUMP
1080  ESP_LOGVV(TAG, "on_time_command_request: %s", msg.dump().c_str());
1081 #endif
1082  this->on_time_command_request(msg);
1083 #endif
1084  break;
1085  }
1086  case 106: {
1087 #ifdef USE_VOICE_ASSISTANT
1088  VoiceAssistantAudio msg;
1089  msg.decode(msg_data, msg_size);
1090 #ifdef HAS_PROTO_MESSAGE_DUMP
1091  ESP_LOGVV(TAG, "on_voice_assistant_audio: %s", msg.dump().c_str());
1092 #endif
1093  this->on_voice_assistant_audio(msg);
1094 #endif
1095  break;
1096  }
1097  case 111: {
1098 #ifdef USE_VALVE
1099  ValveCommandRequest msg;
1100  msg.decode(msg_data, msg_size);
1101 #ifdef HAS_PROTO_MESSAGE_DUMP
1102  ESP_LOGVV(TAG, "on_valve_command_request: %s", msg.dump().c_str());
1103 #endif
1104  this->on_valve_command_request(msg);
1105 #endif
1106  break;
1107  }
1108  case 114: {
1109 #ifdef USE_DATETIME_DATETIME
1111  msg.decode(msg_data, msg_size);
1112 #ifdef HAS_PROTO_MESSAGE_DUMP
1113  ESP_LOGVV(TAG, "on_date_time_command_request: %s", msg.dump().c_str());
1114 #endif
1115  this->on_date_time_command_request(msg);
1116 #endif
1117  break;
1118  }
1119  case 115: {
1120 #ifdef USE_VOICE_ASSISTANT
1122  msg.decode(msg_data, msg_size);
1123 #ifdef HAS_PROTO_MESSAGE_DUMP
1124  ESP_LOGVV(TAG, "on_voice_assistant_timer_event_response: %s", msg.dump().c_str());
1125 #endif
1127 #endif
1128  break;
1129  }
1130  case 118: {
1131 #ifdef USE_UPDATE
1133  msg.decode(msg_data, msg_size);
1134 #ifdef HAS_PROTO_MESSAGE_DUMP
1135  ESP_LOGVV(TAG, "on_update_command_request: %s", msg.dump().c_str());
1136 #endif
1137  this->on_update_command_request(msg);
1138 #endif
1139  break;
1140  }
1141  default:
1142  return false;
1143  }
1144  return true;
1145 }
1146 
1148  HelloResponse ret = this->hello(msg);
1149  if (!this->send_hello_response(ret)) {
1150  this->on_fatal_error();
1151  }
1152 }
1154  ConnectResponse ret = this->connect(msg);
1155  if (!this->send_connect_response(ret)) {
1156  this->on_fatal_error();
1157  }
1158 }
1160  DisconnectResponse ret = this->disconnect(msg);
1161  if (!this->send_disconnect_response(ret)) {
1162  this->on_fatal_error();
1163  }
1164 }
1166  PingResponse ret = this->ping(msg);
1167  if (!this->send_ping_response(ret)) {
1168  this->on_fatal_error();
1169  }
1170 }
1172  if (!this->is_connection_setup()) {
1173  this->on_no_setup_connection();
1174  return;
1175  }
1176  DeviceInfoResponse ret = this->device_info(msg);
1177  if (!this->send_device_info_response(ret)) {
1178  this->on_fatal_error();
1179  }
1180 }
1182  if (!this->is_connection_setup()) {
1183  this->on_no_setup_connection();
1184  return;
1185  }
1186  if (!this->is_authenticated()) {
1187  this->on_unauthenticated_access();
1188  return;
1189  }
1190  this->list_entities(msg);
1191 }
1193  if (!this->is_connection_setup()) {
1194  this->on_no_setup_connection();
1195  return;
1196  }
1197  if (!this->is_authenticated()) {
1198  this->on_unauthenticated_access();
1199  return;
1200  }
1201  this->subscribe_states(msg);
1202 }
1204  if (!this->is_connection_setup()) {
1205  this->on_no_setup_connection();
1206  return;
1207  }
1208  if (!this->is_authenticated()) {
1209  this->on_unauthenticated_access();
1210  return;
1211  }
1212  this->subscribe_logs(msg);
1213 }
1216  if (!this->is_connection_setup()) {
1217  this->on_no_setup_connection();
1218  return;
1219  }
1220  if (!this->is_authenticated()) {
1221  this->on_unauthenticated_access();
1222  return;
1223  }
1224  this->subscribe_homeassistant_services(msg);
1225 }
1227  if (!this->is_connection_setup()) {
1228  this->on_no_setup_connection();
1229  return;
1230  }
1231  if (!this->is_authenticated()) {
1232  this->on_unauthenticated_access();
1233  return;
1234  }
1235  this->subscribe_home_assistant_states(msg);
1236 }
1238  if (!this->is_connection_setup()) {
1239  this->on_no_setup_connection();
1240  return;
1241  }
1242  GetTimeResponse ret = this->get_time(msg);
1243  if (!this->send_get_time_response(ret)) {
1244  this->on_fatal_error();
1245  }
1246 }
1248  if (!this->is_connection_setup()) {
1249  this->on_no_setup_connection();
1250  return;
1251  }
1252  if (!this->is_authenticated()) {
1253  this->on_unauthenticated_access();
1254  return;
1255  }
1256  this->execute_service(msg);
1257 }
1258 #ifdef USE_COVER
1260  if (!this->is_connection_setup()) {
1261  this->on_no_setup_connection();
1262  return;
1263  }
1264  if (!this->is_authenticated()) {
1265  this->on_unauthenticated_access();
1266  return;
1267  }
1268  this->cover_command(msg);
1269 }
1270 #endif
1271 #ifdef USE_FAN
1273  if (!this->is_connection_setup()) {
1274  this->on_no_setup_connection();
1275  return;
1276  }
1277  if (!this->is_authenticated()) {
1278  this->on_unauthenticated_access();
1279  return;
1280  }
1281  this->fan_command(msg);
1282 }
1283 #endif
1284 #ifdef USE_LIGHT
1286  if (!this->is_connection_setup()) {
1287  this->on_no_setup_connection();
1288  return;
1289  }
1290  if (!this->is_authenticated()) {
1291  this->on_unauthenticated_access();
1292  return;
1293  }
1294  this->light_command(msg);
1295 }
1296 #endif
1297 #ifdef USE_SWITCH
1299  if (!this->is_connection_setup()) {
1300  this->on_no_setup_connection();
1301  return;
1302  }
1303  if (!this->is_authenticated()) {
1304  this->on_unauthenticated_access();
1305  return;
1306  }
1307  this->switch_command(msg);
1308 }
1309 #endif
1310 #ifdef USE_ESP32_CAMERA
1312  if (!this->is_connection_setup()) {
1313  this->on_no_setup_connection();
1314  return;
1315  }
1316  if (!this->is_authenticated()) {
1317  this->on_unauthenticated_access();
1318  return;
1319  }
1320  this->camera_image(msg);
1321 }
1322 #endif
1323 #ifdef USE_CLIMATE
1325  if (!this->is_connection_setup()) {
1326  this->on_no_setup_connection();
1327  return;
1328  }
1329  if (!this->is_authenticated()) {
1330  this->on_unauthenticated_access();
1331  return;
1332  }
1333  this->climate_command(msg);
1334 }
1335 #endif
1336 #ifdef USE_NUMBER
1338  if (!this->is_connection_setup()) {
1339  this->on_no_setup_connection();
1340  return;
1341  }
1342  if (!this->is_authenticated()) {
1343  this->on_unauthenticated_access();
1344  return;
1345  }
1346  this->number_command(msg);
1347 }
1348 #endif
1349 #ifdef USE_TEXT
1351  if (!this->is_connection_setup()) {
1352  this->on_no_setup_connection();
1353  return;
1354  }
1355  if (!this->is_authenticated()) {
1356  this->on_unauthenticated_access();
1357  return;
1358  }
1359  this->text_command(msg);
1360 }
1361 #endif
1362 #ifdef USE_SELECT
1364  if (!this->is_connection_setup()) {
1365  this->on_no_setup_connection();
1366  return;
1367  }
1368  if (!this->is_authenticated()) {
1369  this->on_unauthenticated_access();
1370  return;
1371  }
1372  this->select_command(msg);
1373 }
1374 #endif
1375 #ifdef USE_BUTTON
1377  if (!this->is_connection_setup()) {
1378  this->on_no_setup_connection();
1379  return;
1380  }
1381  if (!this->is_authenticated()) {
1382  this->on_unauthenticated_access();
1383  return;
1384  }
1385  this->button_command(msg);
1386 }
1387 #endif
1388 #ifdef USE_LOCK
1390  if (!this->is_connection_setup()) {
1391  this->on_no_setup_connection();
1392  return;
1393  }
1394  if (!this->is_authenticated()) {
1395  this->on_unauthenticated_access();
1396  return;
1397  }
1398  this->lock_command(msg);
1399 }
1400 #endif
1401 #ifdef USE_VALVE
1403  if (!this->is_connection_setup()) {
1404  this->on_no_setup_connection();
1405  return;
1406  }
1407  if (!this->is_authenticated()) {
1408  this->on_unauthenticated_access();
1409  return;
1410  }
1411  this->valve_command(msg);
1412 }
1413 #endif
1414 #ifdef USE_MEDIA_PLAYER
1416  if (!this->is_connection_setup()) {
1417  this->on_no_setup_connection();
1418  return;
1419  }
1420  if (!this->is_authenticated()) {
1421  this->on_unauthenticated_access();
1422  return;
1423  }
1424  this->media_player_command(msg);
1425 }
1426 #endif
1427 #ifdef USE_DATETIME_DATE
1429  if (!this->is_connection_setup()) {
1430  this->on_no_setup_connection();
1431  return;
1432  }
1433  if (!this->is_authenticated()) {
1434  this->on_unauthenticated_access();
1435  return;
1436  }
1437  this->date_command(msg);
1438 }
1439 #endif
1440 #ifdef USE_DATETIME_TIME
1442  if (!this->is_connection_setup()) {
1443  this->on_no_setup_connection();
1444  return;
1445  }
1446  if (!this->is_authenticated()) {
1447  this->on_unauthenticated_access();
1448  return;
1449  }
1450  this->time_command(msg);
1451 }
1452 #endif
1453 #ifdef USE_DATETIME_DATETIME
1455  if (!this->is_connection_setup()) {
1456  this->on_no_setup_connection();
1457  return;
1458  }
1459  if (!this->is_authenticated()) {
1460  this->on_unauthenticated_access();
1461  return;
1462  }
1463  this->datetime_command(msg);
1464 }
1465 #endif
1466 #ifdef USE_UPDATE
1468  if (!this->is_connection_setup()) {
1469  this->on_no_setup_connection();
1470  return;
1471  }
1472  if (!this->is_authenticated()) {
1473  this->on_unauthenticated_access();
1474  return;
1475  }
1476  this->update_command(msg);
1477 }
1478 #endif
1479 #ifdef USE_BLUETOOTH_PROXY
1482  if (!this->is_connection_setup()) {
1483  this->on_no_setup_connection();
1484  return;
1485  }
1486  if (!this->is_authenticated()) {
1487  this->on_unauthenticated_access();
1488  return;
1489  }
1490  this->subscribe_bluetooth_le_advertisements(msg);
1491 }
1492 #endif
1493 #ifdef USE_BLUETOOTH_PROXY
1495  if (!this->is_connection_setup()) {
1496  this->on_no_setup_connection();
1497  return;
1498  }
1499  if (!this->is_authenticated()) {
1500  this->on_unauthenticated_access();
1501  return;
1502  }
1503  this->bluetooth_device_request(msg);
1504 }
1505 #endif
1506 #ifdef USE_BLUETOOTH_PROXY
1508  if (!this->is_connection_setup()) {
1509  this->on_no_setup_connection();
1510  return;
1511  }
1512  if (!this->is_authenticated()) {
1513  this->on_unauthenticated_access();
1514  return;
1515  }
1516  this->bluetooth_gatt_get_services(msg);
1517 }
1518 #endif
1519 #ifdef USE_BLUETOOTH_PROXY
1521  if (!this->is_connection_setup()) {
1522  this->on_no_setup_connection();
1523  return;
1524  }
1525  if (!this->is_authenticated()) {
1526  this->on_unauthenticated_access();
1527  return;
1528  }
1529  this->bluetooth_gatt_read(msg);
1530 }
1531 #endif
1532 #ifdef USE_BLUETOOTH_PROXY
1534  if (!this->is_connection_setup()) {
1535  this->on_no_setup_connection();
1536  return;
1537  }
1538  if (!this->is_authenticated()) {
1539  this->on_unauthenticated_access();
1540  return;
1541  }
1542  this->bluetooth_gatt_write(msg);
1543 }
1544 #endif
1545 #ifdef USE_BLUETOOTH_PROXY
1547  if (!this->is_connection_setup()) {
1548  this->on_no_setup_connection();
1549  return;
1550  }
1551  if (!this->is_authenticated()) {
1552  this->on_unauthenticated_access();
1553  return;
1554  }
1555  this->bluetooth_gatt_read_descriptor(msg);
1556 }
1557 #endif
1558 #ifdef USE_BLUETOOTH_PROXY
1560  if (!this->is_connection_setup()) {
1561  this->on_no_setup_connection();
1562  return;
1563  }
1564  if (!this->is_authenticated()) {
1565  this->on_unauthenticated_access();
1566  return;
1567  }
1568  this->bluetooth_gatt_write_descriptor(msg);
1569 }
1570 #endif
1571 #ifdef USE_BLUETOOTH_PROXY
1573  if (!this->is_connection_setup()) {
1574  this->on_no_setup_connection();
1575  return;
1576  }
1577  if (!this->is_authenticated()) {
1578  this->on_unauthenticated_access();
1579  return;
1580  }
1581  this->bluetooth_gatt_notify(msg);
1582 }
1583 #endif
1584 #ifdef USE_BLUETOOTH_PROXY
1587  if (!this->is_connection_setup()) {
1588  this->on_no_setup_connection();
1589  return;
1590  }
1591  if (!this->is_authenticated()) {
1592  this->on_unauthenticated_access();
1593  return;
1594  }
1595  BluetoothConnectionsFreeResponse ret = this->subscribe_bluetooth_connections_free(msg);
1596  if (!this->send_bluetooth_connections_free_response(ret)) {
1597  this->on_fatal_error();
1598  }
1599 }
1600 #endif
1601 #ifdef USE_BLUETOOTH_PROXY
1604  if (!this->is_connection_setup()) {
1605  this->on_no_setup_connection();
1606  return;
1607  }
1608  if (!this->is_authenticated()) {
1609  this->on_unauthenticated_access();
1610  return;
1611  }
1612  this->unsubscribe_bluetooth_le_advertisements(msg);
1613 }
1614 #endif
1615 #ifdef USE_VOICE_ASSISTANT
1617  if (!this->is_connection_setup()) {
1618  this->on_no_setup_connection();
1619  return;
1620  }
1621  if (!this->is_authenticated()) {
1622  this->on_unauthenticated_access();
1623  return;
1624  }
1625  this->subscribe_voice_assistant(msg);
1626 }
1627 #endif
1628 #ifdef USE_ALARM_CONTROL_PANEL
1630  if (!this->is_connection_setup()) {
1631  this->on_no_setup_connection();
1632  return;
1633  }
1634  if (!this->is_authenticated()) {
1635  this->on_unauthenticated_access();
1636  return;
1637  }
1638  this->alarm_control_panel_command(msg);
1639 }
1640 #endif
1641 
1642 } // namespace api
1643 } // namespace esphome
void on_text_command_request(const TextCommandRequest &msg) override
bool send_list_entities_binary_sensor_response(const ListEntitiesBinarySensorResponse &msg)
void on_unsubscribe_bluetooth_le_advertisements_request(const UnsubscribeBluetoothLEAdvertisementsRequest &msg) override
virtual void on_climate_command_request(const ClimateCommandRequest &value)
bool send_date_state_response(const DateStateResponse &msg)
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)
void on_device_info_request(const DeviceInfoRequest &msg) override
bool send_text_state_response(const TextStateResponse &msg)
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)
void on_bluetooth_gatt_get_services_request(const BluetoothGATTGetServicesRequest &msg) override
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_no_setup_connection()=0
bool send_event_response(const EventResponse &msg)
virtual void on_voice_assistant_audio(const VoiceAssistantAudio &value)
void on_subscribe_home_assistant_states_request(const SubscribeHomeAssistantStatesRequest &msg) override
virtual void on_ping_response(const PingResponse &value)
void on_date_time_command_request(const DateTimeCommandRequest &msg) override
void on_bluetooth_gatt_write_request(const BluetoothGATTWriteRequest &msg) override
virtual void on_light_command_request(const LightCommandRequest &value)
bool send_subscribe_logs_response(const SubscribeLogsResponse &msg)
std::string dump() const
Definition: proto.cpp:84
bool send_climate_state_response(const ClimateStateResponse &msg)
bool send_binary_sensor_state_response(const BinarySensorStateResponse &msg)
void on_update_command_request(const UpdateCommandRequest &msg) override
void on_cover_command_request(const CoverCommandRequest &msg) override
virtual void on_fatal_error()=0
bool send_bluetooth_gatt_error_response(const BluetoothGATTErrorResponse &msg)
void on_fan_command_request(const FanCommandRequest &msg) override
bool send_list_entities_valve_response(const ListEntitiesValveResponse &msg)
void on_subscribe_homeassistant_services_request(const SubscribeHomeassistantServicesRequest &msg) override
void decode(const uint8_t *buffer, size_t length)
Definition: proto.cpp:10
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)
void on_date_command_request(const DateCommandRequest &msg) override
bool send_bluetooth_gatt_write_response(const BluetoothGATTWriteResponse &msg)
bool send_list_entities_event_response(const ListEntitiesEventResponse &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)
void on_switch_command_request(const SwitchCommandRequest &msg) override
void on_bluetooth_gatt_read_descriptor_request(const BluetoothGATTReadDescriptorRequest &msg) override
void on_button_command_request(const ButtonCommandRequest &msg) override
void on_get_time_request(const GetTimeRequest &msg) override
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)
void on_disconnect_request(const DisconnectRequest &msg) override
virtual void on_list_entities_request(const ListEntitiesRequest &value)
virtual void on_disconnect_request(const DisconnectRequest &value)
virtual void on_text_command_request(const TextCommandRequest &value)
virtual void on_select_command_request(const SelectCommandRequest &value)
virtual void on_date_time_command_request(const DateTimeCommandRequest &value)
virtual void on_disconnect_response(const DisconnectResponse &value)
virtual void on_bluetooth_gatt_get_services_request(const BluetoothGATTGetServicesRequest &value)
void on_ping_request(const PingRequest &msg) override
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)
void on_media_player_command_request(const MediaPlayerCommandRequest &msg) override
virtual void on_media_player_command_request(const MediaPlayerCommandRequest &value)
bool send_list_entities_text_sensor_response(const ListEntitiesTextSensorResponse &msg)
void on_subscribe_bluetooth_le_advertisements_request(const SubscribeBluetoothLEAdvertisementsRequest &msg) override
virtual void on_subscribe_bluetooth_connections_free_request(const SubscribeBluetoothConnectionsFreeRequest &value)
void on_execute_service_request(const ExecuteServiceRequest &msg) override
bool send_bluetooth_device_unpairing_response(const BluetoothDeviceUnpairingResponse &msg)
void on_connect_request(const ConnectRequest &msg) override
virtual void on_alarm_control_panel_command_request(const AlarmControlPanelCommandRequest &value)
bool send_list_entities_light_response(const ListEntitiesLightResponse &msg)
void on_valve_command_request(const ValveCommandRequest &msg) override
virtual void on_cover_command_request(const CoverCommandRequest &value)
virtual void on_update_command_request(const UpdateCommandRequest &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)
void on_subscribe_voice_assistant_request(const SubscribeVoiceAssistantRequest &msg) override
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)
void on_bluetooth_gatt_read_request(const BluetoothGATTReadRequest &msg) override
bool send_voice_assistant_request(const VoiceAssistantRequest &msg)
virtual void on_date_command_request(const DateCommandRequest &value)
void on_subscribe_bluetooth_connections_free_request(const SubscribeBluetoothConnectionsFreeRequest &msg) override
virtual void on_execute_service_request(const ExecuteServiceRequest &value)
virtual void on_voice_assistant_timer_event_response(const VoiceAssistantTimerEventResponse &value)
void on_light_command_request(const LightCommandRequest &msg) override
void on_list_entities_request(const ListEntitiesRequest &msg) override
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
void on_select_command_request(const SelectCommandRequest &msg) override
void on_subscribe_logs_request(const SubscribeLogsRequest &msg) override
bool send_camera_image_response(const CameraImageResponse &msg)
bool send_list_entities_lock_response(const ListEntitiesLockResponse &msg)
void on_bluetooth_gatt_write_descriptor_request(const BluetoothGATTWriteDescriptorRequest &msg) override
bool send_date_time_state_response(const DateTimeStateResponse &msg)
bool send_voice_assistant_audio(const VoiceAssistantAudio &msg)
bool send_list_entities_sensor_response(const ListEntitiesSensorResponse &msg)
bool send_list_entities_alarm_control_panel_response(const ListEntitiesAlarmControlPanelResponse &msg)
virtual void on_subscribe_states_request(const SubscribeStatesRequest &value)
void on_bluetooth_gatt_notify_request(const BluetoothGATTNotifyRequest &msg) override
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)
void on_subscribe_states_request(const SubscribeStatesRequest &msg) override
void on_camera_image_request(const CameraImageRequest &msg) override
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)
bool send_list_entities_date_time_response(const ListEntitiesDateTimeResponse &msg)
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)
virtual bool is_authenticated()=0
bool send_list_entities_switch_response(const ListEntitiesSwitchResponse &msg)
virtual void on_get_time_request(const GetTimeRequest &value)
void on_alarm_control_panel_command_request(const AlarmControlPanelCommandRequest &msg) override
bool send_list_entities_date_response(const ListEntitiesDateResponse &msg)
virtual void on_unauthenticated_access()=0
virtual void on_time_command_request(const TimeCommandRequest &value)
virtual void on_fan_command_request(const FanCommandRequest &value)
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
bool send_sensor_state_response(const SensorStateResponse &msg)
bool send_cover_state_response(const CoverStateResponse &msg)
bool send_list_entities_text_response(const ListEntitiesTextResponse &msg)
bool send_list_entities_update_response(const ListEntitiesUpdateResponse &msg)
bool send_list_entities_time_response(const ListEntitiesTimeResponse &msg)
bool send_hello_response(const HelloResponse &msg)
bool send_alarm_control_panel_state_response(const AlarmControlPanelStateResponse &msg)
bool send_list_entities_climate_response(const ListEntitiesClimateResponse &msg)
bool send_disconnect_response(const DisconnectResponse &msg)
void on_climate_command_request(const ClimateCommandRequest &msg) override
virtual void on_valve_command_request(const ValveCommandRequest &value)
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)
void on_lock_command_request(const LockCommandRequest &msg) override
bool send_lock_state_response(const LockStateResponse &msg)
bool send_bluetooth_device_clear_cache_response(const BluetoothDeviceClearCacheResponse &msg)
void on_bluetooth_device_request(const BluetoothDeviceRequest &msg) override
bool send_valve_state_response(const ValveStateResponse &msg)
void on_time_command_request(const TimeCommandRequest &msg) override
virtual void on_device_info_request(const DeviceInfoRequest &value)
bool send_time_state_response(const TimeStateResponse &msg)
bool send_bluetooth_le_raw_advertisements_response(const BluetoothLERawAdvertisementsResponse &msg)
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 bool is_connection_setup()=0
void on_number_command_request(const NumberCommandRequest &msg) override
virtual void on_ping_request(const PingRequest &value)
void on_hello_request(const HelloRequest &msg) override
virtual void on_subscribe_logs_request(const SubscribeLogsRequest &value)
bool send_update_state_response(const UpdateStateResponse &msg)