ESPHome 2025.10.0-dev
Loading...
Searching...
No Matches
api_pb2.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.h"
4#include "esphome/core/log.h"
6#include <cstring>
7
8namespace esphome::api {
9
10bool HelloRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
11 switch (field_id) {
12 case 2:
13 this->api_version_major = value.as_uint32();
14 break;
15 case 3:
16 this->api_version_minor = value.as_uint32();
17 break;
18 default:
19 return false;
20 }
21 return true;
22}
23bool HelloRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
24 switch (field_id) {
25 case 1: {
26 // Use raw data directly to avoid allocation
27 this->client_info = value.data();
28 this->client_info_len = value.size();
29 break;
30 }
31 default:
32 return false;
33 }
34 return true;
35}
37 buffer.encode_uint32(1, this->api_version_major);
38 buffer.encode_uint32(2, this->api_version_minor);
39 buffer.encode_string(3, this->server_info_ref_);
40 buffer.encode_string(4, this->name_ref_);
41}
43 size.add_uint32(1, this->api_version_major);
44 size.add_uint32(1, this->api_version_minor);
45 size.add_length(1, this->server_info_ref_.size());
46 size.add_length(1, this->name_ref_.size());
47}
48#ifdef USE_API_PASSWORD
50 switch (field_id) {
51 case 1: {
52 // Use raw data directly to avoid allocation
53 this->password = value.data();
54 this->password_len = value.size();
55 break;
56 }
57 default:
58 return false;
59 }
60 return true;
61}
64#endif
65#ifdef USE_AREAS
67 buffer.encode_uint32(1, this->area_id);
68 buffer.encode_string(2, this->name_ref_);
69}
71 size.add_uint32(1, this->area_id);
72 size.add_length(1, this->name_ref_.size());
73}
74#endif
75#ifdef USE_DEVICES
77 buffer.encode_uint32(1, this->device_id);
78 buffer.encode_string(2, this->name_ref_);
79 buffer.encode_uint32(3, this->area_id);
80}
82 size.add_uint32(1, this->device_id);
83 size.add_length(1, this->name_ref_.size());
84 size.add_uint32(1, this->area_id);
85}
86#endif
88#ifdef USE_API_PASSWORD
89 buffer.encode_bool(1, this->uses_password);
90#endif
91 buffer.encode_string(2, this->name_ref_);
92 buffer.encode_string(3, this->mac_address_ref_);
93 buffer.encode_string(4, this->esphome_version_ref_);
94 buffer.encode_string(5, this->compilation_time_ref_);
95 buffer.encode_string(6, this->model_ref_);
96#ifdef USE_DEEP_SLEEP
97 buffer.encode_bool(7, this->has_deep_sleep);
98#endif
99#ifdef ESPHOME_PROJECT_NAME
100 buffer.encode_string(8, this->project_name_ref_);
101#endif
102#ifdef ESPHOME_PROJECT_NAME
103 buffer.encode_string(9, this->project_version_ref_);
104#endif
105#ifdef USE_WEBSERVER
106 buffer.encode_uint32(10, this->webserver_port);
107#endif
108#ifdef USE_BLUETOOTH_PROXY
110#endif
111 buffer.encode_string(12, this->manufacturer_ref_);
112 buffer.encode_string(13, this->friendly_name_ref_);
113#ifdef USE_VOICE_ASSISTANT
115#endif
116#ifdef USE_AREAS
117 buffer.encode_string(16, this->suggested_area_ref_);
118#endif
119#ifdef USE_BLUETOOTH_PROXY
121#endif
122#ifdef USE_API_NOISE
123 buffer.encode_bool(19, this->api_encryption_supported);
124#endif
125#ifdef USE_DEVICES
126 for (const auto &it : this->devices) {
127 buffer.encode_message(20, it, true);
128 }
129#endif
130#ifdef USE_AREAS
131 for (const auto &it : this->areas) {
132 buffer.encode_message(21, it, true);
133 }
134#endif
135#ifdef USE_AREAS
136 buffer.encode_message(22, this->area);
137#endif
138#ifdef USE_ZWAVE_PROXY
140#endif
141#ifdef USE_ZWAVE_PROXY
142 buffer.encode_uint32(24, this->zwave_home_id);
143#endif
144}
146#ifdef USE_API_PASSWORD
147 size.add_bool(1, this->uses_password);
148#endif
149 size.add_length(1, this->name_ref_.size());
150 size.add_length(1, this->mac_address_ref_.size());
151 size.add_length(1, this->esphome_version_ref_.size());
152 size.add_length(1, this->compilation_time_ref_.size());
153 size.add_length(1, this->model_ref_.size());
154#ifdef USE_DEEP_SLEEP
155 size.add_bool(1, this->has_deep_sleep);
156#endif
157#ifdef ESPHOME_PROJECT_NAME
158 size.add_length(1, this->project_name_ref_.size());
159#endif
160#ifdef ESPHOME_PROJECT_NAME
161 size.add_length(1, this->project_version_ref_.size());
162#endif
163#ifdef USE_WEBSERVER
164 size.add_uint32(1, this->webserver_port);
165#endif
166#ifdef USE_BLUETOOTH_PROXY
168#endif
169 size.add_length(1, this->manufacturer_ref_.size());
170 size.add_length(1, this->friendly_name_ref_.size());
171#ifdef USE_VOICE_ASSISTANT
173#endif
174#ifdef USE_AREAS
175 size.add_length(2, this->suggested_area_ref_.size());
176#endif
177#ifdef USE_BLUETOOTH_PROXY
179#endif
180#ifdef USE_API_NOISE
181 size.add_bool(2, this->api_encryption_supported);
182#endif
183#ifdef USE_DEVICES
184 for (const auto &it : this->devices) {
185 size.add_message_object_force(2, it);
186 }
187#endif
188#ifdef USE_AREAS
189 for (const auto &it : this->areas) {
190 size.add_message_object_force(2, it);
191 }
192#endif
193#ifdef USE_AREAS
194 size.add_message_object(2, this->area);
195#endif
196#ifdef USE_ZWAVE_PROXY
198#endif
199#ifdef USE_ZWAVE_PROXY
200 size.add_uint32(2, this->zwave_home_id);
201#endif
202}
203#ifdef USE_BINARY_SENSOR
205 buffer.encode_string(1, this->object_id_ref_);
206 buffer.encode_fixed32(2, this->key);
207 buffer.encode_string(3, this->name_ref_);
208 buffer.encode_string(5, this->device_class_ref_);
209 buffer.encode_bool(6, this->is_status_binary_sensor);
210 buffer.encode_bool(7, this->disabled_by_default);
211#ifdef USE_ENTITY_ICON
212 buffer.encode_string(8, this->icon_ref_);
213#endif
214 buffer.encode_uint32(9, static_cast<uint32_t>(this->entity_category));
215#ifdef USE_DEVICES
216 buffer.encode_uint32(10, this->device_id);
217#endif
218}
220 size.add_length(1, this->object_id_ref_.size());
221 size.add_fixed32(1, this->key);
222 size.add_length(1, this->name_ref_.size());
223 size.add_length(1, this->device_class_ref_.size());
224 size.add_bool(1, this->is_status_binary_sensor);
225 size.add_bool(1, this->disabled_by_default);
226#ifdef USE_ENTITY_ICON
227 size.add_length(1, this->icon_ref_.size());
228#endif
229 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
230#ifdef USE_DEVICES
231 size.add_uint32(1, this->device_id);
232#endif
233}
235 buffer.encode_fixed32(1, this->key);
236 buffer.encode_bool(2, this->state);
237 buffer.encode_bool(3, this->missing_state);
238#ifdef USE_DEVICES
239 buffer.encode_uint32(4, this->device_id);
240#endif
241}
243 size.add_fixed32(1, this->key);
244 size.add_bool(1, this->state);
245 size.add_bool(1, this->missing_state);
246#ifdef USE_DEVICES
247 size.add_uint32(1, this->device_id);
248#endif
249}
250#endif
251#ifdef USE_COVER
253 buffer.encode_string(1, this->object_id_ref_);
254 buffer.encode_fixed32(2, this->key);
255 buffer.encode_string(3, this->name_ref_);
256 buffer.encode_bool(5, this->assumed_state);
257 buffer.encode_bool(6, this->supports_position);
258 buffer.encode_bool(7, this->supports_tilt);
259 buffer.encode_string(8, this->device_class_ref_);
260 buffer.encode_bool(9, this->disabled_by_default);
261#ifdef USE_ENTITY_ICON
262 buffer.encode_string(10, this->icon_ref_);
263#endif
264 buffer.encode_uint32(11, static_cast<uint32_t>(this->entity_category));
265 buffer.encode_bool(12, this->supports_stop);
266#ifdef USE_DEVICES
267 buffer.encode_uint32(13, this->device_id);
268#endif
269}
271 size.add_length(1, this->object_id_ref_.size());
272 size.add_fixed32(1, this->key);
273 size.add_length(1, this->name_ref_.size());
274 size.add_bool(1, this->assumed_state);
275 size.add_bool(1, this->supports_position);
276 size.add_bool(1, this->supports_tilt);
277 size.add_length(1, this->device_class_ref_.size());
278 size.add_bool(1, this->disabled_by_default);
279#ifdef USE_ENTITY_ICON
280 size.add_length(1, this->icon_ref_.size());
281#endif
282 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
283 size.add_bool(1, this->supports_stop);
284#ifdef USE_DEVICES
285 size.add_uint32(1, this->device_id);
286#endif
287}
289 buffer.encode_fixed32(1, this->key);
290 buffer.encode_float(3, this->position);
291 buffer.encode_float(4, this->tilt);
292 buffer.encode_uint32(5, static_cast<uint32_t>(this->current_operation));
293#ifdef USE_DEVICES
294 buffer.encode_uint32(6, this->device_id);
295#endif
296}
298 size.add_fixed32(1, this->key);
299 size.add_float(1, this->position);
300 size.add_float(1, this->tilt);
301 size.add_uint32(1, static_cast<uint32_t>(this->current_operation));
302#ifdef USE_DEVICES
303 size.add_uint32(1, this->device_id);
304#endif
305}
306bool CoverCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
307 switch (field_id) {
308 case 4:
309 this->has_position = value.as_bool();
310 break;
311 case 6:
312 this->has_tilt = value.as_bool();
313 break;
314 case 8:
315 this->stop = value.as_bool();
316 break;
317#ifdef USE_DEVICES
318 case 9:
319 this->device_id = value.as_uint32();
320 break;
321#endif
322 default:
323 return false;
324 }
325 return true;
326}
327bool CoverCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
328 switch (field_id) {
329 case 1:
330 this->key = value.as_fixed32();
331 break;
332 case 5:
333 this->position = value.as_float();
334 break;
335 case 7:
336 this->tilt = value.as_float();
337 break;
338 default:
339 return false;
340 }
341 return true;
342}
343#endif
344#ifdef USE_FAN
346 buffer.encode_string(1, this->object_id_ref_);
347 buffer.encode_fixed32(2, this->key);
348 buffer.encode_string(3, this->name_ref_);
349 buffer.encode_bool(5, this->supports_oscillation);
350 buffer.encode_bool(6, this->supports_speed);
351 buffer.encode_bool(7, this->supports_direction);
352 buffer.encode_int32(8, this->supported_speed_count);
353 buffer.encode_bool(9, this->disabled_by_default);
354#ifdef USE_ENTITY_ICON
355 buffer.encode_string(10, this->icon_ref_);
356#endif
357 buffer.encode_uint32(11, static_cast<uint32_t>(this->entity_category));
358 for (const auto &it : *this->supported_preset_modes) {
359 buffer.encode_string(12, it, true);
360 }
361#ifdef USE_DEVICES
362 buffer.encode_uint32(13, this->device_id);
363#endif
364}
366 size.add_length(1, this->object_id_ref_.size());
367 size.add_fixed32(1, this->key);
368 size.add_length(1, this->name_ref_.size());
369 size.add_bool(1, this->supports_oscillation);
370 size.add_bool(1, this->supports_speed);
371 size.add_bool(1, this->supports_direction);
372 size.add_int32(1, this->supported_speed_count);
373 size.add_bool(1, this->disabled_by_default);
374#ifdef USE_ENTITY_ICON
375 size.add_length(1, this->icon_ref_.size());
376#endif
377 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
378 if (!this->supported_preset_modes->empty()) {
379 for (const auto &it : *this->supported_preset_modes) {
380 size.add_length_force(1, it.size());
381 }
382 }
383#ifdef USE_DEVICES
384 size.add_uint32(1, this->device_id);
385#endif
386}
388 buffer.encode_fixed32(1, this->key);
389 buffer.encode_bool(2, this->state);
390 buffer.encode_bool(3, this->oscillating);
391 buffer.encode_uint32(5, static_cast<uint32_t>(this->direction));
392 buffer.encode_int32(6, this->speed_level);
393 buffer.encode_string(7, this->preset_mode_ref_);
394#ifdef USE_DEVICES
395 buffer.encode_uint32(8, this->device_id);
396#endif
397}
399 size.add_fixed32(1, this->key);
400 size.add_bool(1, this->state);
401 size.add_bool(1, this->oscillating);
402 size.add_uint32(1, static_cast<uint32_t>(this->direction));
403 size.add_int32(1, this->speed_level);
404 size.add_length(1, this->preset_mode_ref_.size());
405#ifdef USE_DEVICES
406 size.add_uint32(1, this->device_id);
407#endif
408}
409bool FanCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
410 switch (field_id) {
411 case 2:
412 this->has_state = value.as_bool();
413 break;
414 case 3:
415 this->state = value.as_bool();
416 break;
417 case 6:
418 this->has_oscillating = value.as_bool();
419 break;
420 case 7:
421 this->oscillating = value.as_bool();
422 break;
423 case 8:
424 this->has_direction = value.as_bool();
425 break;
426 case 9:
427 this->direction = static_cast<enums::FanDirection>(value.as_uint32());
428 break;
429 case 10:
430 this->has_speed_level = value.as_bool();
431 break;
432 case 11:
433 this->speed_level = value.as_int32();
434 break;
435 case 12:
436 this->has_preset_mode = value.as_bool();
437 break;
438#ifdef USE_DEVICES
439 case 14:
440 this->device_id = value.as_uint32();
441 break;
442#endif
443 default:
444 return false;
445 }
446 return true;
447}
449 switch (field_id) {
450 case 13:
451 this->preset_mode = value.as_string();
452 break;
453 default:
454 return false;
455 }
456 return true;
457}
458bool FanCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
459 switch (field_id) {
460 case 1:
461 this->key = value.as_fixed32();
462 break;
463 default:
464 return false;
465 }
466 return true;
467}
468#endif
469#ifdef USE_LIGHT
471 buffer.encode_string(1, this->object_id_ref_);
472 buffer.encode_fixed32(2, this->key);
473 buffer.encode_string(3, this->name_ref_);
474 for (const auto &it : *this->supported_color_modes) {
475 buffer.encode_uint32(12, static_cast<uint32_t>(it), true);
476 }
477 buffer.encode_float(9, this->min_mireds);
478 buffer.encode_float(10, this->max_mireds);
479 for (auto &it : this->effects) {
480 buffer.encode_string(11, it, true);
481 }
482 buffer.encode_bool(13, this->disabled_by_default);
483#ifdef USE_ENTITY_ICON
484 buffer.encode_string(14, this->icon_ref_);
485#endif
486 buffer.encode_uint32(15, static_cast<uint32_t>(this->entity_category));
487#ifdef USE_DEVICES
488 buffer.encode_uint32(16, this->device_id);
489#endif
490}
492 size.add_length(1, this->object_id_ref_.size());
493 size.add_fixed32(1, this->key);
494 size.add_length(1, this->name_ref_.size());
495 if (!this->supported_color_modes->empty()) {
496 for (const auto &it : *this->supported_color_modes) {
497 size.add_uint32_force(1, static_cast<uint32_t>(it));
498 }
499 }
500 size.add_float(1, this->min_mireds);
501 size.add_float(1, this->max_mireds);
502 if (!this->effects.empty()) {
503 for (const auto &it : this->effects) {
504 size.add_length_force(1, it.size());
505 }
506 }
507 size.add_bool(1, this->disabled_by_default);
508#ifdef USE_ENTITY_ICON
509 size.add_length(1, this->icon_ref_.size());
510#endif
511 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
512#ifdef USE_DEVICES
513 size.add_uint32(2, this->device_id);
514#endif
515}
517 buffer.encode_fixed32(1, this->key);
518 buffer.encode_bool(2, this->state);
519 buffer.encode_float(3, this->brightness);
520 buffer.encode_uint32(11, static_cast<uint32_t>(this->color_mode));
521 buffer.encode_float(10, this->color_brightness);
522 buffer.encode_float(4, this->red);
523 buffer.encode_float(5, this->green);
524 buffer.encode_float(6, this->blue);
525 buffer.encode_float(7, this->white);
526 buffer.encode_float(8, this->color_temperature);
527 buffer.encode_float(12, this->cold_white);
528 buffer.encode_float(13, this->warm_white);
529 buffer.encode_string(9, this->effect_ref_);
530#ifdef USE_DEVICES
531 buffer.encode_uint32(14, this->device_id);
532#endif
533}
535 size.add_fixed32(1, this->key);
536 size.add_bool(1, this->state);
537 size.add_float(1, this->brightness);
538 size.add_uint32(1, static_cast<uint32_t>(this->color_mode));
539 size.add_float(1, this->color_brightness);
540 size.add_float(1, this->red);
541 size.add_float(1, this->green);
542 size.add_float(1, this->blue);
543 size.add_float(1, this->white);
544 size.add_float(1, this->color_temperature);
545 size.add_float(1, this->cold_white);
546 size.add_float(1, this->warm_white);
547 size.add_length(1, this->effect_ref_.size());
548#ifdef USE_DEVICES
549 size.add_uint32(1, this->device_id);
550#endif
551}
552bool LightCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
553 switch (field_id) {
554 case 2:
555 this->has_state = value.as_bool();
556 break;
557 case 3:
558 this->state = value.as_bool();
559 break;
560 case 4:
561 this->has_brightness = value.as_bool();
562 break;
563 case 22:
564 this->has_color_mode = value.as_bool();
565 break;
566 case 23:
567 this->color_mode = static_cast<enums::ColorMode>(value.as_uint32());
568 break;
569 case 20:
570 this->has_color_brightness = value.as_bool();
571 break;
572 case 6:
573 this->has_rgb = value.as_bool();
574 break;
575 case 10:
576 this->has_white = value.as_bool();
577 break;
578 case 12:
579 this->has_color_temperature = value.as_bool();
580 break;
581 case 24:
582 this->has_cold_white = value.as_bool();
583 break;
584 case 26:
585 this->has_warm_white = value.as_bool();
586 break;
587 case 14:
588 this->has_transition_length = value.as_bool();
589 break;
590 case 15:
591 this->transition_length = value.as_uint32();
592 break;
593 case 16:
594 this->has_flash_length = value.as_bool();
595 break;
596 case 17:
597 this->flash_length = value.as_uint32();
598 break;
599 case 18:
600 this->has_effect = value.as_bool();
601 break;
602#ifdef USE_DEVICES
603 case 28:
604 this->device_id = value.as_uint32();
605 break;
606#endif
607 default:
608 return false;
609 }
610 return true;
611}
613 switch (field_id) {
614 case 19:
615 this->effect = value.as_string();
616 break;
617 default:
618 return false;
619 }
620 return true;
621}
622bool LightCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
623 switch (field_id) {
624 case 1:
625 this->key = value.as_fixed32();
626 break;
627 case 5:
628 this->brightness = value.as_float();
629 break;
630 case 21:
631 this->color_brightness = value.as_float();
632 break;
633 case 7:
634 this->red = value.as_float();
635 break;
636 case 8:
637 this->green = value.as_float();
638 break;
639 case 9:
640 this->blue = value.as_float();
641 break;
642 case 11:
643 this->white = value.as_float();
644 break;
645 case 13:
646 this->color_temperature = value.as_float();
647 break;
648 case 25:
649 this->cold_white = value.as_float();
650 break;
651 case 27:
652 this->warm_white = value.as_float();
653 break;
654 default:
655 return false;
656 }
657 return true;
658}
659#endif
660#ifdef USE_SENSOR
662 buffer.encode_string(1, this->object_id_ref_);
663 buffer.encode_fixed32(2, this->key);
664 buffer.encode_string(3, this->name_ref_);
665#ifdef USE_ENTITY_ICON
666 buffer.encode_string(5, this->icon_ref_);
667#endif
669 buffer.encode_int32(7, this->accuracy_decimals);
670 buffer.encode_bool(8, this->force_update);
671 buffer.encode_string(9, this->device_class_ref_);
672 buffer.encode_uint32(10, static_cast<uint32_t>(this->state_class));
673 buffer.encode_bool(12, this->disabled_by_default);
674 buffer.encode_uint32(13, static_cast<uint32_t>(this->entity_category));
675#ifdef USE_DEVICES
676 buffer.encode_uint32(14, this->device_id);
677#endif
678}
680 size.add_length(1, this->object_id_ref_.size());
681 size.add_fixed32(1, this->key);
682 size.add_length(1, this->name_ref_.size());
683#ifdef USE_ENTITY_ICON
684 size.add_length(1, this->icon_ref_.size());
685#endif
687 size.add_int32(1, this->accuracy_decimals);
688 size.add_bool(1, this->force_update);
689 size.add_length(1, this->device_class_ref_.size());
690 size.add_uint32(1, static_cast<uint32_t>(this->state_class));
691 size.add_bool(1, this->disabled_by_default);
692 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
693#ifdef USE_DEVICES
694 size.add_uint32(1, this->device_id);
695#endif
696}
698 buffer.encode_fixed32(1, this->key);
699 buffer.encode_float(2, this->state);
700 buffer.encode_bool(3, this->missing_state);
701#ifdef USE_DEVICES
702 buffer.encode_uint32(4, this->device_id);
703#endif
704}
706 size.add_fixed32(1, this->key);
707 size.add_float(1, this->state);
708 size.add_bool(1, this->missing_state);
709#ifdef USE_DEVICES
710 size.add_uint32(1, this->device_id);
711#endif
712}
713#endif
714#ifdef USE_SWITCH
716 buffer.encode_string(1, this->object_id_ref_);
717 buffer.encode_fixed32(2, this->key);
718 buffer.encode_string(3, this->name_ref_);
719#ifdef USE_ENTITY_ICON
720 buffer.encode_string(5, this->icon_ref_);
721#endif
722 buffer.encode_bool(6, this->assumed_state);
723 buffer.encode_bool(7, this->disabled_by_default);
724 buffer.encode_uint32(8, static_cast<uint32_t>(this->entity_category));
725 buffer.encode_string(9, this->device_class_ref_);
726#ifdef USE_DEVICES
727 buffer.encode_uint32(10, this->device_id);
728#endif
729}
731 size.add_length(1, this->object_id_ref_.size());
732 size.add_fixed32(1, this->key);
733 size.add_length(1, this->name_ref_.size());
734#ifdef USE_ENTITY_ICON
735 size.add_length(1, this->icon_ref_.size());
736#endif
737 size.add_bool(1, this->assumed_state);
738 size.add_bool(1, this->disabled_by_default);
739 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
740 size.add_length(1, this->device_class_ref_.size());
741#ifdef USE_DEVICES
742 size.add_uint32(1, this->device_id);
743#endif
744}
746 buffer.encode_fixed32(1, this->key);
747 buffer.encode_bool(2, this->state);
748#ifdef USE_DEVICES
749 buffer.encode_uint32(3, this->device_id);
750#endif
751}
753 size.add_fixed32(1, this->key);
754 size.add_bool(1, this->state);
755#ifdef USE_DEVICES
756 size.add_uint32(1, this->device_id);
757#endif
758}
759bool SwitchCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
760 switch (field_id) {
761 case 2:
762 this->state = value.as_bool();
763 break;
764#ifdef USE_DEVICES
765 case 3:
766 this->device_id = value.as_uint32();
767 break;
768#endif
769 default:
770 return false;
771 }
772 return true;
773}
774bool SwitchCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
775 switch (field_id) {
776 case 1:
777 this->key = value.as_fixed32();
778 break;
779 default:
780 return false;
781 }
782 return true;
783}
784#endif
785#ifdef USE_TEXT_SENSOR
787 buffer.encode_string(1, this->object_id_ref_);
788 buffer.encode_fixed32(2, this->key);
789 buffer.encode_string(3, this->name_ref_);
790#ifdef USE_ENTITY_ICON
791 buffer.encode_string(5, this->icon_ref_);
792#endif
793 buffer.encode_bool(6, this->disabled_by_default);
794 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
795 buffer.encode_string(8, this->device_class_ref_);
796#ifdef USE_DEVICES
797 buffer.encode_uint32(9, this->device_id);
798#endif
799}
801 size.add_length(1, this->object_id_ref_.size());
802 size.add_fixed32(1, this->key);
803 size.add_length(1, this->name_ref_.size());
804#ifdef USE_ENTITY_ICON
805 size.add_length(1, this->icon_ref_.size());
806#endif
807 size.add_bool(1, this->disabled_by_default);
808 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
809 size.add_length(1, this->device_class_ref_.size());
810#ifdef USE_DEVICES
811 size.add_uint32(1, this->device_id);
812#endif
813}
815 buffer.encode_fixed32(1, this->key);
816 buffer.encode_string(2, this->state_ref_);
817 buffer.encode_bool(3, this->missing_state);
818#ifdef USE_DEVICES
819 buffer.encode_uint32(4, this->device_id);
820#endif
821}
823 size.add_fixed32(1, this->key);
824 size.add_length(1, this->state_ref_.size());
825 size.add_bool(1, this->missing_state);
826#ifdef USE_DEVICES
827 size.add_uint32(1, this->device_id);
828#endif
829}
830#endif
831bool SubscribeLogsRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
832 switch (field_id) {
833 case 1:
834 this->level = static_cast<enums::LogLevel>(value.as_uint32());
835 break;
836 case 2:
837 this->dump_config = value.as_bool();
838 break;
839 default:
840 return false;
841 }
842 return true;
843}
845 buffer.encode_uint32(1, static_cast<uint32_t>(this->level));
846 buffer.encode_bytes(3, this->message_ptr_, this->message_len_);
847}
849 size.add_uint32(1, static_cast<uint32_t>(this->level));
850 size.add_length(1, this->message_len_);
851}
852#ifdef USE_API_NOISE
854 switch (field_id) {
855 case 1:
856 this->key = value.as_string();
857 break;
858 default:
859 return false;
860 }
861 return true;
862}
865#endif
866#ifdef USE_API_HOMEASSISTANT_SERVICES
868 buffer.encode_string(1, this->key_ref_);
869 buffer.encode_string(2, this->value);
870}
872 size.add_length(1, this->key_ref_.size());
873 size.add_length(1, this->value.size());
874}
876 buffer.encode_string(1, this->service_ref_);
877 for (auto &it : this->data) {
878 buffer.encode_message(2, it, true);
879 }
880 for (auto &it : this->data_template) {
881 buffer.encode_message(3, it, true);
882 }
883 for (auto &it : this->variables) {
884 buffer.encode_message(4, it, true);
885 }
886 buffer.encode_bool(5, this->is_event);
887}
889 size.add_length(1, this->service_ref_.size());
890 size.add_repeated_message(1, this->data);
891 size.add_repeated_message(1, this->data_template);
892 size.add_repeated_message(1, this->variables);
893 size.add_bool(1, this->is_event);
894}
895#endif
896#ifdef USE_API_HOMEASSISTANT_STATES
898 buffer.encode_string(1, this->entity_id_ref_);
899 buffer.encode_string(2, this->attribute_ref_);
900 buffer.encode_bool(3, this->once);
901}
903 size.add_length(1, this->entity_id_ref_.size());
904 size.add_length(1, this->attribute_ref_.size());
905 size.add_bool(1, this->once);
906}
908 switch (field_id) {
909 case 1:
910 this->entity_id = value.as_string();
911 break;
912 case 2:
913 this->state = value.as_string();
914 break;
915 case 3:
916 this->attribute = value.as_string();
917 break;
918 default:
919 return false;
920 }
921 return true;
922}
923#endif
925 switch (field_id) {
926 case 2: {
927 // Use raw data directly to avoid allocation
928 this->timezone = value.data();
929 this->timezone_len = value.size();
930 break;
931 }
932 default:
933 return false;
934 }
935 return true;
936}
937bool GetTimeResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
938 switch (field_id) {
939 case 1:
940 this->epoch_seconds = value.as_fixed32();
941 break;
942 default:
943 return false;
944 }
945 return true;
946}
947#ifdef USE_API_SERVICES
949 buffer.encode_string(1, this->name_ref_);
950 buffer.encode_uint32(2, static_cast<uint32_t>(this->type));
951}
953 size.add_length(1, this->name_ref_.size());
954 size.add_uint32(1, static_cast<uint32_t>(this->type));
955}
957 buffer.encode_string(1, this->name_ref_);
958 buffer.encode_fixed32(2, this->key);
959 for (auto &it : this->args) {
960 buffer.encode_message(3, it, true);
961 }
962}
964 size.add_length(1, this->name_ref_.size());
965 size.add_fixed32(1, this->key);
966 size.add_repeated_message(1, this->args);
967}
969 switch (field_id) {
970 case 1:
971 this->bool_ = value.as_bool();
972 break;
973 case 2:
974 this->legacy_int = value.as_int32();
975 break;
976 case 5:
977 this->int_ = value.as_sint32();
978 break;
979 case 6:
980 this->bool_array.push_back(value.as_bool());
981 break;
982 case 7:
983 this->int_array.push_back(value.as_sint32());
984 break;
985 default:
986 return false;
987 }
988 return true;
989}
991 switch (field_id) {
992 case 4:
993 this->string_ = value.as_string();
994 break;
995 case 9:
996 this->string_array.push_back(value.as_string());
997 break;
998 default:
999 return false;
1000 }
1001 return true;
1002}
1003bool ExecuteServiceArgument::decode_32bit(uint32_t field_id, Proto32Bit value) {
1004 switch (field_id) {
1005 case 3:
1006 this->float_ = value.as_float();
1007 break;
1008 case 8:
1009 this->float_array.push_back(value.as_float());
1010 break;
1011 default:
1012 return false;
1013 }
1014 return true;
1015}
1017 switch (field_id) {
1018 case 2:
1019 this->args.emplace_back();
1020 value.decode_to_message(this->args.back());
1021 break;
1022 default:
1023 return false;
1024 }
1025 return true;
1026}
1027bool ExecuteServiceRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1028 switch (field_id) {
1029 case 1:
1030 this->key = value.as_fixed32();
1031 break;
1032 default:
1033 return false;
1034 }
1035 return true;
1036}
1037#endif
1038#ifdef USE_CAMERA
1040 buffer.encode_string(1, this->object_id_ref_);
1041 buffer.encode_fixed32(2, this->key);
1042 buffer.encode_string(3, this->name_ref_);
1043 buffer.encode_bool(5, this->disabled_by_default);
1044#ifdef USE_ENTITY_ICON
1045 buffer.encode_string(6, this->icon_ref_);
1046#endif
1047 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
1048#ifdef USE_DEVICES
1049 buffer.encode_uint32(8, this->device_id);
1050#endif
1051}
1053 size.add_length(1, this->object_id_ref_.size());
1054 size.add_fixed32(1, this->key);
1055 size.add_length(1, this->name_ref_.size());
1056 size.add_bool(1, this->disabled_by_default);
1057#ifdef USE_ENTITY_ICON
1058 size.add_length(1, this->icon_ref_.size());
1059#endif
1060 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1061#ifdef USE_DEVICES
1062 size.add_uint32(1, this->device_id);
1063#endif
1064}
1066 buffer.encode_fixed32(1, this->key);
1067 buffer.encode_bytes(2, this->data_ptr_, this->data_len_);
1068 buffer.encode_bool(3, this->done);
1069#ifdef USE_DEVICES
1070 buffer.encode_uint32(4, this->device_id);
1071#endif
1072}
1074 size.add_fixed32(1, this->key);
1075 size.add_length(1, this->data_len_);
1076 size.add_bool(1, this->done);
1077#ifdef USE_DEVICES
1078 size.add_uint32(1, this->device_id);
1079#endif
1080}
1081bool CameraImageRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1082 switch (field_id) {
1083 case 1:
1084 this->single = value.as_bool();
1085 break;
1086 case 2:
1087 this->stream = value.as_bool();
1088 break;
1089 default:
1090 return false;
1091 }
1092 return true;
1093}
1094#endif
1095#ifdef USE_CLIMATE
1097 buffer.encode_string(1, this->object_id_ref_);
1098 buffer.encode_fixed32(2, this->key);
1099 buffer.encode_string(3, this->name_ref_);
1102 for (const auto &it : *this->supported_modes) {
1103 buffer.encode_uint32(7, static_cast<uint32_t>(it), true);
1104 }
1105 buffer.encode_float(8, this->visual_min_temperature);
1106 buffer.encode_float(9, this->visual_max_temperature);
1108 buffer.encode_bool(12, this->supports_action);
1109 for (const auto &it : *this->supported_fan_modes) {
1110 buffer.encode_uint32(13, static_cast<uint32_t>(it), true);
1111 }
1112 for (const auto &it : *this->supported_swing_modes) {
1113 buffer.encode_uint32(14, static_cast<uint32_t>(it), true);
1114 }
1115 for (const auto &it : *this->supported_custom_fan_modes) {
1116 buffer.encode_string(15, it, true);
1117 }
1118 for (const auto &it : *this->supported_presets) {
1119 buffer.encode_uint32(16, static_cast<uint32_t>(it), true);
1120 }
1121 for (const auto &it : *this->supported_custom_presets) {
1122 buffer.encode_string(17, it, true);
1123 }
1124 buffer.encode_bool(18, this->disabled_by_default);
1125#ifdef USE_ENTITY_ICON
1126 buffer.encode_string(19, this->icon_ref_);
1127#endif
1128 buffer.encode_uint32(20, static_cast<uint32_t>(this->entity_category));
1130 buffer.encode_bool(22, this->supports_current_humidity);
1131 buffer.encode_bool(23, this->supports_target_humidity);
1132 buffer.encode_float(24, this->visual_min_humidity);
1133 buffer.encode_float(25, this->visual_max_humidity);
1134#ifdef USE_DEVICES
1135 buffer.encode_uint32(26, this->device_id);
1136#endif
1137}
1139 size.add_length(1, this->object_id_ref_.size());
1140 size.add_fixed32(1, this->key);
1141 size.add_length(1, this->name_ref_.size());
1144 if (!this->supported_modes->empty()) {
1145 for (const auto &it : *this->supported_modes) {
1146 size.add_uint32_force(1, static_cast<uint32_t>(it));
1147 }
1148 }
1149 size.add_float(1, this->visual_min_temperature);
1150 size.add_float(1, this->visual_max_temperature);
1152 size.add_bool(1, this->supports_action);
1153 if (!this->supported_fan_modes->empty()) {
1154 for (const auto &it : *this->supported_fan_modes) {
1155 size.add_uint32_force(1, static_cast<uint32_t>(it));
1156 }
1157 }
1158 if (!this->supported_swing_modes->empty()) {
1159 for (const auto &it : *this->supported_swing_modes) {
1160 size.add_uint32_force(1, static_cast<uint32_t>(it));
1161 }
1162 }
1163 if (!this->supported_custom_fan_modes->empty()) {
1164 for (const auto &it : *this->supported_custom_fan_modes) {
1165 size.add_length_force(1, it.size());
1166 }
1167 }
1168 if (!this->supported_presets->empty()) {
1169 for (const auto &it : *this->supported_presets) {
1170 size.add_uint32_force(2, static_cast<uint32_t>(it));
1171 }
1172 }
1173 if (!this->supported_custom_presets->empty()) {
1174 for (const auto &it : *this->supported_custom_presets) {
1175 size.add_length_force(2, it.size());
1176 }
1177 }
1178 size.add_bool(2, this->disabled_by_default);
1179#ifdef USE_ENTITY_ICON
1180 size.add_length(2, this->icon_ref_.size());
1181#endif
1182 size.add_uint32(2, static_cast<uint32_t>(this->entity_category));
1184 size.add_bool(2, this->supports_current_humidity);
1185 size.add_bool(2, this->supports_target_humidity);
1186 size.add_float(2, this->visual_min_humidity);
1187 size.add_float(2, this->visual_max_humidity);
1188#ifdef USE_DEVICES
1189 size.add_uint32(2, this->device_id);
1190#endif
1191}
1193 buffer.encode_fixed32(1, this->key);
1194 buffer.encode_uint32(2, static_cast<uint32_t>(this->mode));
1195 buffer.encode_float(3, this->current_temperature);
1196 buffer.encode_float(4, this->target_temperature);
1197 buffer.encode_float(5, this->target_temperature_low);
1198 buffer.encode_float(6, this->target_temperature_high);
1199 buffer.encode_uint32(8, static_cast<uint32_t>(this->action));
1200 buffer.encode_uint32(9, static_cast<uint32_t>(this->fan_mode));
1201 buffer.encode_uint32(10, static_cast<uint32_t>(this->swing_mode));
1202 buffer.encode_string(11, this->custom_fan_mode_ref_);
1203 buffer.encode_uint32(12, static_cast<uint32_t>(this->preset));
1204 buffer.encode_string(13, this->custom_preset_ref_);
1205 buffer.encode_float(14, this->current_humidity);
1206 buffer.encode_float(15, this->target_humidity);
1207#ifdef USE_DEVICES
1208 buffer.encode_uint32(16, this->device_id);
1209#endif
1210}
1212 size.add_fixed32(1, this->key);
1213 size.add_uint32(1, static_cast<uint32_t>(this->mode));
1214 size.add_float(1, this->current_temperature);
1215 size.add_float(1, this->target_temperature);
1216 size.add_float(1, this->target_temperature_low);
1217 size.add_float(1, this->target_temperature_high);
1218 size.add_uint32(1, static_cast<uint32_t>(this->action));
1219 size.add_uint32(1, static_cast<uint32_t>(this->fan_mode));
1220 size.add_uint32(1, static_cast<uint32_t>(this->swing_mode));
1221 size.add_length(1, this->custom_fan_mode_ref_.size());
1222 size.add_uint32(1, static_cast<uint32_t>(this->preset));
1223 size.add_length(1, this->custom_preset_ref_.size());
1224 size.add_float(1, this->current_humidity);
1225 size.add_float(1, this->target_humidity);
1226#ifdef USE_DEVICES
1227 size.add_uint32(2, this->device_id);
1228#endif
1229}
1231 switch (field_id) {
1232 case 2:
1233 this->has_mode = value.as_bool();
1234 break;
1235 case 3:
1236 this->mode = static_cast<enums::ClimateMode>(value.as_uint32());
1237 break;
1238 case 4:
1239 this->has_target_temperature = value.as_bool();
1240 break;
1241 case 6:
1242 this->has_target_temperature_low = value.as_bool();
1243 break;
1244 case 8:
1245 this->has_target_temperature_high = value.as_bool();
1246 break;
1247 case 12:
1248 this->has_fan_mode = value.as_bool();
1249 break;
1250 case 13:
1251 this->fan_mode = static_cast<enums::ClimateFanMode>(value.as_uint32());
1252 break;
1253 case 14:
1254 this->has_swing_mode = value.as_bool();
1255 break;
1256 case 15:
1257 this->swing_mode = static_cast<enums::ClimateSwingMode>(value.as_uint32());
1258 break;
1259 case 16:
1260 this->has_custom_fan_mode = value.as_bool();
1261 break;
1262 case 18:
1263 this->has_preset = value.as_bool();
1264 break;
1265 case 19:
1266 this->preset = static_cast<enums::ClimatePreset>(value.as_uint32());
1267 break;
1268 case 20:
1269 this->has_custom_preset = value.as_bool();
1270 break;
1271 case 22:
1272 this->has_target_humidity = value.as_bool();
1273 break;
1274#ifdef USE_DEVICES
1275 case 24:
1276 this->device_id = value.as_uint32();
1277 break;
1278#endif
1279 default:
1280 return false;
1281 }
1282 return true;
1283}
1285 switch (field_id) {
1286 case 17:
1287 this->custom_fan_mode = value.as_string();
1288 break;
1289 case 21:
1290 this->custom_preset = value.as_string();
1291 break;
1292 default:
1293 return false;
1294 }
1295 return true;
1296}
1297bool ClimateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1298 switch (field_id) {
1299 case 1:
1300 this->key = value.as_fixed32();
1301 break;
1302 case 5:
1303 this->target_temperature = value.as_float();
1304 break;
1305 case 7:
1306 this->target_temperature_low = value.as_float();
1307 break;
1308 case 9:
1309 this->target_temperature_high = value.as_float();
1310 break;
1311 case 23:
1312 this->target_humidity = value.as_float();
1313 break;
1314 default:
1315 return false;
1316 }
1317 return true;
1318}
1319#endif
1320#ifdef USE_NUMBER
1322 buffer.encode_string(1, this->object_id_ref_);
1323 buffer.encode_fixed32(2, this->key);
1324 buffer.encode_string(3, this->name_ref_);
1325#ifdef USE_ENTITY_ICON
1326 buffer.encode_string(5, this->icon_ref_);
1327#endif
1328 buffer.encode_float(6, this->min_value);
1329 buffer.encode_float(7, this->max_value);
1330 buffer.encode_float(8, this->step);
1331 buffer.encode_bool(9, this->disabled_by_default);
1332 buffer.encode_uint32(10, static_cast<uint32_t>(this->entity_category));
1333 buffer.encode_string(11, this->unit_of_measurement_ref_);
1334 buffer.encode_uint32(12, static_cast<uint32_t>(this->mode));
1335 buffer.encode_string(13, this->device_class_ref_);
1336#ifdef USE_DEVICES
1337 buffer.encode_uint32(14, this->device_id);
1338#endif
1339}
1341 size.add_length(1, this->object_id_ref_.size());
1342 size.add_fixed32(1, this->key);
1343 size.add_length(1, this->name_ref_.size());
1344#ifdef USE_ENTITY_ICON
1345 size.add_length(1, this->icon_ref_.size());
1346#endif
1347 size.add_float(1, this->min_value);
1348 size.add_float(1, this->max_value);
1349 size.add_float(1, this->step);
1350 size.add_bool(1, this->disabled_by_default);
1351 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1352 size.add_length(1, this->unit_of_measurement_ref_.size());
1353 size.add_uint32(1, static_cast<uint32_t>(this->mode));
1354 size.add_length(1, this->device_class_ref_.size());
1355#ifdef USE_DEVICES
1356 size.add_uint32(1, this->device_id);
1357#endif
1358}
1360 buffer.encode_fixed32(1, this->key);
1361 buffer.encode_float(2, this->state);
1362 buffer.encode_bool(3, this->missing_state);
1363#ifdef USE_DEVICES
1364 buffer.encode_uint32(4, this->device_id);
1365#endif
1366}
1368 size.add_fixed32(1, this->key);
1369 size.add_float(1, this->state);
1370 size.add_bool(1, this->missing_state);
1371#ifdef USE_DEVICES
1372 size.add_uint32(1, this->device_id);
1373#endif
1374}
1375bool NumberCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1376 switch (field_id) {
1377#ifdef USE_DEVICES
1378 case 3:
1379 this->device_id = value.as_uint32();
1380 break;
1381#endif
1382 default:
1383 return false;
1384 }
1385 return true;
1386}
1387bool NumberCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1388 switch (field_id) {
1389 case 1:
1390 this->key = value.as_fixed32();
1391 break;
1392 case 2:
1393 this->state = value.as_float();
1394 break;
1395 default:
1396 return false;
1397 }
1398 return true;
1399}
1400#endif
1401#ifdef USE_SELECT
1403 buffer.encode_string(1, this->object_id_ref_);
1404 buffer.encode_fixed32(2, this->key);
1405 buffer.encode_string(3, this->name_ref_);
1406#ifdef USE_ENTITY_ICON
1407 buffer.encode_string(5, this->icon_ref_);
1408#endif
1409 for (const auto &it : *this->options) {
1410 buffer.encode_string(6, it, true);
1411 }
1412 buffer.encode_bool(7, this->disabled_by_default);
1413 buffer.encode_uint32(8, static_cast<uint32_t>(this->entity_category));
1414#ifdef USE_DEVICES
1415 buffer.encode_uint32(9, this->device_id);
1416#endif
1417}
1419 size.add_length(1, this->object_id_ref_.size());
1420 size.add_fixed32(1, this->key);
1421 size.add_length(1, this->name_ref_.size());
1422#ifdef USE_ENTITY_ICON
1423 size.add_length(1, this->icon_ref_.size());
1424#endif
1425 if (!this->options->empty()) {
1426 for (const auto &it : *this->options) {
1427 size.add_length_force(1, it.size());
1428 }
1429 }
1430 size.add_bool(1, this->disabled_by_default);
1431 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1432#ifdef USE_DEVICES
1433 size.add_uint32(1, this->device_id);
1434#endif
1435}
1437 buffer.encode_fixed32(1, this->key);
1438 buffer.encode_string(2, this->state_ref_);
1439 buffer.encode_bool(3, this->missing_state);
1440#ifdef USE_DEVICES
1441 buffer.encode_uint32(4, this->device_id);
1442#endif
1443}
1445 size.add_fixed32(1, this->key);
1446 size.add_length(1, this->state_ref_.size());
1447 size.add_bool(1, this->missing_state);
1448#ifdef USE_DEVICES
1449 size.add_uint32(1, this->device_id);
1450#endif
1451}
1452bool SelectCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1453 switch (field_id) {
1454#ifdef USE_DEVICES
1455 case 3:
1456 this->device_id = value.as_uint32();
1457 break;
1458#endif
1459 default:
1460 return false;
1461 }
1462 return true;
1463}
1465 switch (field_id) {
1466 case 2:
1467 this->state = value.as_string();
1468 break;
1469 default:
1470 return false;
1471 }
1472 return true;
1473}
1474bool SelectCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1475 switch (field_id) {
1476 case 1:
1477 this->key = value.as_fixed32();
1478 break;
1479 default:
1480 return false;
1481 }
1482 return true;
1483}
1484#endif
1485#ifdef USE_SIREN
1487 buffer.encode_string(1, this->object_id_ref_);
1488 buffer.encode_fixed32(2, this->key);
1489 buffer.encode_string(3, this->name_ref_);
1490#ifdef USE_ENTITY_ICON
1491 buffer.encode_string(5, this->icon_ref_);
1492#endif
1493 buffer.encode_bool(6, this->disabled_by_default);
1494 for (auto &it : this->tones) {
1495 buffer.encode_string(7, it, true);
1496 }
1497 buffer.encode_bool(8, this->supports_duration);
1498 buffer.encode_bool(9, this->supports_volume);
1499 buffer.encode_uint32(10, static_cast<uint32_t>(this->entity_category));
1500#ifdef USE_DEVICES
1501 buffer.encode_uint32(11, this->device_id);
1502#endif
1503}
1505 size.add_length(1, this->object_id_ref_.size());
1506 size.add_fixed32(1, this->key);
1507 size.add_length(1, this->name_ref_.size());
1508#ifdef USE_ENTITY_ICON
1509 size.add_length(1, this->icon_ref_.size());
1510#endif
1511 size.add_bool(1, this->disabled_by_default);
1512 if (!this->tones.empty()) {
1513 for (const auto &it : this->tones) {
1514 size.add_length_force(1, it.size());
1515 }
1516 }
1517 size.add_bool(1, this->supports_duration);
1518 size.add_bool(1, this->supports_volume);
1519 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1520#ifdef USE_DEVICES
1521 size.add_uint32(1, this->device_id);
1522#endif
1523}
1525 buffer.encode_fixed32(1, this->key);
1526 buffer.encode_bool(2, this->state);
1527#ifdef USE_DEVICES
1528 buffer.encode_uint32(3, this->device_id);
1529#endif
1530}
1532 size.add_fixed32(1, this->key);
1533 size.add_bool(1, this->state);
1534#ifdef USE_DEVICES
1535 size.add_uint32(1, this->device_id);
1536#endif
1537}
1538bool SirenCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1539 switch (field_id) {
1540 case 2:
1541 this->has_state = value.as_bool();
1542 break;
1543 case 3:
1544 this->state = value.as_bool();
1545 break;
1546 case 4:
1547 this->has_tone = value.as_bool();
1548 break;
1549 case 6:
1550 this->has_duration = value.as_bool();
1551 break;
1552 case 7:
1553 this->duration = value.as_uint32();
1554 break;
1555 case 8:
1556 this->has_volume = value.as_bool();
1557 break;
1558#ifdef USE_DEVICES
1559 case 10:
1560 this->device_id = value.as_uint32();
1561 break;
1562#endif
1563 default:
1564 return false;
1565 }
1566 return true;
1567}
1569 switch (field_id) {
1570 case 5:
1571 this->tone = value.as_string();
1572 break;
1573 default:
1574 return false;
1575 }
1576 return true;
1577}
1578bool SirenCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1579 switch (field_id) {
1580 case 1:
1581 this->key = value.as_fixed32();
1582 break;
1583 case 9:
1584 this->volume = value.as_float();
1585 break;
1586 default:
1587 return false;
1588 }
1589 return true;
1590}
1591#endif
1592#ifdef USE_LOCK
1594 buffer.encode_string(1, this->object_id_ref_);
1595 buffer.encode_fixed32(2, this->key);
1596 buffer.encode_string(3, this->name_ref_);
1597#ifdef USE_ENTITY_ICON
1598 buffer.encode_string(5, this->icon_ref_);
1599#endif
1600 buffer.encode_bool(6, this->disabled_by_default);
1601 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
1602 buffer.encode_bool(8, this->assumed_state);
1603 buffer.encode_bool(9, this->supports_open);
1604 buffer.encode_bool(10, this->requires_code);
1605 buffer.encode_string(11, this->code_format_ref_);
1606#ifdef USE_DEVICES
1607 buffer.encode_uint32(12, this->device_id);
1608#endif
1609}
1611 size.add_length(1, this->object_id_ref_.size());
1612 size.add_fixed32(1, this->key);
1613 size.add_length(1, this->name_ref_.size());
1614#ifdef USE_ENTITY_ICON
1615 size.add_length(1, this->icon_ref_.size());
1616#endif
1617 size.add_bool(1, this->disabled_by_default);
1618 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1619 size.add_bool(1, this->assumed_state);
1620 size.add_bool(1, this->supports_open);
1621 size.add_bool(1, this->requires_code);
1622 size.add_length(1, this->code_format_ref_.size());
1623#ifdef USE_DEVICES
1624 size.add_uint32(1, this->device_id);
1625#endif
1626}
1628 buffer.encode_fixed32(1, this->key);
1629 buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
1630#ifdef USE_DEVICES
1631 buffer.encode_uint32(3, this->device_id);
1632#endif
1633}
1635 size.add_fixed32(1, this->key);
1636 size.add_uint32(1, static_cast<uint32_t>(this->state));
1637#ifdef USE_DEVICES
1638 size.add_uint32(1, this->device_id);
1639#endif
1640}
1641bool LockCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1642 switch (field_id) {
1643 case 2:
1644 this->command = static_cast<enums::LockCommand>(value.as_uint32());
1645 break;
1646 case 3:
1647 this->has_code = value.as_bool();
1648 break;
1649#ifdef USE_DEVICES
1650 case 5:
1651 this->device_id = value.as_uint32();
1652 break;
1653#endif
1654 default:
1655 return false;
1656 }
1657 return true;
1658}
1660 switch (field_id) {
1661 case 4:
1662 this->code = value.as_string();
1663 break;
1664 default:
1665 return false;
1666 }
1667 return true;
1668}
1669bool LockCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1670 switch (field_id) {
1671 case 1:
1672 this->key = value.as_fixed32();
1673 break;
1674 default:
1675 return false;
1676 }
1677 return true;
1678}
1679#endif
1680#ifdef USE_BUTTON
1682 buffer.encode_string(1, this->object_id_ref_);
1683 buffer.encode_fixed32(2, this->key);
1684 buffer.encode_string(3, this->name_ref_);
1685#ifdef USE_ENTITY_ICON
1686 buffer.encode_string(5, this->icon_ref_);
1687#endif
1688 buffer.encode_bool(6, this->disabled_by_default);
1689 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
1690 buffer.encode_string(8, this->device_class_ref_);
1691#ifdef USE_DEVICES
1692 buffer.encode_uint32(9, this->device_id);
1693#endif
1694}
1696 size.add_length(1, this->object_id_ref_.size());
1697 size.add_fixed32(1, this->key);
1698 size.add_length(1, this->name_ref_.size());
1699#ifdef USE_ENTITY_ICON
1700 size.add_length(1, this->icon_ref_.size());
1701#endif
1702 size.add_bool(1, this->disabled_by_default);
1703 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1704 size.add_length(1, this->device_class_ref_.size());
1705#ifdef USE_DEVICES
1706 size.add_uint32(1, this->device_id);
1707#endif
1708}
1709bool ButtonCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1710 switch (field_id) {
1711#ifdef USE_DEVICES
1712 case 2:
1713 this->device_id = value.as_uint32();
1714 break;
1715#endif
1716 default:
1717 return false;
1718 }
1719 return true;
1720}
1721bool ButtonCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1722 switch (field_id) {
1723 case 1:
1724 this->key = value.as_fixed32();
1725 break;
1726 default:
1727 return false;
1728 }
1729 return true;
1730}
1731#endif
1732#ifdef USE_MEDIA_PLAYER
1734 buffer.encode_string(1, this->format_ref_);
1735 buffer.encode_uint32(2, this->sample_rate);
1736 buffer.encode_uint32(3, this->num_channels);
1737 buffer.encode_uint32(4, static_cast<uint32_t>(this->purpose));
1738 buffer.encode_uint32(5, this->sample_bytes);
1739}
1741 size.add_length(1, this->format_ref_.size());
1742 size.add_uint32(1, this->sample_rate);
1743 size.add_uint32(1, this->num_channels);
1744 size.add_uint32(1, static_cast<uint32_t>(this->purpose));
1745 size.add_uint32(1, this->sample_bytes);
1746}
1748 buffer.encode_string(1, this->object_id_ref_);
1749 buffer.encode_fixed32(2, this->key);
1750 buffer.encode_string(3, this->name_ref_);
1751#ifdef USE_ENTITY_ICON
1752 buffer.encode_string(5, this->icon_ref_);
1753#endif
1754 buffer.encode_bool(6, this->disabled_by_default);
1755 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
1756 buffer.encode_bool(8, this->supports_pause);
1757 for (auto &it : this->supported_formats) {
1758 buffer.encode_message(9, it, true);
1759 }
1760#ifdef USE_DEVICES
1761 buffer.encode_uint32(10, this->device_id);
1762#endif
1763 buffer.encode_uint32(11, this->feature_flags);
1764}
1766 size.add_length(1, this->object_id_ref_.size());
1767 size.add_fixed32(1, this->key);
1768 size.add_length(1, this->name_ref_.size());
1769#ifdef USE_ENTITY_ICON
1770 size.add_length(1, this->icon_ref_.size());
1771#endif
1772 size.add_bool(1, this->disabled_by_default);
1773 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1774 size.add_bool(1, this->supports_pause);
1776#ifdef USE_DEVICES
1777 size.add_uint32(1, this->device_id);
1778#endif
1779 size.add_uint32(1, this->feature_flags);
1780}
1782 buffer.encode_fixed32(1, this->key);
1783 buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
1784 buffer.encode_float(3, this->volume);
1785 buffer.encode_bool(4, this->muted);
1786#ifdef USE_DEVICES
1787 buffer.encode_uint32(5, this->device_id);
1788#endif
1789}
1791 size.add_fixed32(1, this->key);
1792 size.add_uint32(1, static_cast<uint32_t>(this->state));
1793 size.add_float(1, this->volume);
1794 size.add_bool(1, this->muted);
1795#ifdef USE_DEVICES
1796 size.add_uint32(1, this->device_id);
1797#endif
1798}
1800 switch (field_id) {
1801 case 2:
1802 this->has_command = value.as_bool();
1803 break;
1804 case 3:
1805 this->command = static_cast<enums::MediaPlayerCommand>(value.as_uint32());
1806 break;
1807 case 4:
1808 this->has_volume = value.as_bool();
1809 break;
1810 case 6:
1811 this->has_media_url = value.as_bool();
1812 break;
1813 case 8:
1814 this->has_announcement = value.as_bool();
1815 break;
1816 case 9:
1817 this->announcement = value.as_bool();
1818 break;
1819#ifdef USE_DEVICES
1820 case 10:
1821 this->device_id = value.as_uint32();
1822 break;
1823#endif
1824 default:
1825 return false;
1826 }
1827 return true;
1828}
1830 switch (field_id) {
1831 case 7:
1832 this->media_url = value.as_string();
1833 break;
1834 default:
1835 return false;
1836 }
1837 return true;
1838}
1840 switch (field_id) {
1841 case 1:
1842 this->key = value.as_fixed32();
1843 break;
1844 case 5:
1845 this->volume = value.as_float();
1846 break;
1847 default:
1848 return false;
1849 }
1850 return true;
1851}
1852#endif
1853#ifdef USE_BLUETOOTH_PROXY
1855 switch (field_id) {
1856 case 1:
1857 this->flags = value.as_uint32();
1858 break;
1859 default:
1860 return false;
1861 }
1862 return true;
1863}
1865 buffer.encode_uint64(1, this->address);
1866 buffer.encode_sint32(2, this->rssi);
1867 buffer.encode_uint32(3, this->address_type);
1868 buffer.encode_bytes(4, this->data, this->data_len);
1869}
1871 size.add_uint64(1, this->address);
1872 size.add_sint32(1, this->rssi);
1873 size.add_uint32(1, this->address_type);
1874 size.add_length(1, this->data_len);
1875}
1877 for (uint16_t i = 0; i < this->advertisements_len; i++) {
1878 buffer.encode_message(1, this->advertisements[i], true);
1879 }
1880}
1882 for (uint16_t i = 0; i < this->advertisements_len; i++) {
1883 size.add_message_object_force(1, this->advertisements[i]);
1884 }
1885}
1887 switch (field_id) {
1888 case 1:
1889 this->address = value.as_uint64();
1890 break;
1891 case 2:
1892 this->request_type = static_cast<enums::BluetoothDeviceRequestType>(value.as_uint32());
1893 break;
1894 case 3:
1895 this->has_address_type = value.as_bool();
1896 break;
1897 case 4:
1898 this->address_type = value.as_uint32();
1899 break;
1900 default:
1901 return false;
1902 }
1903 return true;
1904}
1906 buffer.encode_uint64(1, this->address);
1907 buffer.encode_bool(2, this->connected);
1908 buffer.encode_uint32(3, this->mtu);
1909 buffer.encode_int32(4, this->error);
1910}
1912 size.add_uint64(1, this->address);
1913 size.add_bool(1, this->connected);
1914 size.add_uint32(1, this->mtu);
1915 size.add_int32(1, this->error);
1916}
1918 switch (field_id) {
1919 case 1:
1920 this->address = value.as_uint64();
1921 break;
1922 default:
1923 return false;
1924 }
1925 return true;
1926}
1928 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
1929 buffer.encode_uint64(1, this->uuid[0], true);
1930 buffer.encode_uint64(1, this->uuid[1], true);
1931 }
1932 buffer.encode_uint32(2, this->handle);
1933 buffer.encode_uint32(3, this->short_uuid);
1934}
1936 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
1937 size.add_uint64_force(1, this->uuid[0]);
1938 size.add_uint64_force(1, this->uuid[1]);
1939 }
1940 size.add_uint32(1, this->handle);
1941 size.add_uint32(1, this->short_uuid);
1942}
1944 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
1945 buffer.encode_uint64(1, this->uuid[0], true);
1946 buffer.encode_uint64(1, this->uuid[1], true);
1947 }
1948 buffer.encode_uint32(2, this->handle);
1949 buffer.encode_uint32(3, this->properties);
1950 for (auto &it : this->descriptors) {
1951 buffer.encode_message(4, it, true);
1952 }
1953 buffer.encode_uint32(5, this->short_uuid);
1954}
1956 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
1957 size.add_uint64_force(1, this->uuid[0]);
1958 size.add_uint64_force(1, this->uuid[1]);
1959 }
1960 size.add_uint32(1, this->handle);
1961 size.add_uint32(1, this->properties);
1962 size.add_repeated_message(1, this->descriptors);
1963 size.add_uint32(1, this->short_uuid);
1964}
1966 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
1967 buffer.encode_uint64(1, this->uuid[0], true);
1968 buffer.encode_uint64(1, this->uuid[1], true);
1969 }
1970 buffer.encode_uint32(2, this->handle);
1971 for (auto &it : this->characteristics) {
1972 buffer.encode_message(3, it, true);
1973 }
1974 buffer.encode_uint32(4, this->short_uuid);
1975}
1977 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
1978 size.add_uint64_force(1, this->uuid[0]);
1979 size.add_uint64_force(1, this->uuid[1]);
1980 }
1981 size.add_uint32(1, this->handle);
1983 size.add_uint32(1, this->short_uuid);
1984}
1986 buffer.encode_uint64(1, this->address);
1987 for (auto &it : this->services) {
1988 buffer.encode_message(2, it, true);
1989 }
1990}
1992 size.add_uint64(1, this->address);
1993 size.add_repeated_message(1, this->services);
1994}
2000 switch (field_id) {
2001 case 1:
2002 this->address = value.as_uint64();
2003 break;
2004 case 2:
2005 this->handle = value.as_uint32();
2006 break;
2007 default:
2008 return false;
2009 }
2010 return true;
2011}
2013 buffer.encode_uint64(1, this->address);
2014 buffer.encode_uint32(2, this->handle);
2015 buffer.encode_bytes(3, this->data_ptr_, this->data_len_);
2016}
2018 size.add_uint64(1, this->address);
2019 size.add_uint32(1, this->handle);
2020 size.add_length(1, this->data_len_);
2021}
2023 switch (field_id) {
2024 case 1:
2025 this->address = value.as_uint64();
2026 break;
2027 case 2:
2028 this->handle = value.as_uint32();
2029 break;
2030 case 3:
2031 this->response = value.as_bool();
2032 break;
2033 default:
2034 return false;
2035 }
2036 return true;
2037}
2039 switch (field_id) {
2040 case 4: {
2041 // Use raw data directly to avoid allocation
2042 this->data = value.data();
2043 this->data_len = value.size();
2044 break;
2045 }
2046 default:
2047 return false;
2048 }
2049 return true;
2050}
2052 switch (field_id) {
2053 case 1:
2054 this->address = value.as_uint64();
2055 break;
2056 case 2:
2057 this->handle = value.as_uint32();
2058 break;
2059 default:
2060 return false;
2061 }
2062 return true;
2063}
2065 switch (field_id) {
2066 case 1:
2067 this->address = value.as_uint64();
2068 break;
2069 case 2:
2070 this->handle = value.as_uint32();
2071 break;
2072 default:
2073 return false;
2074 }
2075 return true;
2076}
2078 switch (field_id) {
2079 case 3: {
2080 // Use raw data directly to avoid allocation
2081 this->data = value.data();
2082 this->data_len = value.size();
2083 break;
2084 }
2085 default:
2086 return false;
2087 }
2088 return true;
2089}
2091 switch (field_id) {
2092 case 1:
2093 this->address = value.as_uint64();
2094 break;
2095 case 2:
2096 this->handle = value.as_uint32();
2097 break;
2098 case 3:
2099 this->enable = value.as_bool();
2100 break;
2101 default:
2102 return false;
2103 }
2104 return true;
2105}
2107 buffer.encode_uint64(1, this->address);
2108 buffer.encode_uint32(2, this->handle);
2109 buffer.encode_bytes(3, this->data_ptr_, this->data_len_);
2110}
2112 size.add_uint64(1, this->address);
2113 size.add_uint32(1, this->handle);
2114 size.add_length(1, this->data_len_);
2115}
2117 buffer.encode_uint32(1, this->free);
2118 buffer.encode_uint32(2, this->limit);
2119 for (const auto &it : this->allocated) {
2120 if (it != 0) {
2121 buffer.encode_uint64(3, it, true);
2122 }
2123 }
2124}
2126 size.add_uint32(1, this->free);
2127 size.add_uint32(1, this->limit);
2128 for (const auto &it : this->allocated) {
2129 if (it != 0) {
2130 size.add_uint64_force(1, it);
2131 }
2132 }
2133}
2135 buffer.encode_uint64(1, this->address);
2136 buffer.encode_uint32(2, this->handle);
2137 buffer.encode_int32(3, this->error);
2138}
2140 size.add_uint64(1, this->address);
2141 size.add_uint32(1, this->handle);
2142 size.add_int32(1, this->error);
2143}
2145 buffer.encode_uint64(1, this->address);
2146 buffer.encode_uint32(2, this->handle);
2147}
2149 size.add_uint64(1, this->address);
2150 size.add_uint32(1, this->handle);
2151}
2153 buffer.encode_uint64(1, this->address);
2154 buffer.encode_uint32(2, this->handle);
2155}
2157 size.add_uint64(1, this->address);
2158 size.add_uint32(1, this->handle);
2159}
2161 buffer.encode_uint64(1, this->address);
2162 buffer.encode_bool(2, this->paired);
2163 buffer.encode_int32(3, this->error);
2164}
2166 size.add_uint64(1, this->address);
2167 size.add_bool(1, this->paired);
2168 size.add_int32(1, this->error);
2169}
2171 buffer.encode_uint64(1, this->address);
2172 buffer.encode_bool(2, this->success);
2173 buffer.encode_int32(3, this->error);
2174}
2176 size.add_uint64(1, this->address);
2177 size.add_bool(1, this->success);
2178 size.add_int32(1, this->error);
2179}
2181 buffer.encode_uint64(1, this->address);
2182 buffer.encode_bool(2, this->success);
2183 buffer.encode_int32(3, this->error);
2184}
2186 size.add_uint64(1, this->address);
2187 size.add_bool(1, this->success);
2188 size.add_int32(1, this->error);
2189}
2191 buffer.encode_uint32(1, static_cast<uint32_t>(this->state));
2192 buffer.encode_uint32(2, static_cast<uint32_t>(this->mode));
2193 buffer.encode_uint32(3, static_cast<uint32_t>(this->configured_mode));
2194}
2196 size.add_uint32(1, static_cast<uint32_t>(this->state));
2197 size.add_uint32(1, static_cast<uint32_t>(this->mode));
2198 size.add_uint32(1, static_cast<uint32_t>(this->configured_mode));
2199}
2201 switch (field_id) {
2202 case 1:
2203 this->mode = static_cast<enums::BluetoothScannerMode>(value.as_uint32());
2204 break;
2205 default:
2206 return false;
2207 }
2208 return true;
2209}
2210#endif
2211#ifdef USE_VOICE_ASSISTANT
2213 switch (field_id) {
2214 case 1:
2215 this->subscribe = value.as_bool();
2216 break;
2217 case 2:
2218 this->flags = value.as_uint32();
2219 break;
2220 default:
2221 return false;
2222 }
2223 return true;
2224}
2226 buffer.encode_uint32(1, this->noise_suppression_level);
2227 buffer.encode_uint32(2, this->auto_gain);
2228 buffer.encode_float(3, this->volume_multiplier);
2229}
2231 size.add_uint32(1, this->noise_suppression_level);
2232 size.add_uint32(1, this->auto_gain);
2233 size.add_float(1, this->volume_multiplier);
2234}
2236 buffer.encode_bool(1, this->start);
2237 buffer.encode_string(2, this->conversation_id_ref_);
2238 buffer.encode_uint32(3, this->flags);
2239 buffer.encode_message(4, this->audio_settings);
2240 buffer.encode_string(5, this->wake_word_phrase_ref_);
2241}
2243 size.add_bool(1, this->start);
2244 size.add_length(1, this->conversation_id_ref_.size());
2245 size.add_uint32(1, this->flags);
2246 size.add_message_object(1, this->audio_settings);
2247 size.add_length(1, this->wake_word_phrase_ref_.size());
2248}
2250 switch (field_id) {
2251 case 1:
2252 this->port = value.as_uint32();
2253 break;
2254 case 2:
2255 this->error = value.as_bool();
2256 break;
2257 default:
2258 return false;
2259 }
2260 return true;
2261}
2263 switch (field_id) {
2264 case 1:
2265 this->name = value.as_string();
2266 break;
2267 case 2:
2268 this->value = value.as_string();
2269 break;
2270 default:
2271 return false;
2272 }
2273 return true;
2274}
2276 switch (field_id) {
2277 case 1:
2278 this->event_type = static_cast<enums::VoiceAssistantEvent>(value.as_uint32());
2279 break;
2280 default:
2281 return false;
2282 }
2283 return true;
2284}
2286 switch (field_id) {
2287 case 2:
2288 this->data.emplace_back();
2289 value.decode_to_message(this->data.back());
2290 break;
2291 default:
2292 return false;
2293 }
2294 return true;
2295}
2296bool VoiceAssistantAudio::decode_varint(uint32_t field_id, ProtoVarInt value) {
2297 switch (field_id) {
2298 case 2:
2299 this->end = value.as_bool();
2300 break;
2301 default:
2302 return false;
2303 }
2304 return true;
2305}
2307 switch (field_id) {
2308 case 1:
2309 this->data = value.as_string();
2310 break;
2311 default:
2312 return false;
2313 }
2314 return true;
2315}
2317 buffer.encode_bytes(1, this->data_ptr_, this->data_len_);
2318 buffer.encode_bool(2, this->end);
2319}
2321 size.add_length(1, this->data_len_);
2322 size.add_bool(1, this->end);
2323}
2325 switch (field_id) {
2326 case 1:
2327 this->event_type = static_cast<enums::VoiceAssistantTimerEvent>(value.as_uint32());
2328 break;
2329 case 4:
2330 this->total_seconds = value.as_uint32();
2331 break;
2332 case 5:
2333 this->seconds_left = value.as_uint32();
2334 break;
2335 case 6:
2336 this->is_active = value.as_bool();
2337 break;
2338 default:
2339 return false;
2340 }
2341 return true;
2342}
2344 switch (field_id) {
2345 case 2:
2346 this->timer_id = value.as_string();
2347 break;
2348 case 3:
2349 this->name = value.as_string();
2350 break;
2351 default:
2352 return false;
2353 }
2354 return true;
2355}
2357 switch (field_id) {
2358 case 4:
2359 this->start_conversation = value.as_bool();
2360 break;
2361 default:
2362 return false;
2363 }
2364 return true;
2365}
2367 switch (field_id) {
2368 case 1:
2369 this->media_id = value.as_string();
2370 break;
2371 case 2:
2372 this->text = value.as_string();
2373 break;
2374 case 3:
2375 this->preannounce_media_id = value.as_string();
2376 break;
2377 default:
2378 return false;
2379 }
2380 return true;
2381}
2385 buffer.encode_string(1, this->id_ref_);
2386 buffer.encode_string(2, this->wake_word_ref_);
2387 for (auto &it : this->trained_languages) {
2388 buffer.encode_string(3, it, true);
2389 }
2390}
2392 size.add_length(1, this->id_ref_.size());
2393 size.add_length(1, this->wake_word_ref_.size());
2394 if (!this->trained_languages.empty()) {
2395 for (const auto &it : this->trained_languages) {
2396 size.add_length_force(1, it.size());
2397 }
2398 }
2399}
2401 switch (field_id) {
2402 case 5:
2403 this->model_size = value.as_uint32();
2404 break;
2405 default:
2406 return false;
2407 }
2408 return true;
2409}
2411 switch (field_id) {
2412 case 1:
2413 this->id = value.as_string();
2414 break;
2415 case 2:
2416 this->wake_word = value.as_string();
2417 break;
2418 case 3:
2419 this->trained_languages.push_back(value.as_string());
2420 break;
2421 case 4:
2422 this->model_type = value.as_string();
2423 break;
2424 case 6:
2425 this->model_hash = value.as_string();
2426 break;
2427 case 7:
2428 this->url = value.as_string();
2429 break;
2430 default:
2431 return false;
2432 }
2433 return true;
2434}
2436 switch (field_id) {
2437 case 1:
2438 this->external_wake_words.emplace_back();
2439 value.decode_to_message(this->external_wake_words.back());
2440 break;
2441 default:
2442 return false;
2443 }
2444 return true;
2445}
2447 for (auto &it : this->available_wake_words) {
2448 buffer.encode_message(1, it, true);
2449 }
2450 for (const auto &it : *this->active_wake_words) {
2451 buffer.encode_string(2, it, true);
2452 }
2453 buffer.encode_uint32(3, this->max_active_wake_words);
2454}
2457 if (!this->active_wake_words->empty()) {
2458 for (const auto &it : *this->active_wake_words) {
2459 size.add_length_force(1, it.size());
2460 }
2461 }
2462 size.add_uint32(1, this->max_active_wake_words);
2463}
2465 switch (field_id) {
2466 case 1:
2467 this->active_wake_words.push_back(value.as_string());
2468 break;
2469 default:
2470 return false;
2471 }
2472 return true;
2473}
2474#endif
2475#ifdef USE_ALARM_CONTROL_PANEL
2477 buffer.encode_string(1, this->object_id_ref_);
2478 buffer.encode_fixed32(2, this->key);
2479 buffer.encode_string(3, this->name_ref_);
2480#ifdef USE_ENTITY_ICON
2481 buffer.encode_string(5, this->icon_ref_);
2482#endif
2483 buffer.encode_bool(6, this->disabled_by_default);
2484 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2485 buffer.encode_uint32(8, this->supported_features);
2486 buffer.encode_bool(9, this->requires_code);
2487 buffer.encode_bool(10, this->requires_code_to_arm);
2488#ifdef USE_DEVICES
2489 buffer.encode_uint32(11, this->device_id);
2490#endif
2491}
2493 size.add_length(1, this->object_id_ref_.size());
2494 size.add_fixed32(1, this->key);
2495 size.add_length(1, this->name_ref_.size());
2496#ifdef USE_ENTITY_ICON
2497 size.add_length(1, this->icon_ref_.size());
2498#endif
2499 size.add_bool(1, this->disabled_by_default);
2500 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2501 size.add_uint32(1, this->supported_features);
2502 size.add_bool(1, this->requires_code);
2503 size.add_bool(1, this->requires_code_to_arm);
2504#ifdef USE_DEVICES
2505 size.add_uint32(1, this->device_id);
2506#endif
2507}
2509 buffer.encode_fixed32(1, this->key);
2510 buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
2511#ifdef USE_DEVICES
2512 buffer.encode_uint32(3, this->device_id);
2513#endif
2514}
2516 size.add_fixed32(1, this->key);
2517 size.add_uint32(1, static_cast<uint32_t>(this->state));
2518#ifdef USE_DEVICES
2519 size.add_uint32(1, this->device_id);
2520#endif
2521}
2523 switch (field_id) {
2524 case 2:
2525 this->command = static_cast<enums::AlarmControlPanelStateCommand>(value.as_uint32());
2526 break;
2527#ifdef USE_DEVICES
2528 case 4:
2529 this->device_id = value.as_uint32();
2530 break;
2531#endif
2532 default:
2533 return false;
2534 }
2535 return true;
2536}
2538 switch (field_id) {
2539 case 3:
2540 this->code = value.as_string();
2541 break;
2542 default:
2543 return false;
2544 }
2545 return true;
2546}
2548 switch (field_id) {
2549 case 1:
2550 this->key = value.as_fixed32();
2551 break;
2552 default:
2553 return false;
2554 }
2555 return true;
2556}
2557#endif
2558#ifdef USE_TEXT
2560 buffer.encode_string(1, this->object_id_ref_);
2561 buffer.encode_fixed32(2, this->key);
2562 buffer.encode_string(3, this->name_ref_);
2563#ifdef USE_ENTITY_ICON
2564 buffer.encode_string(5, this->icon_ref_);
2565#endif
2566 buffer.encode_bool(6, this->disabled_by_default);
2567 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2568 buffer.encode_uint32(8, this->min_length);
2569 buffer.encode_uint32(9, this->max_length);
2570 buffer.encode_string(10, this->pattern_ref_);
2571 buffer.encode_uint32(11, static_cast<uint32_t>(this->mode));
2572#ifdef USE_DEVICES
2573 buffer.encode_uint32(12, this->device_id);
2574#endif
2575}
2577 size.add_length(1, this->object_id_ref_.size());
2578 size.add_fixed32(1, this->key);
2579 size.add_length(1, this->name_ref_.size());
2580#ifdef USE_ENTITY_ICON
2581 size.add_length(1, this->icon_ref_.size());
2582#endif
2583 size.add_bool(1, this->disabled_by_default);
2584 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2585 size.add_uint32(1, this->min_length);
2586 size.add_uint32(1, this->max_length);
2587 size.add_length(1, this->pattern_ref_.size());
2588 size.add_uint32(1, static_cast<uint32_t>(this->mode));
2589#ifdef USE_DEVICES
2590 size.add_uint32(1, this->device_id);
2591#endif
2592}
2594 buffer.encode_fixed32(1, this->key);
2595 buffer.encode_string(2, this->state_ref_);
2596 buffer.encode_bool(3, this->missing_state);
2597#ifdef USE_DEVICES
2598 buffer.encode_uint32(4, this->device_id);
2599#endif
2600}
2602 size.add_fixed32(1, this->key);
2603 size.add_length(1, this->state_ref_.size());
2604 size.add_bool(1, this->missing_state);
2605#ifdef USE_DEVICES
2606 size.add_uint32(1, this->device_id);
2607#endif
2608}
2609bool TextCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2610 switch (field_id) {
2611#ifdef USE_DEVICES
2612 case 3:
2613 this->device_id = value.as_uint32();
2614 break;
2615#endif
2616 default:
2617 return false;
2618 }
2619 return true;
2620}
2622 switch (field_id) {
2623 case 2:
2624 this->state = value.as_string();
2625 break;
2626 default:
2627 return false;
2628 }
2629 return true;
2630}
2631bool TextCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2632 switch (field_id) {
2633 case 1:
2634 this->key = value.as_fixed32();
2635 break;
2636 default:
2637 return false;
2638 }
2639 return true;
2640}
2641#endif
2642#ifdef USE_DATETIME_DATE
2644 buffer.encode_string(1, this->object_id_ref_);
2645 buffer.encode_fixed32(2, this->key);
2646 buffer.encode_string(3, this->name_ref_);
2647#ifdef USE_ENTITY_ICON
2648 buffer.encode_string(5, this->icon_ref_);
2649#endif
2650 buffer.encode_bool(6, this->disabled_by_default);
2651 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2652#ifdef USE_DEVICES
2653 buffer.encode_uint32(8, this->device_id);
2654#endif
2655}
2657 size.add_length(1, this->object_id_ref_.size());
2658 size.add_fixed32(1, this->key);
2659 size.add_length(1, this->name_ref_.size());
2660#ifdef USE_ENTITY_ICON
2661 size.add_length(1, this->icon_ref_.size());
2662#endif
2663 size.add_bool(1, this->disabled_by_default);
2664 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2665#ifdef USE_DEVICES
2666 size.add_uint32(1, this->device_id);
2667#endif
2668}
2670 buffer.encode_fixed32(1, this->key);
2671 buffer.encode_bool(2, this->missing_state);
2672 buffer.encode_uint32(3, this->year);
2673 buffer.encode_uint32(4, this->month);
2674 buffer.encode_uint32(5, this->day);
2675#ifdef USE_DEVICES
2676 buffer.encode_uint32(6, this->device_id);
2677#endif
2678}
2680 size.add_fixed32(1, this->key);
2681 size.add_bool(1, this->missing_state);
2682 size.add_uint32(1, this->year);
2683 size.add_uint32(1, this->month);
2684 size.add_uint32(1, this->day);
2685#ifdef USE_DEVICES
2686 size.add_uint32(1, this->device_id);
2687#endif
2688}
2689bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2690 switch (field_id) {
2691 case 2:
2692 this->year = value.as_uint32();
2693 break;
2694 case 3:
2695 this->month = value.as_uint32();
2696 break;
2697 case 4:
2698 this->day = value.as_uint32();
2699 break;
2700#ifdef USE_DEVICES
2701 case 5:
2702 this->device_id = value.as_uint32();
2703 break;
2704#endif
2705 default:
2706 return false;
2707 }
2708 return true;
2709}
2710bool DateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2711 switch (field_id) {
2712 case 1:
2713 this->key = value.as_fixed32();
2714 break;
2715 default:
2716 return false;
2717 }
2718 return true;
2719}
2720#endif
2721#ifdef USE_DATETIME_TIME
2723 buffer.encode_string(1, this->object_id_ref_);
2724 buffer.encode_fixed32(2, this->key);
2725 buffer.encode_string(3, this->name_ref_);
2726#ifdef USE_ENTITY_ICON
2727 buffer.encode_string(5, this->icon_ref_);
2728#endif
2729 buffer.encode_bool(6, this->disabled_by_default);
2730 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2731#ifdef USE_DEVICES
2732 buffer.encode_uint32(8, this->device_id);
2733#endif
2734}
2736 size.add_length(1, this->object_id_ref_.size());
2737 size.add_fixed32(1, this->key);
2738 size.add_length(1, this->name_ref_.size());
2739#ifdef USE_ENTITY_ICON
2740 size.add_length(1, this->icon_ref_.size());
2741#endif
2742 size.add_bool(1, this->disabled_by_default);
2743 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2744#ifdef USE_DEVICES
2745 size.add_uint32(1, this->device_id);
2746#endif
2747}
2749 buffer.encode_fixed32(1, this->key);
2750 buffer.encode_bool(2, this->missing_state);
2751 buffer.encode_uint32(3, this->hour);
2752 buffer.encode_uint32(4, this->minute);
2753 buffer.encode_uint32(5, this->second);
2754#ifdef USE_DEVICES
2755 buffer.encode_uint32(6, this->device_id);
2756#endif
2757}
2759 size.add_fixed32(1, this->key);
2760 size.add_bool(1, this->missing_state);
2761 size.add_uint32(1, this->hour);
2762 size.add_uint32(1, this->minute);
2763 size.add_uint32(1, this->second);
2764#ifdef USE_DEVICES
2765 size.add_uint32(1, this->device_id);
2766#endif
2767}
2768bool TimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2769 switch (field_id) {
2770 case 2:
2771 this->hour = value.as_uint32();
2772 break;
2773 case 3:
2774 this->minute = value.as_uint32();
2775 break;
2776 case 4:
2777 this->second = value.as_uint32();
2778 break;
2779#ifdef USE_DEVICES
2780 case 5:
2781 this->device_id = value.as_uint32();
2782 break;
2783#endif
2784 default:
2785 return false;
2786 }
2787 return true;
2788}
2789bool TimeCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2790 switch (field_id) {
2791 case 1:
2792 this->key = value.as_fixed32();
2793 break;
2794 default:
2795 return false;
2796 }
2797 return true;
2798}
2799#endif
2800#ifdef USE_EVENT
2802 buffer.encode_string(1, this->object_id_ref_);
2803 buffer.encode_fixed32(2, this->key);
2804 buffer.encode_string(3, this->name_ref_);
2805#ifdef USE_ENTITY_ICON
2806 buffer.encode_string(5, this->icon_ref_);
2807#endif
2808 buffer.encode_bool(6, this->disabled_by_default);
2809 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2810 buffer.encode_string(8, this->device_class_ref_);
2811 for (auto &it : this->event_types) {
2812 buffer.encode_string(9, it, true);
2813 }
2814#ifdef USE_DEVICES
2815 buffer.encode_uint32(10, this->device_id);
2816#endif
2817}
2819 size.add_length(1, this->object_id_ref_.size());
2820 size.add_fixed32(1, this->key);
2821 size.add_length(1, this->name_ref_.size());
2822#ifdef USE_ENTITY_ICON
2823 size.add_length(1, this->icon_ref_.size());
2824#endif
2825 size.add_bool(1, this->disabled_by_default);
2826 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2827 size.add_length(1, this->device_class_ref_.size());
2828 if (!this->event_types.empty()) {
2829 for (const auto &it : this->event_types) {
2830 size.add_length_force(1, it.size());
2831 }
2832 }
2833#ifdef USE_DEVICES
2834 size.add_uint32(1, this->device_id);
2835#endif
2836}
2838 buffer.encode_fixed32(1, this->key);
2839 buffer.encode_string(2, this->event_type_ref_);
2840#ifdef USE_DEVICES
2841 buffer.encode_uint32(3, this->device_id);
2842#endif
2843}
2845 size.add_fixed32(1, this->key);
2846 size.add_length(1, this->event_type_ref_.size());
2847#ifdef USE_DEVICES
2848 size.add_uint32(1, this->device_id);
2849#endif
2850}
2851#endif
2852#ifdef USE_VALVE
2854 buffer.encode_string(1, this->object_id_ref_);
2855 buffer.encode_fixed32(2, this->key);
2856 buffer.encode_string(3, this->name_ref_);
2857#ifdef USE_ENTITY_ICON
2858 buffer.encode_string(5, this->icon_ref_);
2859#endif
2860 buffer.encode_bool(6, this->disabled_by_default);
2861 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2862 buffer.encode_string(8, this->device_class_ref_);
2863 buffer.encode_bool(9, this->assumed_state);
2864 buffer.encode_bool(10, this->supports_position);
2865 buffer.encode_bool(11, this->supports_stop);
2866#ifdef USE_DEVICES
2867 buffer.encode_uint32(12, this->device_id);
2868#endif
2869}
2871 size.add_length(1, this->object_id_ref_.size());
2872 size.add_fixed32(1, this->key);
2873 size.add_length(1, this->name_ref_.size());
2874#ifdef USE_ENTITY_ICON
2875 size.add_length(1, this->icon_ref_.size());
2876#endif
2877 size.add_bool(1, this->disabled_by_default);
2878 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2879 size.add_length(1, this->device_class_ref_.size());
2880 size.add_bool(1, this->assumed_state);
2881 size.add_bool(1, this->supports_position);
2882 size.add_bool(1, this->supports_stop);
2883#ifdef USE_DEVICES
2884 size.add_uint32(1, this->device_id);
2885#endif
2886}
2888 buffer.encode_fixed32(1, this->key);
2889 buffer.encode_float(2, this->position);
2890 buffer.encode_uint32(3, static_cast<uint32_t>(this->current_operation));
2891#ifdef USE_DEVICES
2892 buffer.encode_uint32(4, this->device_id);
2893#endif
2894}
2896 size.add_fixed32(1, this->key);
2897 size.add_float(1, this->position);
2898 size.add_uint32(1, static_cast<uint32_t>(this->current_operation));
2899#ifdef USE_DEVICES
2900 size.add_uint32(1, this->device_id);
2901#endif
2902}
2903bool ValveCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2904 switch (field_id) {
2905 case 2:
2906 this->has_position = value.as_bool();
2907 break;
2908 case 4:
2909 this->stop = value.as_bool();
2910 break;
2911#ifdef USE_DEVICES
2912 case 5:
2913 this->device_id = value.as_uint32();
2914 break;
2915#endif
2916 default:
2917 return false;
2918 }
2919 return true;
2920}
2921bool ValveCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2922 switch (field_id) {
2923 case 1:
2924 this->key = value.as_fixed32();
2925 break;
2926 case 3:
2927 this->position = value.as_float();
2928 break;
2929 default:
2930 return false;
2931 }
2932 return true;
2933}
2934#endif
2935#ifdef USE_DATETIME_DATETIME
2937 buffer.encode_string(1, this->object_id_ref_);
2938 buffer.encode_fixed32(2, this->key);
2939 buffer.encode_string(3, this->name_ref_);
2940#ifdef USE_ENTITY_ICON
2941 buffer.encode_string(5, this->icon_ref_);
2942#endif
2943 buffer.encode_bool(6, this->disabled_by_default);
2944 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2945#ifdef USE_DEVICES
2946 buffer.encode_uint32(8, this->device_id);
2947#endif
2948}
2950 size.add_length(1, this->object_id_ref_.size());
2951 size.add_fixed32(1, this->key);
2952 size.add_length(1, this->name_ref_.size());
2953#ifdef USE_ENTITY_ICON
2954 size.add_length(1, this->icon_ref_.size());
2955#endif
2956 size.add_bool(1, this->disabled_by_default);
2957 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2958#ifdef USE_DEVICES
2959 size.add_uint32(1, this->device_id);
2960#endif
2961}
2963 buffer.encode_fixed32(1, this->key);
2964 buffer.encode_bool(2, this->missing_state);
2965 buffer.encode_fixed32(3, this->epoch_seconds);
2966#ifdef USE_DEVICES
2967 buffer.encode_uint32(4, this->device_id);
2968#endif
2969}
2971 size.add_fixed32(1, this->key);
2972 size.add_bool(1, this->missing_state);
2973 size.add_fixed32(1, this->epoch_seconds);
2974#ifdef USE_DEVICES
2975 size.add_uint32(1, this->device_id);
2976#endif
2977}
2979 switch (field_id) {
2980#ifdef USE_DEVICES
2981 case 3:
2982 this->device_id = value.as_uint32();
2983 break;
2984#endif
2985 default:
2986 return false;
2987 }
2988 return true;
2989}
2990bool DateTimeCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2991 switch (field_id) {
2992 case 1:
2993 this->key = value.as_fixed32();
2994 break;
2995 case 2:
2996 this->epoch_seconds = value.as_fixed32();
2997 break;
2998 default:
2999 return false;
3000 }
3001 return true;
3002}
3003#endif
3004#ifdef USE_UPDATE
3006 buffer.encode_string(1, this->object_id_ref_);
3007 buffer.encode_fixed32(2, this->key);
3008 buffer.encode_string(3, this->name_ref_);
3009#ifdef USE_ENTITY_ICON
3010 buffer.encode_string(5, this->icon_ref_);
3011#endif
3012 buffer.encode_bool(6, this->disabled_by_default);
3013 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
3014 buffer.encode_string(8, this->device_class_ref_);
3015#ifdef USE_DEVICES
3016 buffer.encode_uint32(9, this->device_id);
3017#endif
3018}
3020 size.add_length(1, this->object_id_ref_.size());
3021 size.add_fixed32(1, this->key);
3022 size.add_length(1, this->name_ref_.size());
3023#ifdef USE_ENTITY_ICON
3024 size.add_length(1, this->icon_ref_.size());
3025#endif
3026 size.add_bool(1, this->disabled_by_default);
3027 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
3028 size.add_length(1, this->device_class_ref_.size());
3029#ifdef USE_DEVICES
3030 size.add_uint32(1, this->device_id);
3031#endif
3032}
3034 buffer.encode_fixed32(1, this->key);
3035 buffer.encode_bool(2, this->missing_state);
3036 buffer.encode_bool(3, this->in_progress);
3037 buffer.encode_bool(4, this->has_progress);
3038 buffer.encode_float(5, this->progress);
3039 buffer.encode_string(6, this->current_version_ref_);
3040 buffer.encode_string(7, this->latest_version_ref_);
3041 buffer.encode_string(8, this->title_ref_);
3042 buffer.encode_string(9, this->release_summary_ref_);
3043 buffer.encode_string(10, this->release_url_ref_);
3044#ifdef USE_DEVICES
3045 buffer.encode_uint32(11, this->device_id);
3046#endif
3047}
3049 size.add_fixed32(1, this->key);
3050 size.add_bool(1, this->missing_state);
3051 size.add_bool(1, this->in_progress);
3052 size.add_bool(1, this->has_progress);
3053 size.add_float(1, this->progress);
3054 size.add_length(1, this->current_version_ref_.size());
3055 size.add_length(1, this->latest_version_ref_.size());
3056 size.add_length(1, this->title_ref_.size());
3057 size.add_length(1, this->release_summary_ref_.size());
3058 size.add_length(1, this->release_url_ref_.size());
3059#ifdef USE_DEVICES
3060 size.add_uint32(1, this->device_id);
3061#endif
3062}
3063bool UpdateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
3064 switch (field_id) {
3065 case 2:
3066 this->command = static_cast<enums::UpdateCommand>(value.as_uint32());
3067 break;
3068#ifdef USE_DEVICES
3069 case 3:
3070 this->device_id = value.as_uint32();
3071 break;
3072#endif
3073 default:
3074 return false;
3075 }
3076 return true;
3077}
3078bool UpdateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
3079 switch (field_id) {
3080 case 1:
3081 this->key = value.as_fixed32();
3082 break;
3083 default:
3084 return false;
3085 }
3086 return true;
3087}
3088#endif
3089#ifdef USE_ZWAVE_PROXY
3091 switch (field_id) {
3092 case 1: {
3093 // Use raw data directly to avoid allocation
3094 this->data = value.data();
3095 this->data_len = value.size();
3096 break;
3097 }
3098 default:
3099 return false;
3100 }
3101 return true;
3102}
3103void ZWaveProxyFrame::encode(ProtoWriteBuffer buffer) const { buffer.encode_bytes(1, this->data, this->data_len); }
3105bool ZWaveProxyRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
3106 switch (field_id) {
3107 case 1:
3108 this->type = static_cast<enums::ZWaveProxyRequestType>(value.as_uint32());
3109 break;
3110 default:
3111 return false;
3112 }
3113 return true;
3114}
3116 switch (field_id) {
3117 case 2: {
3118 // Use raw data directly to avoid allocation
3119 this->data = value.data();
3120 this->data_len = value.size();
3121 break;
3122 }
3123 default:
3124 return false;
3125 }
3126 return true;
3127}
3129 buffer.encode_uint32(1, static_cast<uint32_t>(this->type));
3130 buffer.encode_bytes(2, this->data, this->data_len);
3131}
3133 size.add_uint32(1, static_cast<uint32_t>(this->type));
3134 size.add_length(2, this->data_len);
3135}
3136#endif
3137
3138} // namespace esphome::api
constexpr size_type size() const
Definition string_ref.h:70
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2547
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2522
enums::AlarmControlPanelStateCommand command
Definition api_pb2.h:2568
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2537
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2515
enums::AlarmControlPanelState state
Definition api_pb2.h:2552
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2508
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:66
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:70
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:49
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:62
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:63
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:234
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:242
std::array< uint64_t, BLUETOOTH_PROXY_MAX_CONNECTIONS > allocated
Definition api_pb2.h:2106
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2116
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2125
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2185
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2180
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1905
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1911
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2165
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2160
enums::BluetoothDeviceRequestType request_type
Definition api_pb2.h:1831
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1886
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2170
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2175
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1943
std::vector< BluetoothGATTDescriptor > descriptors
Definition api_pb2.h:1893
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1955
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:1890
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1935
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:1877
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1927
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2134
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2139
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1995
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1998
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1917
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1991
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1985
std::vector< BluetoothGATTService > services
Definition api_pb2.h:1925
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2106
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2111
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2090
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2156
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2152
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2051
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1999
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2012
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2017
std::vector< BluetoothGATTCharacteristic > characteristics
Definition api_pb2.h:1907
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1976
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1965
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:1905
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2077
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2064
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2038
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2022
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2148
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2144
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1870
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1864
std::array< BluetoothLERawAdvertisement, BLUETOOTH_PROXY_ADVERTISEMENT_BATCH_SIZE > advertisements
Definition api_pb2.h:1813
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1876
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1881
enums::BluetoothScannerMode mode
Definition api_pb2.h:2259
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2200
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2190
enums::BluetoothScannerMode mode
Definition api_pb2.h:2242
enums::BluetoothScannerState state
Definition api_pb2.h:2241
enums::BluetoothScannerMode configured_mode
Definition api_pb2.h:2243
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2195
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1709
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1721
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1081
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1073
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1065
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1297
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1416
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1414
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1230
enums::ClimatePreset preset
Definition api_pb2.h:1420
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1284
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1381
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1382
enums::ClimateAction action
Definition api_pb2.h:1380
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1192
enums::ClimatePreset preset
Definition api_pb2.h:1385
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1211
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:327
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:306
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:288
enums::CoverOperation current_operation
Definition api_pb2.h:686
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:297
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2710
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2689
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2669
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2679
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2990
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2978
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2970
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2962
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:81
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:76
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:87
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:145
std::array< AreaInfo, ESPHOME_AREA_COUNT > areas
Definition api_pb2.h:560
std::array< DeviceInfo, ESPHOME_DEVICE_COUNT > devices
Definition api_pb2.h:557
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2844
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2837
std::vector< int32_t > int_array
Definition api_pb2.h:1250
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:990
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:968
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1003
std::vector< std::string > string_array
Definition api_pb2.h:1252
std::vector< float > float_array
Definition api_pb2.h:1251
std::vector< ExecuteServiceArgument > args
Definition api_pb2.h:1270
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1027
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1016
enums::FanDirection direction
Definition api_pb2.h:770
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:409
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:448
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:458
enums::FanDirection direction
Definition api_pb2.h:746
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:387
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:398
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:937
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:924
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:10
const uint8_t * client_info
Definition api_pb2.h:338
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:23
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:42
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:36
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:907
std::vector< HomeassistantServiceMap > data_template
Definition api_pb2.h:1114
std::vector< HomeassistantServiceMap > data
Definition api_pb2.h:1113
std::vector< HomeassistantServiceMap > variables
Definition api_pb2.h:1115
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:888
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:875
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:867
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:871
enums::EntityCategory entity_category
Definition api_pb2.h:302
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:612
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:622
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:552
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:516
enums::ColorMode color_mode
Definition api_pb2.h:814
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:534
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2492
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2476
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:204
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:219
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1695
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1681
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1052
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1039
const std::set< std::string > * supported_custom_presets
Definition api_pb2.h:1354
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1138
const std::set< climate::ClimateSwingMode > * supported_swing_modes
Definition api_pb2.h:1351
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1096
const std::set< std::string > * supported_custom_fan_modes
Definition api_pb2.h:1352
const std::set< climate::ClimateFanMode > * supported_fan_modes
Definition api_pb2.h:1350
const std::set< climate::ClimatePreset > * supported_presets
Definition api_pb2.h:1353
const std::set< climate::ClimateMode > * supported_modes
Definition api_pb2.h:1345
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:270
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:252
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2643
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2656
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2949
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2936
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2818
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2801
std::vector< std::string > event_types
Definition api_pb2.h:2755
const std::set< std::string > * supported_preset_modes
Definition api_pb2.h:728
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:345
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:365
const std::set< light::ColorMode > * supported_color_modes
Definition api_pb2.h:793
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:491
std::vector< std::string > effects
Definition api_pb2.h:796
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:470
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1593
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1610
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1747
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1765
std::vector< MediaPlayerSupportedFormat > supported_formats
Definition api_pb2.h:1722
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1340
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1321
const std::vector< std::string > * options
Definition api_pb2.h:1501
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1418
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1402
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:661
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:679
enums::SensorStateClass state_class
Definition api_pb2.h:890
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:952
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:948
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:963
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:956
std::vector< ListEntitiesServicesArgument > args
Definition api_pb2.h:1233
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1486
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1504
std::vector< std::string > tones
Definition api_pb2.h:1554
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:715
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:730
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2576
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2559
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:800
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:786
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2722
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2735
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3019
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3005
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2870
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2853
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1641
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1669
enums::LockCommand command
Definition api_pb2.h:1650
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1659
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1634
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1627
enums::MediaPlayerCommand command
Definition api_pb2.h:1758
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1839
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1799
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1829
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1790
enums::MediaPlayerState state
Definition api_pb2.h:1739
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1781
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1740
enums::MediaPlayerFormatPurpose purpose
Definition api_pb2.h:1704
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1733
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:853
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:863
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:864
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1387
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1375
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1359
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1367
uint32_t as_fixed32() const
Definition proto.h:208
float as_float() const
Definition proto.h:210
void decode_to_message(ProtoDecodableMessage &msg) const
Decode the length-delimited data into an existing ProtoDecodableMessage instance.
Definition proto.h:790
const uint8_t * data() const
Definition proto.h:186
std::string as_string() const
Definition proto.h:183
void add_message_object(uint32_t field_id_size, const ProtoMessage &message)
Calculates and adds the size of a nested message field to the total message size.
Definition proto.h:715
void add_message_object_force(uint32_t field_id_size, const ProtoMessage &message)
Calculates and adds the size of a nested message field to the total message size (force version)
Definition proto.h:730
void add_float(uint32_t field_id_size, float value)
Calculates and adds the size of a float field to the total message size.
Definition proto.h:560
void add_uint32_force(uint32_t field_id_size, uint32_t value)
Calculates and adds the size of a uint32 field to the total message size (force version)
Definition proto.h:533
void add_sint32(uint32_t field_id_size, int32_t value)
Calculates and adds the size of a sint32 field to the total message size.
Definition proto.h:598
void add_bool(uint32_t field_id_size, bool value)
Calculates and adds the size of a boolean field to the total message size.
Definition proto.h:541
void add_uint32(uint32_t field_id_size, uint32_t value)
Calculates and adds the size of a uint32 field to the total message size.
Definition proto.h:524
void add_repeated_message(uint32_t field_id_size, const std::vector< MessageType > &messages)
Calculates and adds the sizes of all messages in a repeated field to the total message size.
Definition proto.h:750
void add_uint64(uint32_t field_id_size, uint64_t value)
Calculates and adds the size of a uint64 field to the total message size.
Definition proto.h:635
void add_length_force(uint32_t field_id_size, size_t len)
Calculates and adds the size of a length-delimited field (string/bytes) to the total message size (re...
Definition proto.h:665
void add_int32(uint32_t field_id_size, int32_t value)
Common parameters for all add_*_field methods.
Definition proto.h:506
void add_uint64_force(uint32_t field_id_size, uint64_t value)
Calculates and adds the size of a uint64 field to the total message size (force version)
Definition proto.h:644
void add_fixed32(uint32_t field_id_size, uint32_t value)
Calculates and adds the size of a fixed32 field to the total message size.
Definition proto.h:572
void add_length(uint32_t field_id_size, size_t len)
Calculates and adds the size of a length-delimited field (string/bytes) to the total message size.
Definition proto.h:655
Representation of a VarInt - in ProtoBuf should be 64bit but we only use 32bit.
Definition proto.h:66
constexpr uint64_t as_uint64() const
Definition proto.h:109
constexpr int32_t as_int32() const
Definition proto.h:111
constexpr uint32_t as_uint32() const
Definition proto.h:108
constexpr bool as_bool() const
Definition proto.h:110
constexpr int32_t as_sint32() const
Definition proto.h:119
void encode_float(uint32_t field_id, float value, bool force=false)
Definition proto.h:302
void encode_int32(uint32_t field_id, int32_t value, bool force=false)
Definition proto.h:313
void encode_string(uint32_t field_id, const char *string, size_t len, bool force=false)
Definition proto.h:247
void encode_bool(uint32_t field_id, bool value, bool force=false)
Definition proto.h:282
void encode_uint64(uint32_t field_id, uint64_t value, bool force=false)
Definition proto.h:276
void encode_uint32(uint32_t field_id, uint32_t value, bool force=false)
Definition proto.h:270
void encode_sint32(uint32_t field_id, int32_t value, bool force=false)
Definition proto.h:324
void encode_message(uint32_t field_id, const ProtoMessage &value, bool force=false)
Definition proto.h:764
void encode_bytes(uint32_t field_id, const uint8_t *data, size_t len, bool force=false)
Definition proto.h:267
void encode_fixed32(uint32_t field_id, uint32_t value, bool force=false)
Definition proto.h:288
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1464
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1452
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1474
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1436
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1444
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:705
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:697
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1568
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1538
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1578
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1531
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1524
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1854
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:902
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:897
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:831
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:848
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:844
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2212
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:774
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:759
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:745
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:752
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2621
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2631
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2609
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:822
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:814
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2601
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2593
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2789
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2768
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2758
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2748
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3078
enums::UpdateCommand command
Definition api_pb2.h:2943
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3063
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3048
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3033
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2903
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2921
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2887
enums::ValveOperation current_operation
Definition api_pb2.h:2811
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2895
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2383
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2382
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2366
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2356
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2316
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2320
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2306
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2296
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2225
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2230
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2435
std::vector< VoiceAssistantExternalWakeWord > external_wake_words
Definition api_pb2.h:2484
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2455
std::vector< VoiceAssistantWakeWord > available_wake_words
Definition api_pb2.h:2499
const std::vector< std::string > * active_wake_words
Definition api_pb2.h:2500
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2446
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2262
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2285
enums::VoiceAssistantEvent event_type
Definition api_pb2.h:2354
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2275
std::vector< VoiceAssistantEventData > data
Definition api_pb2.h:2355
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2410
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2400
std::vector< std::string > trained_languages
Definition api_pb2.h:2464
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2242
VoiceAssistantAudioSettings audio_settings
Definition api_pb2.h:2309
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2235
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2249
std::vector< std::string > active_wake_words
Definition api_pb2.h:2517
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2464
enums::VoiceAssistantTimerEvent event_type
Definition api_pb2.h:2396
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2343
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2324
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2384
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2391
std::vector< std::string > trained_languages
Definition api_pb2.h:2451
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3090
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3103
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3104
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3132
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3115
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3105
enums::ZWaveProxyRequestType type
Definition api_pb2.h:2979
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3128