ESPHome 2025.6.3
Loading...
Searching...
No Matches
api_pb2_service.cpp
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#include "api_pb2_service.h"
4#include "esphome/core/log.h"
5
6namespace esphome {
7namespace api {
8
9static const char *const TAG = "api.service";
10
11#ifdef HAS_PROTO_MESSAGE_DUMP
12void APIServerConnectionBase::log_send_message_(const char *name, const std::string &dump) {
13 ESP_LOGVV(TAG, "send_message %s: %s", name, dump.c_str());
14}
15#endif
16
17bool APIServerConnectionBase::read_message(uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) {
18 switch (msg_type) {
19 case 1: {
20 HelloRequest msg;
21 msg.decode(msg_data, msg_size);
22#ifdef HAS_PROTO_MESSAGE_DUMP
23 ESP_LOGVV(TAG, "on_hello_request: %s", msg.dump().c_str());
24#endif
25 this->on_hello_request(msg);
26 break;
27 }
28 case 3: {
30 msg.decode(msg_data, msg_size);
31#ifdef HAS_PROTO_MESSAGE_DUMP
32 ESP_LOGVV(TAG, "on_connect_request: %s", msg.dump().c_str());
33#endif
34 this->on_connect_request(msg);
35 break;
36 }
37 case 5: {
39 msg.decode(msg_data, msg_size);
40#ifdef HAS_PROTO_MESSAGE_DUMP
41 ESP_LOGVV(TAG, "on_disconnect_request: %s", msg.dump().c_str());
42#endif
43 this->on_disconnect_request(msg);
44 break;
45 }
46 case 6: {
48 msg.decode(msg_data, msg_size);
49#ifdef HAS_PROTO_MESSAGE_DUMP
50 ESP_LOGVV(TAG, "on_disconnect_response: %s", msg.dump().c_str());
51#endif
52 this->on_disconnect_response(msg);
53 break;
54 }
55 case 7: {
56 PingRequest msg;
57 msg.decode(msg_data, msg_size);
58#ifdef HAS_PROTO_MESSAGE_DUMP
59 ESP_LOGVV(TAG, "on_ping_request: %s", msg.dump().c_str());
60#endif
61 this->on_ping_request(msg);
62 break;
63 }
64 case 8: {
65 PingResponse msg;
66 msg.decode(msg_data, msg_size);
67#ifdef HAS_PROTO_MESSAGE_DUMP
68 ESP_LOGVV(TAG, "on_ping_response: %s", msg.dump().c_str());
69#endif
70 this->on_ping_response(msg);
71 break;
72 }
73 case 9: {
75 msg.decode(msg_data, msg_size);
76#ifdef HAS_PROTO_MESSAGE_DUMP
77 ESP_LOGVV(TAG, "on_device_info_request: %s", msg.dump().c_str());
78#endif
79 this->on_device_info_request(msg);
80 break;
81 }
82 case 11: {
84 msg.decode(msg_data, msg_size);
85#ifdef HAS_PROTO_MESSAGE_DUMP
86 ESP_LOGVV(TAG, "on_list_entities_request: %s", msg.dump().c_str());
87#endif
88 this->on_list_entities_request(msg);
89 break;
90 }
91 case 20: {
93 msg.decode(msg_data, msg_size);
94#ifdef HAS_PROTO_MESSAGE_DUMP
95 ESP_LOGVV(TAG, "on_subscribe_states_request: %s", msg.dump().c_str());
96#endif
98 break;
99 }
100 case 28: {
102 msg.decode(msg_data, msg_size);
103#ifdef HAS_PROTO_MESSAGE_DUMP
104 ESP_LOGVV(TAG, "on_subscribe_logs_request: %s", msg.dump().c_str());
105#endif
106 this->on_subscribe_logs_request(msg);
107 break;
108 }
109 case 30: {
110#ifdef USE_COVER
112 msg.decode(msg_data, msg_size);
113#ifdef HAS_PROTO_MESSAGE_DUMP
114 ESP_LOGVV(TAG, "on_cover_command_request: %s", msg.dump().c_str());
115#endif
116 this->on_cover_command_request(msg);
117#endif
118 break;
119 }
120 case 31: {
121#ifdef USE_FAN
123 msg.decode(msg_data, msg_size);
124#ifdef HAS_PROTO_MESSAGE_DUMP
125 ESP_LOGVV(TAG, "on_fan_command_request: %s", msg.dump().c_str());
126#endif
127 this->on_fan_command_request(msg);
128#endif
129 break;
130 }
131 case 32: {
132#ifdef USE_LIGHT
134 msg.decode(msg_data, msg_size);
135#ifdef HAS_PROTO_MESSAGE_DUMP
136 ESP_LOGVV(TAG, "on_light_command_request: %s", msg.dump().c_str());
137#endif
138 this->on_light_command_request(msg);
139#endif
140 break;
141 }
142 case 33: {
143#ifdef USE_SWITCH
145 msg.decode(msg_data, msg_size);
146#ifdef HAS_PROTO_MESSAGE_DUMP
147 ESP_LOGVV(TAG, "on_switch_command_request: %s", msg.dump().c_str());
148#endif
149 this->on_switch_command_request(msg);
150#endif
151 break;
152 }
153 case 34: {
155 msg.decode(msg_data, msg_size);
156#ifdef HAS_PROTO_MESSAGE_DUMP
157 ESP_LOGVV(TAG, "on_subscribe_homeassistant_services_request: %s", msg.dump().c_str());
158#endif
160 break;
161 }
162 case 36: {
163 GetTimeRequest msg;
164 msg.decode(msg_data, msg_size);
165#ifdef HAS_PROTO_MESSAGE_DUMP
166 ESP_LOGVV(TAG, "on_get_time_request: %s", msg.dump().c_str());
167#endif
168 this->on_get_time_request(msg);
169 break;
170 }
171 case 37: {
172 GetTimeResponse msg;
173 msg.decode(msg_data, msg_size);
174#ifdef HAS_PROTO_MESSAGE_DUMP
175 ESP_LOGVV(TAG, "on_get_time_response: %s", msg.dump().c_str());
176#endif
177 this->on_get_time_response(msg);
178 break;
179 }
180 case 38: {
182 msg.decode(msg_data, msg_size);
183#ifdef HAS_PROTO_MESSAGE_DUMP
184 ESP_LOGVV(TAG, "on_subscribe_home_assistant_states_request: %s", msg.dump().c_str());
185#endif
187 break;
188 }
189 case 40: {
191 msg.decode(msg_data, msg_size);
192#ifdef HAS_PROTO_MESSAGE_DUMP
193 ESP_LOGVV(TAG, "on_home_assistant_state_response: %s", msg.dump().c_str());
194#endif
196 break;
197 }
198 case 42: {
200 msg.decode(msg_data, msg_size);
201#ifdef HAS_PROTO_MESSAGE_DUMP
202 ESP_LOGVV(TAG, "on_execute_service_request: %s", msg.dump().c_str());
203#endif
205 break;
206 }
207 case 45: {
208#ifdef USE_ESP32_CAMERA
210 msg.decode(msg_data, msg_size);
211#ifdef HAS_PROTO_MESSAGE_DUMP
212 ESP_LOGVV(TAG, "on_camera_image_request: %s", msg.dump().c_str());
213#endif
214 this->on_camera_image_request(msg);
215#endif
216 break;
217 }
218 case 48: {
219#ifdef USE_CLIMATE
221 msg.decode(msg_data, msg_size);
222#ifdef HAS_PROTO_MESSAGE_DUMP
223 ESP_LOGVV(TAG, "on_climate_command_request: %s", msg.dump().c_str());
224#endif
226#endif
227 break;
228 }
229 case 51: {
230#ifdef USE_NUMBER
232 msg.decode(msg_data, msg_size);
233#ifdef HAS_PROTO_MESSAGE_DUMP
234 ESP_LOGVV(TAG, "on_number_command_request: %s", msg.dump().c_str());
235#endif
236 this->on_number_command_request(msg);
237#endif
238 break;
239 }
240 case 54: {
241#ifdef USE_SELECT
243 msg.decode(msg_data, msg_size);
244#ifdef HAS_PROTO_MESSAGE_DUMP
245 ESP_LOGVV(TAG, "on_select_command_request: %s", msg.dump().c_str());
246#endif
247 this->on_select_command_request(msg);
248#endif
249 break;
250 }
251 case 57: {
252#ifdef USE_SIREN
254 msg.decode(msg_data, msg_size);
255#ifdef HAS_PROTO_MESSAGE_DUMP
256 ESP_LOGVV(TAG, "on_siren_command_request: %s", msg.dump().c_str());
257#endif
258 this->on_siren_command_request(msg);
259#endif
260 break;
261 }
262 case 60: {
263#ifdef USE_LOCK
265 msg.decode(msg_data, msg_size);
266#ifdef HAS_PROTO_MESSAGE_DUMP
267 ESP_LOGVV(TAG, "on_lock_command_request: %s", msg.dump().c_str());
268#endif
269 this->on_lock_command_request(msg);
270#endif
271 break;
272 }
273 case 62: {
274#ifdef USE_BUTTON
276 msg.decode(msg_data, msg_size);
277#ifdef HAS_PROTO_MESSAGE_DUMP
278 ESP_LOGVV(TAG, "on_button_command_request: %s", msg.dump().c_str());
279#endif
280 this->on_button_command_request(msg);
281#endif
282 break;
283 }
284 case 65: {
285#ifdef USE_MEDIA_PLAYER
287 msg.decode(msg_data, msg_size);
288#ifdef HAS_PROTO_MESSAGE_DUMP
289 ESP_LOGVV(TAG, "on_media_player_command_request: %s", msg.dump().c_str());
290#endif
292#endif
293 break;
294 }
295 case 66: {
296#ifdef USE_BLUETOOTH_PROXY
298 msg.decode(msg_data, msg_size);
299#ifdef HAS_PROTO_MESSAGE_DUMP
300 ESP_LOGVV(TAG, "on_subscribe_bluetooth_le_advertisements_request: %s", msg.dump().c_str());
301#endif
303#endif
304 break;
305 }
306 case 68: {
307#ifdef USE_BLUETOOTH_PROXY
309 msg.decode(msg_data, msg_size);
310#ifdef HAS_PROTO_MESSAGE_DUMP
311 ESP_LOGVV(TAG, "on_bluetooth_device_request: %s", msg.dump().c_str());
312#endif
314#endif
315 break;
316 }
317 case 70: {
318#ifdef USE_BLUETOOTH_PROXY
320 msg.decode(msg_data, msg_size);
321#ifdef HAS_PROTO_MESSAGE_DUMP
322 ESP_LOGVV(TAG, "on_bluetooth_gatt_get_services_request: %s", msg.dump().c_str());
323#endif
325#endif
326 break;
327 }
328 case 73: {
329#ifdef USE_BLUETOOTH_PROXY
331 msg.decode(msg_data, msg_size);
332#ifdef HAS_PROTO_MESSAGE_DUMP
333 ESP_LOGVV(TAG, "on_bluetooth_gatt_read_request: %s", msg.dump().c_str());
334#endif
336#endif
337 break;
338 }
339 case 75: {
340#ifdef USE_BLUETOOTH_PROXY
342 msg.decode(msg_data, msg_size);
343#ifdef HAS_PROTO_MESSAGE_DUMP
344 ESP_LOGVV(TAG, "on_bluetooth_gatt_write_request: %s", msg.dump().c_str());
345#endif
347#endif
348 break;
349 }
350 case 76: {
351#ifdef USE_BLUETOOTH_PROXY
353 msg.decode(msg_data, msg_size);
354#ifdef HAS_PROTO_MESSAGE_DUMP
355 ESP_LOGVV(TAG, "on_bluetooth_gatt_read_descriptor_request: %s", msg.dump().c_str());
356#endif
358#endif
359 break;
360 }
361 case 77: {
362#ifdef USE_BLUETOOTH_PROXY
364 msg.decode(msg_data, msg_size);
365#ifdef HAS_PROTO_MESSAGE_DUMP
366 ESP_LOGVV(TAG, "on_bluetooth_gatt_write_descriptor_request: %s", msg.dump().c_str());
367#endif
369#endif
370 break;
371 }
372 case 78: {
373#ifdef USE_BLUETOOTH_PROXY
375 msg.decode(msg_data, msg_size);
376#ifdef HAS_PROTO_MESSAGE_DUMP
377 ESP_LOGVV(TAG, "on_bluetooth_gatt_notify_request: %s", msg.dump().c_str());
378#endif
380#endif
381 break;
382 }
383 case 80: {
384#ifdef USE_BLUETOOTH_PROXY
386 msg.decode(msg_data, msg_size);
387#ifdef HAS_PROTO_MESSAGE_DUMP
388 ESP_LOGVV(TAG, "on_subscribe_bluetooth_connections_free_request: %s", msg.dump().c_str());
389#endif
391#endif
392 break;
393 }
394 case 87: {
395#ifdef USE_BLUETOOTH_PROXY
397 msg.decode(msg_data, msg_size);
398#ifdef HAS_PROTO_MESSAGE_DUMP
399 ESP_LOGVV(TAG, "on_unsubscribe_bluetooth_le_advertisements_request: %s", msg.dump().c_str());
400#endif
402#endif
403 break;
404 }
405 case 89: {
406#ifdef USE_VOICE_ASSISTANT
408 msg.decode(msg_data, msg_size);
409#ifdef HAS_PROTO_MESSAGE_DUMP
410 ESP_LOGVV(TAG, "on_subscribe_voice_assistant_request: %s", msg.dump().c_str());
411#endif
413#endif
414 break;
415 }
416 case 91: {
417#ifdef USE_VOICE_ASSISTANT
419 msg.decode(msg_data, msg_size);
420#ifdef HAS_PROTO_MESSAGE_DUMP
421 ESP_LOGVV(TAG, "on_voice_assistant_response: %s", msg.dump().c_str());
422#endif
424#endif
425 break;
426 }
427 case 92: {
428#ifdef USE_VOICE_ASSISTANT
430 msg.decode(msg_data, msg_size);
431#ifdef HAS_PROTO_MESSAGE_DUMP
432 ESP_LOGVV(TAG, "on_voice_assistant_event_response: %s", msg.dump().c_str());
433#endif
435#endif
436 break;
437 }
438 case 96: {
439#ifdef USE_ALARM_CONTROL_PANEL
441 msg.decode(msg_data, msg_size);
442#ifdef HAS_PROTO_MESSAGE_DUMP
443 ESP_LOGVV(TAG, "on_alarm_control_panel_command_request: %s", msg.dump().c_str());
444#endif
446#endif
447 break;
448 }
449 case 99: {
450#ifdef USE_TEXT
452 msg.decode(msg_data, msg_size);
453#ifdef HAS_PROTO_MESSAGE_DUMP
454 ESP_LOGVV(TAG, "on_text_command_request: %s", msg.dump().c_str());
455#endif
456 this->on_text_command_request(msg);
457#endif
458 break;
459 }
460 case 102: {
461#ifdef USE_DATETIME_DATE
463 msg.decode(msg_data, msg_size);
464#ifdef HAS_PROTO_MESSAGE_DUMP
465 ESP_LOGVV(TAG, "on_date_command_request: %s", msg.dump().c_str());
466#endif
467 this->on_date_command_request(msg);
468#endif
469 break;
470 }
471 case 105: {
472#ifdef USE_DATETIME_TIME
474 msg.decode(msg_data, msg_size);
475#ifdef HAS_PROTO_MESSAGE_DUMP
476 ESP_LOGVV(TAG, "on_time_command_request: %s", msg.dump().c_str());
477#endif
478 this->on_time_command_request(msg);
479#endif
480 break;
481 }
482 case 106: {
483#ifdef USE_VOICE_ASSISTANT
485 msg.decode(msg_data, msg_size);
486#ifdef HAS_PROTO_MESSAGE_DUMP
487 ESP_LOGVV(TAG, "on_voice_assistant_audio: %s", msg.dump().c_str());
488#endif
489 this->on_voice_assistant_audio(msg);
490#endif
491 break;
492 }
493 case 111: {
494#ifdef USE_VALVE
496 msg.decode(msg_data, msg_size);
497#ifdef HAS_PROTO_MESSAGE_DUMP
498 ESP_LOGVV(TAG, "on_valve_command_request: %s", msg.dump().c_str());
499#endif
500 this->on_valve_command_request(msg);
501#endif
502 break;
503 }
504 case 114: {
505#ifdef USE_DATETIME_DATETIME
507 msg.decode(msg_data, msg_size);
508#ifdef HAS_PROTO_MESSAGE_DUMP
509 ESP_LOGVV(TAG, "on_date_time_command_request: %s", msg.dump().c_str());
510#endif
512#endif
513 break;
514 }
515 case 115: {
516#ifdef USE_VOICE_ASSISTANT
518 msg.decode(msg_data, msg_size);
519#ifdef HAS_PROTO_MESSAGE_DUMP
520 ESP_LOGVV(TAG, "on_voice_assistant_timer_event_response: %s", msg.dump().c_str());
521#endif
523#endif
524 break;
525 }
526 case 118: {
527#ifdef USE_UPDATE
529 msg.decode(msg_data, msg_size);
530#ifdef HAS_PROTO_MESSAGE_DUMP
531 ESP_LOGVV(TAG, "on_update_command_request: %s", msg.dump().c_str());
532#endif
533 this->on_update_command_request(msg);
534#endif
535 break;
536 }
537 case 119: {
538#ifdef USE_VOICE_ASSISTANT
540 msg.decode(msg_data, msg_size);
541#ifdef HAS_PROTO_MESSAGE_DUMP
542 ESP_LOGVV(TAG, "on_voice_assistant_announce_request: %s", msg.dump().c_str());
543#endif
545#endif
546 break;
547 }
548 case 121: {
549#ifdef USE_VOICE_ASSISTANT
551 msg.decode(msg_data, msg_size);
552#ifdef HAS_PROTO_MESSAGE_DUMP
553 ESP_LOGVV(TAG, "on_voice_assistant_configuration_request: %s", msg.dump().c_str());
554#endif
556#endif
557 break;
558 }
559 case 123: {
560#ifdef USE_VOICE_ASSISTANT
562 msg.decode(msg_data, msg_size);
563#ifdef HAS_PROTO_MESSAGE_DUMP
564 ESP_LOGVV(TAG, "on_voice_assistant_set_configuration: %s", msg.dump().c_str());
565#endif
567#endif
568 break;
569 }
570 case 124: {
571#ifdef USE_API_NOISE
573 msg.decode(msg_data, msg_size);
574#ifdef HAS_PROTO_MESSAGE_DUMP
575 ESP_LOGVV(TAG, "on_noise_encryption_set_key_request: %s", msg.dump().c_str());
576#endif
578#endif
579 break;
580 }
581 case 127: {
582#ifdef USE_BLUETOOTH_PROXY
584 msg.decode(msg_data, msg_size);
585#ifdef HAS_PROTO_MESSAGE_DUMP
586 ESP_LOGVV(TAG, "on_bluetooth_scanner_set_mode_request: %s", msg.dump().c_str());
587#endif
589#endif
590 break;
591 }
592 default:
593 return false;
594 }
595 return true;
596}
597
599 HelloResponse ret = this->hello(msg);
600 if (!this->send_message(ret)) {
601 this->on_fatal_error();
602 }
603}
605 ConnectResponse ret = this->connect(msg);
606 if (!this->send_message(ret)) {
607 this->on_fatal_error();
608 }
609}
611 DisconnectResponse ret = this->disconnect(msg);
612 if (!this->send_message(ret)) {
613 this->on_fatal_error();
614 }
615}
617 PingResponse ret = this->ping(msg);
618 if (!this->send_message(ret)) {
619 this->on_fatal_error();
620 }
621}
623 if (!this->is_connection_setup()) {
625 return;
626 }
627 DeviceInfoResponse ret = this->device_info(msg);
628 if (!this->send_message(ret)) {
629 this->on_fatal_error();
630 }
631}
633 if (!this->is_connection_setup()) {
635 return;
636 }
637 if (!this->is_authenticated()) {
639 return;
640 }
641 this->list_entities(msg);
642}
644 if (!this->is_connection_setup()) {
646 return;
647 }
648 if (!this->is_authenticated()) {
650 return;
651 }
652 this->subscribe_states(msg);
653}
655 if (!this->is_connection_setup()) {
657 return;
658 }
659 if (!this->is_authenticated()) {
661 return;
662 }
663 this->subscribe_logs(msg);
664}
667 if (!this->is_connection_setup()) {
669 return;
670 }
671 if (!this->is_authenticated()) {
673 return;
674 }
676}
678 if (!this->is_connection_setup()) {
680 return;
681 }
682 if (!this->is_authenticated()) {
684 return;
685 }
687}
689 if (!this->is_connection_setup()) {
691 return;
692 }
693 GetTimeResponse ret = this->get_time(msg);
694 if (!this->send_message(ret)) {
695 this->on_fatal_error();
696 }
697}
699 if (!this->is_connection_setup()) {
701 return;
702 }
703 if (!this->is_authenticated()) {
705 return;
706 }
707 this->execute_service(msg);
708}
709#ifdef USE_API_NOISE
711 if (!this->is_connection_setup()) {
713 return;
714 }
715 if (!this->is_authenticated()) {
717 return;
718 }
720 if (!this->send_message(ret)) {
721 this->on_fatal_error();
722 }
723}
724#endif
725#ifdef USE_BUTTON
727 if (!this->is_connection_setup()) {
729 return;
730 }
731 if (!this->is_authenticated()) {
733 return;
734 }
735 this->button_command(msg);
736}
737#endif
738#ifdef USE_ESP32_CAMERA
740 if (!this->is_connection_setup()) {
742 return;
743 }
744 if (!this->is_authenticated()) {
746 return;
747 }
748 this->camera_image(msg);
749}
750#endif
751#ifdef USE_CLIMATE
753 if (!this->is_connection_setup()) {
755 return;
756 }
757 if (!this->is_authenticated()) {
759 return;
760 }
761 this->climate_command(msg);
762}
763#endif
764#ifdef USE_COVER
766 if (!this->is_connection_setup()) {
768 return;
769 }
770 if (!this->is_authenticated()) {
772 return;
773 }
774 this->cover_command(msg);
775}
776#endif
777#ifdef USE_DATETIME_DATE
779 if (!this->is_connection_setup()) {
781 return;
782 }
783 if (!this->is_authenticated()) {
785 return;
786 }
787 this->date_command(msg);
788}
789#endif
790#ifdef USE_DATETIME_DATETIME
792 if (!this->is_connection_setup()) {
794 return;
795 }
796 if (!this->is_authenticated()) {
798 return;
799 }
800 this->datetime_command(msg);
801}
802#endif
803#ifdef USE_FAN
805 if (!this->is_connection_setup()) {
807 return;
808 }
809 if (!this->is_authenticated()) {
811 return;
812 }
813 this->fan_command(msg);
814}
815#endif
816#ifdef USE_LIGHT
818 if (!this->is_connection_setup()) {
820 return;
821 }
822 if (!this->is_authenticated()) {
824 return;
825 }
826 this->light_command(msg);
827}
828#endif
829#ifdef USE_LOCK
831 if (!this->is_connection_setup()) {
833 return;
834 }
835 if (!this->is_authenticated()) {
837 return;
838 }
839 this->lock_command(msg);
840}
841#endif
842#ifdef USE_MEDIA_PLAYER
844 if (!this->is_connection_setup()) {
846 return;
847 }
848 if (!this->is_authenticated()) {
850 return;
851 }
852 this->media_player_command(msg);
853}
854#endif
855#ifdef USE_NUMBER
857 if (!this->is_connection_setup()) {
859 return;
860 }
861 if (!this->is_authenticated()) {
863 return;
864 }
865 this->number_command(msg);
866}
867#endif
868#ifdef USE_SELECT
870 if (!this->is_connection_setup()) {
872 return;
873 }
874 if (!this->is_authenticated()) {
876 return;
877 }
878 this->select_command(msg);
879}
880#endif
881#ifdef USE_SIREN
883 if (!this->is_connection_setup()) {
885 return;
886 }
887 if (!this->is_authenticated()) {
889 return;
890 }
891 this->siren_command(msg);
892}
893#endif
894#ifdef USE_SWITCH
896 if (!this->is_connection_setup()) {
898 return;
899 }
900 if (!this->is_authenticated()) {
902 return;
903 }
904 this->switch_command(msg);
905}
906#endif
907#ifdef USE_TEXT
909 if (!this->is_connection_setup()) {
911 return;
912 }
913 if (!this->is_authenticated()) {
915 return;
916 }
917 this->text_command(msg);
918}
919#endif
920#ifdef USE_DATETIME_TIME
922 if (!this->is_connection_setup()) {
924 return;
925 }
926 if (!this->is_authenticated()) {
928 return;
929 }
930 this->time_command(msg);
931}
932#endif
933#ifdef USE_UPDATE
935 if (!this->is_connection_setup()) {
937 return;
938 }
939 if (!this->is_authenticated()) {
941 return;
942 }
943 this->update_command(msg);
944}
945#endif
946#ifdef USE_VALVE
948 if (!this->is_connection_setup()) {
950 return;
951 }
952 if (!this->is_authenticated()) {
954 return;
955 }
956 this->valve_command(msg);
957}
958#endif
959#ifdef USE_BLUETOOTH_PROXY
972#endif
973#ifdef USE_BLUETOOTH_PROXY
975 if (!this->is_connection_setup()) {
977 return;
978 }
979 if (!this->is_authenticated()) {
981 return;
982 }
983 this->bluetooth_device_request(msg);
984}
985#endif
986#ifdef USE_BLUETOOTH_PROXY
988 if (!this->is_connection_setup()) {
990 return;
991 }
992 if (!this->is_authenticated()) {
994 return;
995 }
997}
998#endif
999#ifdef USE_BLUETOOTH_PROXY
1001 if (!this->is_connection_setup()) {
1002 this->on_no_setup_connection();
1003 return;
1004 }
1005 if (!this->is_authenticated()) {
1007 return;
1008 }
1009 this->bluetooth_gatt_read(msg);
1010}
1011#endif
1012#ifdef USE_BLUETOOTH_PROXY
1014 if (!this->is_connection_setup()) {
1015 this->on_no_setup_connection();
1016 return;
1017 }
1018 if (!this->is_authenticated()) {
1020 return;
1021 }
1022 this->bluetooth_gatt_write(msg);
1023}
1024#endif
1025#ifdef USE_BLUETOOTH_PROXY
1027 if (!this->is_connection_setup()) {
1028 this->on_no_setup_connection();
1029 return;
1030 }
1031 if (!this->is_authenticated()) {
1033 return;
1034 }
1036}
1037#endif
1038#ifdef USE_BLUETOOTH_PROXY
1040 if (!this->is_connection_setup()) {
1041 this->on_no_setup_connection();
1042 return;
1043 }
1044 if (!this->is_authenticated()) {
1046 return;
1047 }
1049}
1050#endif
1051#ifdef USE_BLUETOOTH_PROXY
1053 if (!this->is_connection_setup()) {
1054 this->on_no_setup_connection();
1055 return;
1056 }
1057 if (!this->is_authenticated()) {
1059 return;
1060 }
1061 this->bluetooth_gatt_notify(msg);
1062}
1063#endif
1064#ifdef USE_BLUETOOTH_PROXY
1067 if (!this->is_connection_setup()) {
1068 this->on_no_setup_connection();
1069 return;
1070 }
1071 if (!this->is_authenticated()) {
1073 return;
1074 }
1076 if (!this->send_message(ret)) {
1077 this->on_fatal_error();
1078 }
1079}
1080#endif
1081#ifdef USE_BLUETOOTH_PROXY
1084 if (!this->is_connection_setup()) {
1085 this->on_no_setup_connection();
1086 return;
1087 }
1088 if (!this->is_authenticated()) {
1090 return;
1091 }
1093}
1094#endif
1095#ifdef USE_BLUETOOTH_PROXY
1097 if (!this->is_connection_setup()) {
1098 this->on_no_setup_connection();
1099 return;
1100 }
1101 if (!this->is_authenticated()) {
1103 return;
1104 }
1105 this->bluetooth_scanner_set_mode(msg);
1106}
1107#endif
1108#ifdef USE_VOICE_ASSISTANT
1110 if (!this->is_connection_setup()) {
1111 this->on_no_setup_connection();
1112 return;
1113 }
1114 if (!this->is_authenticated()) {
1116 return;
1117 }
1118 this->subscribe_voice_assistant(msg);
1119}
1120#endif
1121#ifdef USE_VOICE_ASSISTANT
1123 if (!this->is_connection_setup()) {
1124 this->on_no_setup_connection();
1125 return;
1126 }
1127 if (!this->is_authenticated()) {
1129 return;
1130 }
1132 if (!this->send_message(ret)) {
1133 this->on_fatal_error();
1134 }
1135}
1136#endif
1137#ifdef USE_VOICE_ASSISTANT
1139 if (!this->is_connection_setup()) {
1140 this->on_no_setup_connection();
1141 return;
1142 }
1143 if (!this->is_authenticated()) {
1145 return;
1146 }
1148}
1149#endif
1150#ifdef USE_ALARM_CONTROL_PANEL
1152 if (!this->is_connection_setup()) {
1153 this->on_no_setup_connection();
1154 return;
1155 }
1156 if (!this->is_authenticated()) {
1158 return;
1159 }
1160 this->alarm_control_panel_command(msg);
1161}
1162#endif
1163
1164} // namespace api
1165} // namespace esphome
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_subscribe_home_assistant_states_request(const SubscribeHomeAssistantStatesRequest &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)
virtual void on_voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &value)
virtual void on_bluetooth_gatt_read_descriptor_request(const BluetoothGATTReadDescriptorRequest &value)
virtual void on_list_entities_request(const ListEntitiesRequest &value)
virtual void on_noise_encryption_set_key_request(const NoiseEncryptionSetKeyRequest &value)
bool read_message(uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) override
virtual void on_lock_command_request(const LockCommandRequest &value)
virtual void on_media_player_command_request(const MediaPlayerCommandRequest &value)
virtual void on_bluetooth_gatt_write_request(const BluetoothGATTWriteRequest &value)
virtual void on_subscribe_states_request(const SubscribeStatesRequest &value)
virtual void on_ping_response(const PingResponse &value)
virtual void on_valve_command_request(const ValveCommandRequest &value)
virtual void on_bluetooth_gatt_read_request(const BluetoothGATTReadRequest &value)
virtual void on_disconnect_request(const DisconnectRequest &value)
void log_send_message_(const char *name, const std::string &dump)
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_camera_image_request(const CameraImageRequest &value)
virtual void on_subscribe_logs_request(const SubscribeLogsRequest &value)
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_connect_request(const ConnectRequest &value)
virtual void on_voice_assistant_announce_request(const VoiceAssistantAnnounceRequest &value)
virtual void on_climate_command_request(const ClimateCommandRequest &value)
virtual void on_ping_request(const PingRequest &value)
virtual void on_get_time_request(const GetTimeRequest &value)
virtual void on_voice_assistant_response(const VoiceAssistantResponse &value)
virtual void on_light_command_request(const LightCommandRequest &value)
virtual void on_subscribe_bluetooth_connections_free_request(const SubscribeBluetoothConnectionsFreeRequest &value)
virtual void on_date_time_command_request(const DateTimeCommandRequest &value)
virtual void on_subscribe_homeassistant_services_request(const SubscribeHomeassistantServicesRequest &value)
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)
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)
virtual void on_unsubscribe_bluetooth_le_advertisements_request(const UnsubscribeBluetoothLEAdvertisementsRequest &value)
virtual void on_update_command_request(const UpdateCommandRequest &value)
virtual void on_disconnect_response(const DisconnectResponse &value)
virtual void on_device_info_request(const DeviceInfoRequest &value)
virtual void on_time_command_request(const TimeCommandRequest &value)
virtual DisconnectResponse disconnect(const DisconnectRequest &msg)=0
virtual void voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &msg)=0
void on_media_player_command_request(const MediaPlayerCommandRequest &msg) override
void on_subscribe_bluetooth_connections_free_request(const SubscribeBluetoothConnectionsFreeRequest &msg) override
void on_number_command_request(const NumberCommandRequest &msg) override
virtual void lock_command(const LockCommandRequest &msg)=0
virtual void text_command(const TextCommandRequest &msg)=0
void on_ping_request(const PingRequest &msg) override
virtual void subscribe_logs(const SubscribeLogsRequest &msg)=0
void on_subscribe_logs_request(const SubscribeLogsRequest &msg) override
virtual void light_command(const LightCommandRequest &msg)=0
void on_device_info_request(const DeviceInfoRequest &msg) override
void on_camera_image_request(const CameraImageRequest &msg) override
virtual HelloResponse hello(const HelloRequest &msg)=0
virtual void select_command(const SelectCommandRequest &msg)=0
virtual VoiceAssistantConfigurationResponse voice_assistant_get_configuration(const VoiceAssistantConfigurationRequest &msg)=0
virtual void unsubscribe_bluetooth_le_advertisements(const UnsubscribeBluetoothLEAdvertisementsRequest &msg)=0
virtual void camera_image(const CameraImageRequest &msg)=0
virtual BluetoothConnectionsFreeResponse subscribe_bluetooth_connections_free(const SubscribeBluetoothConnectionsFreeRequest &msg)=0
void on_date_time_command_request(const DateTimeCommandRequest &msg) override
void on_bluetooth_gatt_write_request(const BluetoothGATTWriteRequest &msg) override
void on_update_command_request(const UpdateCommandRequest &msg) override
virtual void valve_command(const ValveCommandRequest &msg)=0
void on_get_time_request(const GetTimeRequest &msg) override
virtual void bluetooth_gatt_get_services(const BluetoothGATTGetServicesRequest &msg)=0
void on_bluetooth_gatt_notify_request(const BluetoothGATTNotifyRequest &msg) override
void on_text_command_request(const TextCommandRequest &msg) override
void on_select_command_request(const SelectCommandRequest &msg) override
virtual void climate_command(const ClimateCommandRequest &msg)=0
virtual void execute_service(const ExecuteServiceRequest &msg)=0
void on_lock_command_request(const LockCommandRequest &msg) override
void on_execute_service_request(const ExecuteServiceRequest &msg) override
void on_button_command_request(const ButtonCommandRequest &msg) override
virtual GetTimeResponse get_time(const GetTimeRequest &msg)=0
virtual void bluetooth_gatt_read_descriptor(const BluetoothGATTReadDescriptorRequest &msg)=0
void on_list_entities_request(const ListEntitiesRequest &msg) override
virtual void bluetooth_device_request(const BluetoothDeviceRequest &msg)=0
virtual void subscribe_home_assistant_states(const SubscribeHomeAssistantStatesRequest &msg)=0
void on_siren_command_request(const SirenCommandRequest &msg) override
virtual void fan_command(const FanCommandRequest &msg)=0
void on_subscribe_home_assistant_states_request(const SubscribeHomeAssistantStatesRequest &msg) override
void on_subscribe_voice_assistant_request(const SubscribeVoiceAssistantRequest &msg) override
void on_hello_request(const HelloRequest &msg) override
void on_climate_command_request(const ClimateCommandRequest &msg) override
virtual void list_entities(const ListEntitiesRequest &msg)=0
void on_subscribe_bluetooth_le_advertisements_request(const SubscribeBluetoothLEAdvertisementsRequest &msg) override
virtual void number_command(const NumberCommandRequest &msg)=0
void on_unsubscribe_bluetooth_le_advertisements_request(const UnsubscribeBluetoothLEAdvertisementsRequest &msg) override
void on_connect_request(const ConnectRequest &msg) override
void on_fan_command_request(const FanCommandRequest &msg) override
virtual void bluetooth_gatt_read(const BluetoothGATTReadRequest &msg)=0
void on_subscribe_homeassistant_services_request(const SubscribeHomeassistantServicesRequest &msg) override
virtual void bluetooth_gatt_write(const BluetoothGATTWriteRequest &msg)=0
virtual void button_command(const ButtonCommandRequest &msg)=0
virtual void siren_command(const SirenCommandRequest &msg)=0
virtual void bluetooth_gatt_notify(const BluetoothGATTNotifyRequest &msg)=0
virtual DeviceInfoResponse device_info(const DeviceInfoRequest &msg)=0
void on_alarm_control_panel_command_request(const AlarmControlPanelCommandRequest &msg) override
virtual void time_command(const TimeCommandRequest &msg)=0
virtual ConnectResponse connect(const ConnectRequest &msg)=0
virtual void subscribe_voice_assistant(const SubscribeVoiceAssistantRequest &msg)=0
virtual PingResponse ping(const PingRequest &msg)=0
void on_bluetooth_gatt_get_services_request(const BluetoothGATTGetServicesRequest &msg) override
virtual void cover_command(const CoverCommandRequest &msg)=0
virtual void bluetooth_scanner_set_mode(const BluetoothScannerSetModeRequest &msg)=0
virtual void update_command(const UpdateCommandRequest &msg)=0
virtual void subscribe_states(const SubscribeStatesRequest &msg)=0
virtual void switch_command(const SwitchCommandRequest &msg)=0
void on_bluetooth_gatt_read_request(const BluetoothGATTReadRequest &msg) override
virtual void datetime_command(const DateTimeCommandRequest &msg)=0
void on_bluetooth_scanner_set_mode_request(const BluetoothScannerSetModeRequest &msg) override
void on_date_command_request(const DateCommandRequest &msg) override
void on_time_command_request(const TimeCommandRequest &msg) override
virtual void bluetooth_gatt_write_descriptor(const BluetoothGATTWriteDescriptorRequest &msg)=0
virtual void subscribe_homeassistant_services(const SubscribeHomeassistantServicesRequest &msg)=0
void on_disconnect_request(const DisconnectRequest &msg) override
virtual void date_command(const DateCommandRequest &msg)=0
void on_voice_assistant_configuration_request(const VoiceAssistantConfigurationRequest &msg) override
void on_cover_command_request(const CoverCommandRequest &msg) override
void on_valve_command_request(const ValveCommandRequest &msg) override
virtual NoiseEncryptionSetKeyResponse noise_encryption_set_key(const NoiseEncryptionSetKeyRequest &msg)=0
void on_light_command_request(const LightCommandRequest &msg) override
virtual void alarm_control_panel_command(const AlarmControlPanelCommandRequest &msg)=0
virtual void media_player_command(const MediaPlayerCommandRequest &msg)=0
void on_voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &msg) override
void on_bluetooth_device_request(const BluetoothDeviceRequest &msg) override
void on_bluetooth_gatt_read_descriptor_request(const BluetoothGATTReadDescriptorRequest &msg) override
void on_subscribe_states_request(const SubscribeStatesRequest &msg) override
void on_bluetooth_gatt_write_descriptor_request(const BluetoothGATTWriteDescriptorRequest &msg) override
virtual void subscribe_bluetooth_le_advertisements(const SubscribeBluetoothLEAdvertisementsRequest &msg)=0
void on_noise_encryption_set_key_request(const NoiseEncryptionSetKeyRequest &msg) override
void on_switch_command_request(const SwitchCommandRequest &msg) override
std::string dump() const
Definition proto.cpp:85
void decode(const uint8_t *buffer, size_t length)
Definition proto.cpp:11
virtual void on_unauthenticated_access()=0
virtual void on_fatal_error()=0
virtual bool is_connection_setup()=0
virtual bool is_authenticated()=0
virtual void on_no_setup_connection()=0
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7