ESPHome  2024.10.2
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_VOICE_ASSISTANT
490 #endif
491 #ifdef USE_VOICE_ASSISTANT
493 #ifdef HAS_PROTO_MESSAGE_DUMP
494  ESP_LOGVV(TAG, "send_voice_assistant_announce_finished: %s", msg.dump().c_str());
495 #endif
496  return this->send_message_<VoiceAssistantAnnounceFinished>(msg, 120);
497 }
498 #endif
499 #ifdef USE_VOICE_ASSISTANT
500 #endif
501 #ifdef USE_VOICE_ASSISTANT
504 #ifdef HAS_PROTO_MESSAGE_DUMP
505  ESP_LOGVV(TAG, "send_voice_assistant_configuration_response: %s", msg.dump().c_str());
506 #endif
507  return this->send_message_<VoiceAssistantConfigurationResponse>(msg, 122);
508 }
509 #endif
510 #ifdef USE_VOICE_ASSISTANT
511 #endif
512 #ifdef USE_ALARM_CONTROL_PANEL
515 #ifdef HAS_PROTO_MESSAGE_DUMP
516  ESP_LOGVV(TAG, "send_list_entities_alarm_control_panel_response: %s", msg.dump().c_str());
517 #endif
518  return this->send_message_<ListEntitiesAlarmControlPanelResponse>(msg, 94);
519 }
520 #endif
521 #ifdef USE_ALARM_CONTROL_PANEL
523 #ifdef HAS_PROTO_MESSAGE_DUMP
524  ESP_LOGVV(TAG, "send_alarm_control_panel_state_response: %s", msg.dump().c_str());
525 #endif
526  return this->send_message_<AlarmControlPanelStateResponse>(msg, 95);
527 }
528 #endif
529 #ifdef USE_ALARM_CONTROL_PANEL
530 #endif
531 #ifdef USE_TEXT
533 #ifdef HAS_PROTO_MESSAGE_DUMP
534  ESP_LOGVV(TAG, "send_list_entities_text_response: %s", msg.dump().c_str());
535 #endif
536  return this->send_message_<ListEntitiesTextResponse>(msg, 97);
537 }
538 #endif
539 #ifdef USE_TEXT
541 #ifdef HAS_PROTO_MESSAGE_DUMP
542  ESP_LOGVV(TAG, "send_text_state_response: %s", msg.dump().c_str());
543 #endif
544  return this->send_message_<TextStateResponse>(msg, 98);
545 }
546 #endif
547 #ifdef USE_TEXT
548 #endif
549 #ifdef USE_DATETIME_DATE
551 #ifdef HAS_PROTO_MESSAGE_DUMP
552  ESP_LOGVV(TAG, "send_list_entities_date_response: %s", msg.dump().c_str());
553 #endif
554  return this->send_message_<ListEntitiesDateResponse>(msg, 100);
555 }
556 #endif
557 #ifdef USE_DATETIME_DATE
559 #ifdef HAS_PROTO_MESSAGE_DUMP
560  ESP_LOGVV(TAG, "send_date_state_response: %s", msg.dump().c_str());
561 #endif
562  return this->send_message_<DateStateResponse>(msg, 101);
563 }
564 #endif
565 #ifdef USE_DATETIME_DATE
566 #endif
567 #ifdef USE_DATETIME_TIME
569 #ifdef HAS_PROTO_MESSAGE_DUMP
570  ESP_LOGVV(TAG, "send_list_entities_time_response: %s", msg.dump().c_str());
571 #endif
572  return this->send_message_<ListEntitiesTimeResponse>(msg, 103);
573 }
574 #endif
575 #ifdef USE_DATETIME_TIME
577 #ifdef HAS_PROTO_MESSAGE_DUMP
578  ESP_LOGVV(TAG, "send_time_state_response: %s", msg.dump().c_str());
579 #endif
580  return this->send_message_<TimeStateResponse>(msg, 104);
581 }
582 #endif
583 #ifdef USE_DATETIME_TIME
584 #endif
585 #ifdef USE_EVENT
587 #ifdef HAS_PROTO_MESSAGE_DUMP
588  ESP_LOGVV(TAG, "send_list_entities_event_response: %s", msg.dump().c_str());
589 #endif
590  return this->send_message_<ListEntitiesEventResponse>(msg, 107);
591 }
592 #endif
593 #ifdef USE_EVENT
595 #ifdef HAS_PROTO_MESSAGE_DUMP
596  ESP_LOGVV(TAG, "send_event_response: %s", msg.dump().c_str());
597 #endif
598  return this->send_message_<EventResponse>(msg, 108);
599 }
600 #endif
601 #ifdef USE_VALVE
603 #ifdef HAS_PROTO_MESSAGE_DUMP
604  ESP_LOGVV(TAG, "send_list_entities_valve_response: %s", msg.dump().c_str());
605 #endif
606  return this->send_message_<ListEntitiesValveResponse>(msg, 109);
607 }
608 #endif
609 #ifdef USE_VALVE
611 #ifdef HAS_PROTO_MESSAGE_DUMP
612  ESP_LOGVV(TAG, "send_valve_state_response: %s", msg.dump().c_str());
613 #endif
614  return this->send_message_<ValveStateResponse>(msg, 110);
615 }
616 #endif
617 #ifdef USE_VALVE
618 #endif
619 #ifdef USE_DATETIME_DATETIME
621 #ifdef HAS_PROTO_MESSAGE_DUMP
622  ESP_LOGVV(TAG, "send_list_entities_date_time_response: %s", msg.dump().c_str());
623 #endif
624  return this->send_message_<ListEntitiesDateTimeResponse>(msg, 112);
625 }
626 #endif
627 #ifdef USE_DATETIME_DATETIME
629 #ifdef HAS_PROTO_MESSAGE_DUMP
630  ESP_LOGVV(TAG, "send_date_time_state_response: %s", msg.dump().c_str());
631 #endif
632  return this->send_message_<DateTimeStateResponse>(msg, 113);
633 }
634 #endif
635 #ifdef USE_DATETIME_DATETIME
636 #endif
637 #ifdef USE_UPDATE
639 #ifdef HAS_PROTO_MESSAGE_DUMP
640  ESP_LOGVV(TAG, "send_list_entities_update_response: %s", msg.dump().c_str());
641 #endif
642  return this->send_message_<ListEntitiesUpdateResponse>(msg, 116);
643 }
644 #endif
645 #ifdef USE_UPDATE
647 #ifdef HAS_PROTO_MESSAGE_DUMP
648  ESP_LOGVV(TAG, "send_update_state_response: %s", msg.dump().c_str());
649 #endif
650  return this->send_message_<UpdateStateResponse>(msg, 117);
651 }
652 #endif
653 #ifdef USE_UPDATE
654 #endif
655 bool APIServerConnectionBase::read_message(uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) {
656  switch (msg_type) {
657  case 1: {
658  HelloRequest msg;
659  msg.decode(msg_data, msg_size);
660 #ifdef HAS_PROTO_MESSAGE_DUMP
661  ESP_LOGVV(TAG, "on_hello_request: %s", msg.dump().c_str());
662 #endif
663  this->on_hello_request(msg);
664  break;
665  }
666  case 3: {
667  ConnectRequest msg;
668  msg.decode(msg_data, msg_size);
669 #ifdef HAS_PROTO_MESSAGE_DUMP
670  ESP_LOGVV(TAG, "on_connect_request: %s", msg.dump().c_str());
671 #endif
672  this->on_connect_request(msg);
673  break;
674  }
675  case 5: {
676  DisconnectRequest msg;
677  msg.decode(msg_data, msg_size);
678 #ifdef HAS_PROTO_MESSAGE_DUMP
679  ESP_LOGVV(TAG, "on_disconnect_request: %s", msg.dump().c_str());
680 #endif
681  this->on_disconnect_request(msg);
682  break;
683  }
684  case 6: {
685  DisconnectResponse msg;
686  msg.decode(msg_data, msg_size);
687 #ifdef HAS_PROTO_MESSAGE_DUMP
688  ESP_LOGVV(TAG, "on_disconnect_response: %s", msg.dump().c_str());
689 #endif
690  this->on_disconnect_response(msg);
691  break;
692  }
693  case 7: {
694  PingRequest msg;
695  msg.decode(msg_data, msg_size);
696 #ifdef HAS_PROTO_MESSAGE_DUMP
697  ESP_LOGVV(TAG, "on_ping_request: %s", msg.dump().c_str());
698 #endif
699  this->on_ping_request(msg);
700  break;
701  }
702  case 8: {
703  PingResponse msg;
704  msg.decode(msg_data, msg_size);
705 #ifdef HAS_PROTO_MESSAGE_DUMP
706  ESP_LOGVV(TAG, "on_ping_response: %s", msg.dump().c_str());
707 #endif
708  this->on_ping_response(msg);
709  break;
710  }
711  case 9: {
712  DeviceInfoRequest msg;
713  msg.decode(msg_data, msg_size);
714 #ifdef HAS_PROTO_MESSAGE_DUMP
715  ESP_LOGVV(TAG, "on_device_info_request: %s", msg.dump().c_str());
716 #endif
717  this->on_device_info_request(msg);
718  break;
719  }
720  case 11: {
722  msg.decode(msg_data, msg_size);
723 #ifdef HAS_PROTO_MESSAGE_DUMP
724  ESP_LOGVV(TAG, "on_list_entities_request: %s", msg.dump().c_str());
725 #endif
726  this->on_list_entities_request(msg);
727  break;
728  }
729  case 20: {
731  msg.decode(msg_data, msg_size);
732 #ifdef HAS_PROTO_MESSAGE_DUMP
733  ESP_LOGVV(TAG, "on_subscribe_states_request: %s", msg.dump().c_str());
734 #endif
735  this->on_subscribe_states_request(msg);
736  break;
737  }
738  case 28: {
740  msg.decode(msg_data, msg_size);
741 #ifdef HAS_PROTO_MESSAGE_DUMP
742  ESP_LOGVV(TAG, "on_subscribe_logs_request: %s", msg.dump().c_str());
743 #endif
744  this->on_subscribe_logs_request(msg);
745  break;
746  }
747  case 30: {
748 #ifdef USE_COVER
750  msg.decode(msg_data, msg_size);
751 #ifdef HAS_PROTO_MESSAGE_DUMP
752  ESP_LOGVV(TAG, "on_cover_command_request: %s", msg.dump().c_str());
753 #endif
754  this->on_cover_command_request(msg);
755 #endif
756  break;
757  }
758  case 31: {
759 #ifdef USE_FAN
760  FanCommandRequest msg;
761  msg.decode(msg_data, msg_size);
762 #ifdef HAS_PROTO_MESSAGE_DUMP
763  ESP_LOGVV(TAG, "on_fan_command_request: %s", msg.dump().c_str());
764 #endif
765  this->on_fan_command_request(msg);
766 #endif
767  break;
768  }
769  case 32: {
770 #ifdef USE_LIGHT
772  msg.decode(msg_data, msg_size);
773 #ifdef HAS_PROTO_MESSAGE_DUMP
774  ESP_LOGVV(TAG, "on_light_command_request: %s", msg.dump().c_str());
775 #endif
776  this->on_light_command_request(msg);
777 #endif
778  break;
779  }
780  case 33: {
781 #ifdef USE_SWITCH
783  msg.decode(msg_data, msg_size);
784 #ifdef HAS_PROTO_MESSAGE_DUMP
785  ESP_LOGVV(TAG, "on_switch_command_request: %s", msg.dump().c_str());
786 #endif
787  this->on_switch_command_request(msg);
788 #endif
789  break;
790  }
791  case 34: {
793  msg.decode(msg_data, msg_size);
794 #ifdef HAS_PROTO_MESSAGE_DUMP
795  ESP_LOGVV(TAG, "on_subscribe_homeassistant_services_request: %s", msg.dump().c_str());
796 #endif
798  break;
799  }
800  case 36: {
801  GetTimeRequest msg;
802  msg.decode(msg_data, msg_size);
803 #ifdef HAS_PROTO_MESSAGE_DUMP
804  ESP_LOGVV(TAG, "on_get_time_request: %s", msg.dump().c_str());
805 #endif
806  this->on_get_time_request(msg);
807  break;
808  }
809  case 37: {
810  GetTimeResponse msg;
811  msg.decode(msg_data, msg_size);
812 #ifdef HAS_PROTO_MESSAGE_DUMP
813  ESP_LOGVV(TAG, "on_get_time_response: %s", msg.dump().c_str());
814 #endif
815  this->on_get_time_response(msg);
816  break;
817  }
818  case 38: {
820  msg.decode(msg_data, msg_size);
821 #ifdef HAS_PROTO_MESSAGE_DUMP
822  ESP_LOGVV(TAG, "on_subscribe_home_assistant_states_request: %s", msg.dump().c_str());
823 #endif
825  break;
826  }
827  case 40: {
829  msg.decode(msg_data, msg_size);
830 #ifdef HAS_PROTO_MESSAGE_DUMP
831  ESP_LOGVV(TAG, "on_home_assistant_state_response: %s", msg.dump().c_str());
832 #endif
834  break;
835  }
836  case 42: {
838  msg.decode(msg_data, msg_size);
839 #ifdef HAS_PROTO_MESSAGE_DUMP
840  ESP_LOGVV(TAG, "on_execute_service_request: %s", msg.dump().c_str());
841 #endif
842  this->on_execute_service_request(msg);
843  break;
844  }
845  case 45: {
846 #ifdef USE_ESP32_CAMERA
847  CameraImageRequest msg;
848  msg.decode(msg_data, msg_size);
849 #ifdef HAS_PROTO_MESSAGE_DUMP
850  ESP_LOGVV(TAG, "on_camera_image_request: %s", msg.dump().c_str());
851 #endif
852  this->on_camera_image_request(msg);
853 #endif
854  break;
855  }
856  case 48: {
857 #ifdef USE_CLIMATE
859  msg.decode(msg_data, msg_size);
860 #ifdef HAS_PROTO_MESSAGE_DUMP
861  ESP_LOGVV(TAG, "on_climate_command_request: %s", msg.dump().c_str());
862 #endif
863  this->on_climate_command_request(msg);
864 #endif
865  break;
866  }
867  case 51: {
868 #ifdef USE_NUMBER
870  msg.decode(msg_data, msg_size);
871 #ifdef HAS_PROTO_MESSAGE_DUMP
872  ESP_LOGVV(TAG, "on_number_command_request: %s", msg.dump().c_str());
873 #endif
874  this->on_number_command_request(msg);
875 #endif
876  break;
877  }
878  case 54: {
879 #ifdef USE_SELECT
881  msg.decode(msg_data, msg_size);
882 #ifdef HAS_PROTO_MESSAGE_DUMP
883  ESP_LOGVV(TAG, "on_select_command_request: %s", msg.dump().c_str());
884 #endif
885  this->on_select_command_request(msg);
886 #endif
887  break;
888  }
889  case 60: {
890 #ifdef USE_LOCK
891  LockCommandRequest msg;
892  msg.decode(msg_data, msg_size);
893 #ifdef HAS_PROTO_MESSAGE_DUMP
894  ESP_LOGVV(TAG, "on_lock_command_request: %s", msg.dump().c_str());
895 #endif
896  this->on_lock_command_request(msg);
897 #endif
898  break;
899  }
900  case 62: {
901 #ifdef USE_BUTTON
903  msg.decode(msg_data, msg_size);
904 #ifdef HAS_PROTO_MESSAGE_DUMP
905  ESP_LOGVV(TAG, "on_button_command_request: %s", msg.dump().c_str());
906 #endif
907  this->on_button_command_request(msg);
908 #endif
909  break;
910  }
911  case 65: {
912 #ifdef USE_MEDIA_PLAYER
914  msg.decode(msg_data, msg_size);
915 #ifdef HAS_PROTO_MESSAGE_DUMP
916  ESP_LOGVV(TAG, "on_media_player_command_request: %s", msg.dump().c_str());
917 #endif
919 #endif
920  break;
921  }
922  case 66: {
923 #ifdef USE_BLUETOOTH_PROXY
925  msg.decode(msg_data, msg_size);
926 #ifdef HAS_PROTO_MESSAGE_DUMP
927  ESP_LOGVV(TAG, "on_subscribe_bluetooth_le_advertisements_request: %s", msg.dump().c_str());
928 #endif
930 #endif
931  break;
932  }
933  case 68: {
934 #ifdef USE_BLUETOOTH_PROXY
936  msg.decode(msg_data, msg_size);
937 #ifdef HAS_PROTO_MESSAGE_DUMP
938  ESP_LOGVV(TAG, "on_bluetooth_device_request: %s", msg.dump().c_str());
939 #endif
940  this->on_bluetooth_device_request(msg);
941 #endif
942  break;
943  }
944  case 70: {
945 #ifdef USE_BLUETOOTH_PROXY
947  msg.decode(msg_data, msg_size);
948 #ifdef HAS_PROTO_MESSAGE_DUMP
949  ESP_LOGVV(TAG, "on_bluetooth_gatt_get_services_request: %s", msg.dump().c_str());
950 #endif
952 #endif
953  break;
954  }
955  case 73: {
956 #ifdef USE_BLUETOOTH_PROXY
958  msg.decode(msg_data, msg_size);
959 #ifdef HAS_PROTO_MESSAGE_DUMP
960  ESP_LOGVV(TAG, "on_bluetooth_gatt_read_request: %s", msg.dump().c_str());
961 #endif
963 #endif
964  break;
965  }
966  case 75: {
967 #ifdef USE_BLUETOOTH_PROXY
969  msg.decode(msg_data, msg_size);
970 #ifdef HAS_PROTO_MESSAGE_DUMP
971  ESP_LOGVV(TAG, "on_bluetooth_gatt_write_request: %s", msg.dump().c_str());
972 #endif
974 #endif
975  break;
976  }
977  case 76: {
978 #ifdef USE_BLUETOOTH_PROXY
980  msg.decode(msg_data, msg_size);
981 #ifdef HAS_PROTO_MESSAGE_DUMP
982  ESP_LOGVV(TAG, "on_bluetooth_gatt_read_descriptor_request: %s", msg.dump().c_str());
983 #endif
985 #endif
986  break;
987  }
988  case 77: {
989 #ifdef USE_BLUETOOTH_PROXY
991  msg.decode(msg_data, msg_size);
992 #ifdef HAS_PROTO_MESSAGE_DUMP
993  ESP_LOGVV(TAG, "on_bluetooth_gatt_write_descriptor_request: %s", msg.dump().c_str());
994 #endif
996 #endif
997  break;
998  }
999  case 78: {
1000 #ifdef USE_BLUETOOTH_PROXY
1002  msg.decode(msg_data, msg_size);
1003 #ifdef HAS_PROTO_MESSAGE_DUMP
1004  ESP_LOGVV(TAG, "on_bluetooth_gatt_notify_request: %s", msg.dump().c_str());
1005 #endif
1007 #endif
1008  break;
1009  }
1010  case 80: {
1011 #ifdef USE_BLUETOOTH_PROXY
1013  msg.decode(msg_data, msg_size);
1014 #ifdef HAS_PROTO_MESSAGE_DUMP
1015  ESP_LOGVV(TAG, "on_subscribe_bluetooth_connections_free_request: %s", msg.dump().c_str());
1016 #endif
1018 #endif
1019  break;
1020  }
1021  case 87: {
1022 #ifdef USE_BLUETOOTH_PROXY
1024  msg.decode(msg_data, msg_size);
1025 #ifdef HAS_PROTO_MESSAGE_DUMP
1026  ESP_LOGVV(TAG, "on_unsubscribe_bluetooth_le_advertisements_request: %s", msg.dump().c_str());
1027 #endif
1029 #endif
1030  break;
1031  }
1032  case 89: {
1033 #ifdef USE_VOICE_ASSISTANT
1035  msg.decode(msg_data, msg_size);
1036 #ifdef HAS_PROTO_MESSAGE_DUMP
1037  ESP_LOGVV(TAG, "on_subscribe_voice_assistant_request: %s", msg.dump().c_str());
1038 #endif
1040 #endif
1041  break;
1042  }
1043  case 91: {
1044 #ifdef USE_VOICE_ASSISTANT
1046  msg.decode(msg_data, msg_size);
1047 #ifdef HAS_PROTO_MESSAGE_DUMP
1048  ESP_LOGVV(TAG, "on_voice_assistant_response: %s", msg.dump().c_str());
1049 #endif
1050  this->on_voice_assistant_response(msg);
1051 #endif
1052  break;
1053  }
1054  case 92: {
1055 #ifdef USE_VOICE_ASSISTANT
1057  msg.decode(msg_data, msg_size);
1058 #ifdef HAS_PROTO_MESSAGE_DUMP
1059  ESP_LOGVV(TAG, "on_voice_assistant_event_response: %s", msg.dump().c_str());
1060 #endif
1062 #endif
1063  break;
1064  }
1065  case 96: {
1066 #ifdef USE_ALARM_CONTROL_PANEL
1068  msg.decode(msg_data, msg_size);
1069 #ifdef HAS_PROTO_MESSAGE_DUMP
1070  ESP_LOGVV(TAG, "on_alarm_control_panel_command_request: %s", msg.dump().c_str());
1071 #endif
1073 #endif
1074  break;
1075  }
1076  case 99: {
1077 #ifdef USE_TEXT
1078  TextCommandRequest msg;
1079  msg.decode(msg_data, msg_size);
1080 #ifdef HAS_PROTO_MESSAGE_DUMP
1081  ESP_LOGVV(TAG, "on_text_command_request: %s", msg.dump().c_str());
1082 #endif
1083  this->on_text_command_request(msg);
1084 #endif
1085  break;
1086  }
1087  case 102: {
1088 #ifdef USE_DATETIME_DATE
1089  DateCommandRequest msg;
1090  msg.decode(msg_data, msg_size);
1091 #ifdef HAS_PROTO_MESSAGE_DUMP
1092  ESP_LOGVV(TAG, "on_date_command_request: %s", msg.dump().c_str());
1093 #endif
1094  this->on_date_command_request(msg);
1095 #endif
1096  break;
1097  }
1098  case 105: {
1099 #ifdef USE_DATETIME_TIME
1100  TimeCommandRequest msg;
1101  msg.decode(msg_data, msg_size);
1102 #ifdef HAS_PROTO_MESSAGE_DUMP
1103  ESP_LOGVV(TAG, "on_time_command_request: %s", msg.dump().c_str());
1104 #endif
1105  this->on_time_command_request(msg);
1106 #endif
1107  break;
1108  }
1109  case 106: {
1110 #ifdef USE_VOICE_ASSISTANT
1111  VoiceAssistantAudio msg;
1112  msg.decode(msg_data, msg_size);
1113 #ifdef HAS_PROTO_MESSAGE_DUMP
1114  ESP_LOGVV(TAG, "on_voice_assistant_audio: %s", msg.dump().c_str());
1115 #endif
1116  this->on_voice_assistant_audio(msg);
1117 #endif
1118  break;
1119  }
1120  case 111: {
1121 #ifdef USE_VALVE
1122  ValveCommandRequest msg;
1123  msg.decode(msg_data, msg_size);
1124 #ifdef HAS_PROTO_MESSAGE_DUMP
1125  ESP_LOGVV(TAG, "on_valve_command_request: %s", msg.dump().c_str());
1126 #endif
1127  this->on_valve_command_request(msg);
1128 #endif
1129  break;
1130  }
1131  case 114: {
1132 #ifdef USE_DATETIME_DATETIME
1134  msg.decode(msg_data, msg_size);
1135 #ifdef HAS_PROTO_MESSAGE_DUMP
1136  ESP_LOGVV(TAG, "on_date_time_command_request: %s", msg.dump().c_str());
1137 #endif
1138  this->on_date_time_command_request(msg);
1139 #endif
1140  break;
1141  }
1142  case 115: {
1143 #ifdef USE_VOICE_ASSISTANT
1145  msg.decode(msg_data, msg_size);
1146 #ifdef HAS_PROTO_MESSAGE_DUMP
1147  ESP_LOGVV(TAG, "on_voice_assistant_timer_event_response: %s", msg.dump().c_str());
1148 #endif
1150 #endif
1151  break;
1152  }
1153  case 118: {
1154 #ifdef USE_UPDATE
1156  msg.decode(msg_data, msg_size);
1157 #ifdef HAS_PROTO_MESSAGE_DUMP
1158  ESP_LOGVV(TAG, "on_update_command_request: %s", msg.dump().c_str());
1159 #endif
1160  this->on_update_command_request(msg);
1161 #endif
1162  break;
1163  }
1164  case 119: {
1165 #ifdef USE_VOICE_ASSISTANT
1167  msg.decode(msg_data, msg_size);
1168 #ifdef HAS_PROTO_MESSAGE_DUMP
1169  ESP_LOGVV(TAG, "on_voice_assistant_announce_request: %s", msg.dump().c_str());
1170 #endif
1172 #endif
1173  break;
1174  }
1175  case 121: {
1176 #ifdef USE_VOICE_ASSISTANT
1178  msg.decode(msg_data, msg_size);
1179 #ifdef HAS_PROTO_MESSAGE_DUMP
1180  ESP_LOGVV(TAG, "on_voice_assistant_configuration_request: %s", msg.dump().c_str());
1181 #endif
1183 #endif
1184  break;
1185  }
1186  case 123: {
1187 #ifdef USE_VOICE_ASSISTANT
1189  msg.decode(msg_data, msg_size);
1190 #ifdef HAS_PROTO_MESSAGE_DUMP
1191  ESP_LOGVV(TAG, "on_voice_assistant_set_configuration: %s", msg.dump().c_str());
1192 #endif
1194 #endif
1195  break;
1196  }
1197  default:
1198  return false;
1199  }
1200  return true;
1201 }
1202 
1204  HelloResponse ret = this->hello(msg);
1205  if (!this->send_hello_response(ret)) {
1206  this->on_fatal_error();
1207  }
1208 }
1210  ConnectResponse ret = this->connect(msg);
1211  if (!this->send_connect_response(ret)) {
1212  this->on_fatal_error();
1213  }
1214 }
1216  DisconnectResponse ret = this->disconnect(msg);
1217  if (!this->send_disconnect_response(ret)) {
1218  this->on_fatal_error();
1219  }
1220 }
1222  PingResponse ret = this->ping(msg);
1223  if (!this->send_ping_response(ret)) {
1224  this->on_fatal_error();
1225  }
1226 }
1228  if (!this->is_connection_setup()) {
1229  this->on_no_setup_connection();
1230  return;
1231  }
1232  DeviceInfoResponse ret = this->device_info(msg);
1233  if (!this->send_device_info_response(ret)) {
1234  this->on_fatal_error();
1235  }
1236 }
1238  if (!this->is_connection_setup()) {
1239  this->on_no_setup_connection();
1240  return;
1241  }
1242  if (!this->is_authenticated()) {
1243  this->on_unauthenticated_access();
1244  return;
1245  }
1246  this->list_entities(msg);
1247 }
1249  if (!this->is_connection_setup()) {
1250  this->on_no_setup_connection();
1251  return;
1252  }
1253  if (!this->is_authenticated()) {
1254  this->on_unauthenticated_access();
1255  return;
1256  }
1257  this->subscribe_states(msg);
1258 }
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->subscribe_logs(msg);
1269 }
1272  if (!this->is_connection_setup()) {
1273  this->on_no_setup_connection();
1274  return;
1275  }
1276  if (!this->is_authenticated()) {
1277  this->on_unauthenticated_access();
1278  return;
1279  }
1280  this->subscribe_homeassistant_services(msg);
1281 }
1283  if (!this->is_connection_setup()) {
1284  this->on_no_setup_connection();
1285  return;
1286  }
1287  if (!this->is_authenticated()) {
1288  this->on_unauthenticated_access();
1289  return;
1290  }
1291  this->subscribe_home_assistant_states(msg);
1292 }
1294  if (!this->is_connection_setup()) {
1295  this->on_no_setup_connection();
1296  return;
1297  }
1298  GetTimeResponse ret = this->get_time(msg);
1299  if (!this->send_get_time_response(ret)) {
1300  this->on_fatal_error();
1301  }
1302 }
1304  if (!this->is_connection_setup()) {
1305  this->on_no_setup_connection();
1306  return;
1307  }
1308  if (!this->is_authenticated()) {
1309  this->on_unauthenticated_access();
1310  return;
1311  }
1312  this->execute_service(msg);
1313 }
1314 #ifdef USE_COVER
1316  if (!this->is_connection_setup()) {
1317  this->on_no_setup_connection();
1318  return;
1319  }
1320  if (!this->is_authenticated()) {
1321  this->on_unauthenticated_access();
1322  return;
1323  }
1324  this->cover_command(msg);
1325 }
1326 #endif
1327 #ifdef USE_FAN
1329  if (!this->is_connection_setup()) {
1330  this->on_no_setup_connection();
1331  return;
1332  }
1333  if (!this->is_authenticated()) {
1334  this->on_unauthenticated_access();
1335  return;
1336  }
1337  this->fan_command(msg);
1338 }
1339 #endif
1340 #ifdef USE_LIGHT
1342  if (!this->is_connection_setup()) {
1343  this->on_no_setup_connection();
1344  return;
1345  }
1346  if (!this->is_authenticated()) {
1347  this->on_unauthenticated_access();
1348  return;
1349  }
1350  this->light_command(msg);
1351 }
1352 #endif
1353 #ifdef USE_SWITCH
1355  if (!this->is_connection_setup()) {
1356  this->on_no_setup_connection();
1357  return;
1358  }
1359  if (!this->is_authenticated()) {
1360  this->on_unauthenticated_access();
1361  return;
1362  }
1363  this->switch_command(msg);
1364 }
1365 #endif
1366 #ifdef USE_ESP32_CAMERA
1368  if (!this->is_connection_setup()) {
1369  this->on_no_setup_connection();
1370  return;
1371  }
1372  if (!this->is_authenticated()) {
1373  this->on_unauthenticated_access();
1374  return;
1375  }
1376  this->camera_image(msg);
1377 }
1378 #endif
1379 #ifdef USE_CLIMATE
1381  if (!this->is_connection_setup()) {
1382  this->on_no_setup_connection();
1383  return;
1384  }
1385  if (!this->is_authenticated()) {
1386  this->on_unauthenticated_access();
1387  return;
1388  }
1389  this->climate_command(msg);
1390 }
1391 #endif
1392 #ifdef USE_NUMBER
1394  if (!this->is_connection_setup()) {
1395  this->on_no_setup_connection();
1396  return;
1397  }
1398  if (!this->is_authenticated()) {
1399  this->on_unauthenticated_access();
1400  return;
1401  }
1402  this->number_command(msg);
1403 }
1404 #endif
1405 #ifdef USE_TEXT
1407  if (!this->is_connection_setup()) {
1408  this->on_no_setup_connection();
1409  return;
1410  }
1411  if (!this->is_authenticated()) {
1412  this->on_unauthenticated_access();
1413  return;
1414  }
1415  this->text_command(msg);
1416 }
1417 #endif
1418 #ifdef USE_SELECT
1420  if (!this->is_connection_setup()) {
1421  this->on_no_setup_connection();
1422  return;
1423  }
1424  if (!this->is_authenticated()) {
1425  this->on_unauthenticated_access();
1426  return;
1427  }
1428  this->select_command(msg);
1429 }
1430 #endif
1431 #ifdef USE_BUTTON
1433  if (!this->is_connection_setup()) {
1434  this->on_no_setup_connection();
1435  return;
1436  }
1437  if (!this->is_authenticated()) {
1438  this->on_unauthenticated_access();
1439  return;
1440  }
1441  this->button_command(msg);
1442 }
1443 #endif
1444 #ifdef USE_LOCK
1446  if (!this->is_connection_setup()) {
1447  this->on_no_setup_connection();
1448  return;
1449  }
1450  if (!this->is_authenticated()) {
1451  this->on_unauthenticated_access();
1452  return;
1453  }
1454  this->lock_command(msg);
1455 }
1456 #endif
1457 #ifdef USE_VALVE
1459  if (!this->is_connection_setup()) {
1460  this->on_no_setup_connection();
1461  return;
1462  }
1463  if (!this->is_authenticated()) {
1464  this->on_unauthenticated_access();
1465  return;
1466  }
1467  this->valve_command(msg);
1468 }
1469 #endif
1470 #ifdef USE_MEDIA_PLAYER
1472  if (!this->is_connection_setup()) {
1473  this->on_no_setup_connection();
1474  return;
1475  }
1476  if (!this->is_authenticated()) {
1477  this->on_unauthenticated_access();
1478  return;
1479  }
1480  this->media_player_command(msg);
1481 }
1482 #endif
1483 #ifdef USE_DATETIME_DATE
1485  if (!this->is_connection_setup()) {
1486  this->on_no_setup_connection();
1487  return;
1488  }
1489  if (!this->is_authenticated()) {
1490  this->on_unauthenticated_access();
1491  return;
1492  }
1493  this->date_command(msg);
1494 }
1495 #endif
1496 #ifdef USE_DATETIME_TIME
1498  if (!this->is_connection_setup()) {
1499  this->on_no_setup_connection();
1500  return;
1501  }
1502  if (!this->is_authenticated()) {
1503  this->on_unauthenticated_access();
1504  return;
1505  }
1506  this->time_command(msg);
1507 }
1508 #endif
1509 #ifdef USE_DATETIME_DATETIME
1511  if (!this->is_connection_setup()) {
1512  this->on_no_setup_connection();
1513  return;
1514  }
1515  if (!this->is_authenticated()) {
1516  this->on_unauthenticated_access();
1517  return;
1518  }
1519  this->datetime_command(msg);
1520 }
1521 #endif
1522 #ifdef USE_UPDATE
1524  if (!this->is_connection_setup()) {
1525  this->on_no_setup_connection();
1526  return;
1527  }
1528  if (!this->is_authenticated()) {
1529  this->on_unauthenticated_access();
1530  return;
1531  }
1532  this->update_command(msg);
1533 }
1534 #endif
1535 #ifdef USE_BLUETOOTH_PROXY
1538  if (!this->is_connection_setup()) {
1539  this->on_no_setup_connection();
1540  return;
1541  }
1542  if (!this->is_authenticated()) {
1543  this->on_unauthenticated_access();
1544  return;
1545  }
1546  this->subscribe_bluetooth_le_advertisements(msg);
1547 }
1548 #endif
1549 #ifdef USE_BLUETOOTH_PROXY
1551  if (!this->is_connection_setup()) {
1552  this->on_no_setup_connection();
1553  return;
1554  }
1555  if (!this->is_authenticated()) {
1556  this->on_unauthenticated_access();
1557  return;
1558  }
1559  this->bluetooth_device_request(msg);
1560 }
1561 #endif
1562 #ifdef USE_BLUETOOTH_PROXY
1564  if (!this->is_connection_setup()) {
1565  this->on_no_setup_connection();
1566  return;
1567  }
1568  if (!this->is_authenticated()) {
1569  this->on_unauthenticated_access();
1570  return;
1571  }
1572  this->bluetooth_gatt_get_services(msg);
1573 }
1574 #endif
1575 #ifdef USE_BLUETOOTH_PROXY
1577  if (!this->is_connection_setup()) {
1578  this->on_no_setup_connection();
1579  return;
1580  }
1581  if (!this->is_authenticated()) {
1582  this->on_unauthenticated_access();
1583  return;
1584  }
1585  this->bluetooth_gatt_read(msg);
1586 }
1587 #endif
1588 #ifdef USE_BLUETOOTH_PROXY
1590  if (!this->is_connection_setup()) {
1591  this->on_no_setup_connection();
1592  return;
1593  }
1594  if (!this->is_authenticated()) {
1595  this->on_unauthenticated_access();
1596  return;
1597  }
1598  this->bluetooth_gatt_write(msg);
1599 }
1600 #endif
1601 #ifdef USE_BLUETOOTH_PROXY
1603  if (!this->is_connection_setup()) {
1604  this->on_no_setup_connection();
1605  return;
1606  }
1607  if (!this->is_authenticated()) {
1608  this->on_unauthenticated_access();
1609  return;
1610  }
1611  this->bluetooth_gatt_read_descriptor(msg);
1612 }
1613 #endif
1614 #ifdef USE_BLUETOOTH_PROXY
1616  if (!this->is_connection_setup()) {
1617  this->on_no_setup_connection();
1618  return;
1619  }
1620  if (!this->is_authenticated()) {
1621  this->on_unauthenticated_access();
1622  return;
1623  }
1624  this->bluetooth_gatt_write_descriptor(msg);
1625 }
1626 #endif
1627 #ifdef USE_BLUETOOTH_PROXY
1629  if (!this->is_connection_setup()) {
1630  this->on_no_setup_connection();
1631  return;
1632  }
1633  if (!this->is_authenticated()) {
1634  this->on_unauthenticated_access();
1635  return;
1636  }
1637  this->bluetooth_gatt_notify(msg);
1638 }
1639 #endif
1640 #ifdef USE_BLUETOOTH_PROXY
1643  if (!this->is_connection_setup()) {
1644  this->on_no_setup_connection();
1645  return;
1646  }
1647  if (!this->is_authenticated()) {
1648  this->on_unauthenticated_access();
1649  return;
1650  }
1651  BluetoothConnectionsFreeResponse ret = this->subscribe_bluetooth_connections_free(msg);
1652  if (!this->send_bluetooth_connections_free_response(ret)) {
1653  this->on_fatal_error();
1654  }
1655 }
1656 #endif
1657 #ifdef USE_BLUETOOTH_PROXY
1660  if (!this->is_connection_setup()) {
1661  this->on_no_setup_connection();
1662  return;
1663  }
1664  if (!this->is_authenticated()) {
1665  this->on_unauthenticated_access();
1666  return;
1667  }
1668  this->unsubscribe_bluetooth_le_advertisements(msg);
1669 }
1670 #endif
1671 #ifdef USE_VOICE_ASSISTANT
1673  if (!this->is_connection_setup()) {
1674  this->on_no_setup_connection();
1675  return;
1676  }
1677  if (!this->is_authenticated()) {
1678  this->on_unauthenticated_access();
1679  return;
1680  }
1681  this->subscribe_voice_assistant(msg);
1682 }
1683 #endif
1684 #ifdef USE_VOICE_ASSISTANT
1686  if (!this->is_connection_setup()) {
1687  this->on_no_setup_connection();
1688  return;
1689  }
1690  if (!this->is_authenticated()) {
1691  this->on_unauthenticated_access();
1692  return;
1693  }
1694  VoiceAssistantConfigurationResponse ret = this->voice_assistant_get_configuration(msg);
1696  this->on_fatal_error();
1697  }
1698 }
1699 #endif
1700 #ifdef USE_VOICE_ASSISTANT
1702  if (!this->is_connection_setup()) {
1703  this->on_no_setup_connection();
1704  return;
1705  }
1706  if (!this->is_authenticated()) {
1707  this->on_unauthenticated_access();
1708  return;
1709  }
1710  this->voice_assistant_set_configuration(msg);
1711 }
1712 #endif
1713 #ifdef USE_ALARM_CONTROL_PANEL
1715  if (!this->is_connection_setup()) {
1716  this->on_no_setup_connection();
1717  return;
1718  }
1719  if (!this->is_authenticated()) {
1720  this->on_unauthenticated_access();
1721  return;
1722  }
1723  this->alarm_control_panel_command(msg);
1724 }
1725 #endif
1726 
1727 } // namespace api
1728 } // 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)
virtual void on_voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &value)
bool send_get_time_response(const GetTimeResponse &msg)
bool send_ping_request(const PingRequest &msg)
virtual void on_unsubscribe_bluetooth_le_advertisements_request(const UnsubscribeBluetoothLEAdvertisementsRequest &value)
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)
void on_voice_assistant_configuration_request(const VoiceAssistantConfigurationRequest &msg) override
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_voice_assistant_announce_request(const VoiceAssistantAnnounceRequest &value)
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
void on_voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &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_voice_assistant_announce_finished(const VoiceAssistantAnnounceFinished &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)
virtual void on_voice_assistant_configuration_request(const VoiceAssistantConfigurationRequest &value)
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
bool send_voice_assistant_configuration_response(const VoiceAssistantConfigurationResponse &msg)
virtual void on_subscribe_logs_request(const SubscribeLogsRequest &value)
bool send_update_state_response(const UpdateStateResponse &msg)