ESPHome 2025.10.2
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#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES
888 buffer.encode_uint32(6, this->call_id);
889#endif
890#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
891 buffer.encode_bool(7, this->wants_response);
892#endif
893#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
894 buffer.encode_string(8, this->response_template);
895#endif
896}
898 size.add_length(1, this->service_ref_.size());
899 size.add_repeated_message(1, this->data);
900 size.add_repeated_message(1, this->data_template);
901 size.add_repeated_message(1, this->variables);
902 size.add_bool(1, this->is_event);
903#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES
904 size.add_uint32(1, this->call_id);
905#endif
906#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
907 size.add_bool(1, this->wants_response);
908#endif
909#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
910 size.add_length(1, this->response_template.size());
911#endif
912}
913#endif
914#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES
916 switch (field_id) {
917 case 1:
918 this->call_id = value.as_uint32();
919 break;
920 case 2:
921 this->success = value.as_bool();
922 break;
923 default:
924 return false;
925 }
926 return true;
927}
929 switch (field_id) {
930 case 3:
931 this->error_message = value.as_string();
932 break;
933#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
934 case 4: {
935 // Use raw data directly to avoid allocation
936 this->response_data = value.data();
937 this->response_data_len = value.size();
938 break;
939 }
940#endif
941 default:
942 return false;
943 }
944 return true;
945}
946#endif
947#ifdef USE_API_HOMEASSISTANT_STATES
949 buffer.encode_string(1, this->entity_id_ref_);
950 buffer.encode_string(2, this->attribute_ref_);
951 buffer.encode_bool(3, this->once);
952}
954 size.add_length(1, this->entity_id_ref_.size());
955 size.add_length(1, this->attribute_ref_.size());
956 size.add_bool(1, this->once);
957}
959 switch (field_id) {
960 case 1:
961 this->entity_id = value.as_string();
962 break;
963 case 2:
964 this->state = value.as_string();
965 break;
966 case 3:
967 this->attribute = value.as_string();
968 break;
969 default:
970 return false;
971 }
972 return true;
973}
974#endif
976 switch (field_id) {
977 case 2: {
978 // Use raw data directly to avoid allocation
979 this->timezone = value.data();
980 this->timezone_len = value.size();
981 break;
982 }
983 default:
984 return false;
985 }
986 return true;
987}
988bool GetTimeResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
989 switch (field_id) {
990 case 1:
991 this->epoch_seconds = value.as_fixed32();
992 break;
993 default:
994 return false;
995 }
996 return true;
997}
998#ifdef USE_API_SERVICES
1000 buffer.encode_string(1, this->name_ref_);
1001 buffer.encode_uint32(2, static_cast<uint32_t>(this->type));
1002}
1004 size.add_length(1, this->name_ref_.size());
1005 size.add_uint32(1, static_cast<uint32_t>(this->type));
1006}
1008 buffer.encode_string(1, this->name_ref_);
1009 buffer.encode_fixed32(2, this->key);
1010 for (auto &it : this->args) {
1011 buffer.encode_message(3, it, true);
1012 }
1013}
1015 size.add_length(1, this->name_ref_.size());
1016 size.add_fixed32(1, this->key);
1017 size.add_repeated_message(1, this->args);
1018}
1020 switch (field_id) {
1021 case 1:
1022 this->bool_ = value.as_bool();
1023 break;
1024 case 2:
1025 this->legacy_int = value.as_int32();
1026 break;
1027 case 5:
1028 this->int_ = value.as_sint32();
1029 break;
1030 case 6:
1031 this->bool_array.push_back(value.as_bool());
1032 break;
1033 case 7:
1034 this->int_array.push_back(value.as_sint32());
1035 break;
1036 default:
1037 return false;
1038 }
1039 return true;
1040}
1042 switch (field_id) {
1043 case 4:
1044 this->string_ = value.as_string();
1045 break;
1046 case 9:
1047 this->string_array.push_back(value.as_string());
1048 break;
1049 default:
1050 return false;
1051 }
1052 return true;
1053}
1054bool ExecuteServiceArgument::decode_32bit(uint32_t field_id, Proto32Bit value) {
1055 switch (field_id) {
1056 case 3:
1057 this->float_ = value.as_float();
1058 break;
1059 case 8:
1060 this->float_array.push_back(value.as_float());
1061 break;
1062 default:
1063 return false;
1064 }
1065 return true;
1066}
1068 switch (field_id) {
1069 case 2:
1070 this->args.emplace_back();
1071 value.decode_to_message(this->args.back());
1072 break;
1073 default:
1074 return false;
1075 }
1076 return true;
1077}
1078bool ExecuteServiceRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1079 switch (field_id) {
1080 case 1:
1081 this->key = value.as_fixed32();
1082 break;
1083 default:
1084 return false;
1085 }
1086 return true;
1087}
1088#endif
1089#ifdef USE_CAMERA
1091 buffer.encode_string(1, this->object_id_ref_);
1092 buffer.encode_fixed32(2, this->key);
1093 buffer.encode_string(3, this->name_ref_);
1094 buffer.encode_bool(5, this->disabled_by_default);
1095#ifdef USE_ENTITY_ICON
1096 buffer.encode_string(6, this->icon_ref_);
1097#endif
1098 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
1099#ifdef USE_DEVICES
1100 buffer.encode_uint32(8, this->device_id);
1101#endif
1102}
1104 size.add_length(1, this->object_id_ref_.size());
1105 size.add_fixed32(1, this->key);
1106 size.add_length(1, this->name_ref_.size());
1107 size.add_bool(1, this->disabled_by_default);
1108#ifdef USE_ENTITY_ICON
1109 size.add_length(1, this->icon_ref_.size());
1110#endif
1111 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1112#ifdef USE_DEVICES
1113 size.add_uint32(1, this->device_id);
1114#endif
1115}
1117 buffer.encode_fixed32(1, this->key);
1118 buffer.encode_bytes(2, this->data_ptr_, this->data_len_);
1119 buffer.encode_bool(3, this->done);
1120#ifdef USE_DEVICES
1121 buffer.encode_uint32(4, this->device_id);
1122#endif
1123}
1125 size.add_fixed32(1, this->key);
1126 size.add_length(1, this->data_len_);
1127 size.add_bool(1, this->done);
1128#ifdef USE_DEVICES
1129 size.add_uint32(1, this->device_id);
1130#endif
1131}
1132bool CameraImageRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1133 switch (field_id) {
1134 case 1:
1135 this->single = value.as_bool();
1136 break;
1137 case 2:
1138 this->stream = value.as_bool();
1139 break;
1140 default:
1141 return false;
1142 }
1143 return true;
1144}
1145#endif
1146#ifdef USE_CLIMATE
1148 buffer.encode_string(1, this->object_id_ref_);
1149 buffer.encode_fixed32(2, this->key);
1150 buffer.encode_string(3, this->name_ref_);
1153 for (const auto &it : *this->supported_modes) {
1154 buffer.encode_uint32(7, static_cast<uint32_t>(it), true);
1155 }
1156 buffer.encode_float(8, this->visual_min_temperature);
1157 buffer.encode_float(9, this->visual_max_temperature);
1159 buffer.encode_bool(12, this->supports_action);
1160 for (const auto &it : *this->supported_fan_modes) {
1161 buffer.encode_uint32(13, static_cast<uint32_t>(it), true);
1162 }
1163 for (const auto &it : *this->supported_swing_modes) {
1164 buffer.encode_uint32(14, static_cast<uint32_t>(it), true);
1165 }
1166 for (const auto &it : *this->supported_custom_fan_modes) {
1167 buffer.encode_string(15, it, true);
1168 }
1169 for (const auto &it : *this->supported_presets) {
1170 buffer.encode_uint32(16, static_cast<uint32_t>(it), true);
1171 }
1172 for (const auto &it : *this->supported_custom_presets) {
1173 buffer.encode_string(17, it, true);
1174 }
1175 buffer.encode_bool(18, this->disabled_by_default);
1176#ifdef USE_ENTITY_ICON
1177 buffer.encode_string(19, this->icon_ref_);
1178#endif
1179 buffer.encode_uint32(20, static_cast<uint32_t>(this->entity_category));
1181 buffer.encode_bool(22, this->supports_current_humidity);
1182 buffer.encode_bool(23, this->supports_target_humidity);
1183 buffer.encode_float(24, this->visual_min_humidity);
1184 buffer.encode_float(25, this->visual_max_humidity);
1185#ifdef USE_DEVICES
1186 buffer.encode_uint32(26, this->device_id);
1187#endif
1188}
1190 size.add_length(1, this->object_id_ref_.size());
1191 size.add_fixed32(1, this->key);
1192 size.add_length(1, this->name_ref_.size());
1195 if (!this->supported_modes->empty()) {
1196 for (const auto &it : *this->supported_modes) {
1197 size.add_uint32_force(1, static_cast<uint32_t>(it));
1198 }
1199 }
1200 size.add_float(1, this->visual_min_temperature);
1201 size.add_float(1, this->visual_max_temperature);
1203 size.add_bool(1, this->supports_action);
1204 if (!this->supported_fan_modes->empty()) {
1205 for (const auto &it : *this->supported_fan_modes) {
1206 size.add_uint32_force(1, static_cast<uint32_t>(it));
1207 }
1208 }
1209 if (!this->supported_swing_modes->empty()) {
1210 for (const auto &it : *this->supported_swing_modes) {
1211 size.add_uint32_force(1, static_cast<uint32_t>(it));
1212 }
1213 }
1214 if (!this->supported_custom_fan_modes->empty()) {
1215 for (const auto &it : *this->supported_custom_fan_modes) {
1216 size.add_length_force(1, it.size());
1217 }
1218 }
1219 if (!this->supported_presets->empty()) {
1220 for (const auto &it : *this->supported_presets) {
1221 size.add_uint32_force(2, static_cast<uint32_t>(it));
1222 }
1223 }
1224 if (!this->supported_custom_presets->empty()) {
1225 for (const auto &it : *this->supported_custom_presets) {
1226 size.add_length_force(2, it.size());
1227 }
1228 }
1229 size.add_bool(2, this->disabled_by_default);
1230#ifdef USE_ENTITY_ICON
1231 size.add_length(2, this->icon_ref_.size());
1232#endif
1233 size.add_uint32(2, static_cast<uint32_t>(this->entity_category));
1235 size.add_bool(2, this->supports_current_humidity);
1236 size.add_bool(2, this->supports_target_humidity);
1237 size.add_float(2, this->visual_min_humidity);
1238 size.add_float(2, this->visual_max_humidity);
1239#ifdef USE_DEVICES
1240 size.add_uint32(2, this->device_id);
1241#endif
1242}
1244 buffer.encode_fixed32(1, this->key);
1245 buffer.encode_uint32(2, static_cast<uint32_t>(this->mode));
1246 buffer.encode_float(3, this->current_temperature);
1247 buffer.encode_float(4, this->target_temperature);
1248 buffer.encode_float(5, this->target_temperature_low);
1249 buffer.encode_float(6, this->target_temperature_high);
1250 buffer.encode_uint32(8, static_cast<uint32_t>(this->action));
1251 buffer.encode_uint32(9, static_cast<uint32_t>(this->fan_mode));
1252 buffer.encode_uint32(10, static_cast<uint32_t>(this->swing_mode));
1253 buffer.encode_string(11, this->custom_fan_mode_ref_);
1254 buffer.encode_uint32(12, static_cast<uint32_t>(this->preset));
1255 buffer.encode_string(13, this->custom_preset_ref_);
1256 buffer.encode_float(14, this->current_humidity);
1257 buffer.encode_float(15, this->target_humidity);
1258#ifdef USE_DEVICES
1259 buffer.encode_uint32(16, this->device_id);
1260#endif
1261}
1263 size.add_fixed32(1, this->key);
1264 size.add_uint32(1, static_cast<uint32_t>(this->mode));
1265 size.add_float(1, this->current_temperature);
1266 size.add_float(1, this->target_temperature);
1267 size.add_float(1, this->target_temperature_low);
1268 size.add_float(1, this->target_temperature_high);
1269 size.add_uint32(1, static_cast<uint32_t>(this->action));
1270 size.add_uint32(1, static_cast<uint32_t>(this->fan_mode));
1271 size.add_uint32(1, static_cast<uint32_t>(this->swing_mode));
1272 size.add_length(1, this->custom_fan_mode_ref_.size());
1273 size.add_uint32(1, static_cast<uint32_t>(this->preset));
1274 size.add_length(1, this->custom_preset_ref_.size());
1275 size.add_float(1, this->current_humidity);
1276 size.add_float(1, this->target_humidity);
1277#ifdef USE_DEVICES
1278 size.add_uint32(2, this->device_id);
1279#endif
1280}
1282 switch (field_id) {
1283 case 2:
1284 this->has_mode = value.as_bool();
1285 break;
1286 case 3:
1287 this->mode = static_cast<enums::ClimateMode>(value.as_uint32());
1288 break;
1289 case 4:
1290 this->has_target_temperature = value.as_bool();
1291 break;
1292 case 6:
1293 this->has_target_temperature_low = value.as_bool();
1294 break;
1295 case 8:
1296 this->has_target_temperature_high = value.as_bool();
1297 break;
1298 case 12:
1299 this->has_fan_mode = value.as_bool();
1300 break;
1301 case 13:
1302 this->fan_mode = static_cast<enums::ClimateFanMode>(value.as_uint32());
1303 break;
1304 case 14:
1305 this->has_swing_mode = value.as_bool();
1306 break;
1307 case 15:
1308 this->swing_mode = static_cast<enums::ClimateSwingMode>(value.as_uint32());
1309 break;
1310 case 16:
1311 this->has_custom_fan_mode = value.as_bool();
1312 break;
1313 case 18:
1314 this->has_preset = value.as_bool();
1315 break;
1316 case 19:
1317 this->preset = static_cast<enums::ClimatePreset>(value.as_uint32());
1318 break;
1319 case 20:
1320 this->has_custom_preset = value.as_bool();
1321 break;
1322 case 22:
1323 this->has_target_humidity = value.as_bool();
1324 break;
1325#ifdef USE_DEVICES
1326 case 24:
1327 this->device_id = value.as_uint32();
1328 break;
1329#endif
1330 default:
1331 return false;
1332 }
1333 return true;
1334}
1336 switch (field_id) {
1337 case 17:
1338 this->custom_fan_mode = value.as_string();
1339 break;
1340 case 21:
1341 this->custom_preset = value.as_string();
1342 break;
1343 default:
1344 return false;
1345 }
1346 return true;
1347}
1348bool ClimateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1349 switch (field_id) {
1350 case 1:
1351 this->key = value.as_fixed32();
1352 break;
1353 case 5:
1354 this->target_temperature = value.as_float();
1355 break;
1356 case 7:
1357 this->target_temperature_low = value.as_float();
1358 break;
1359 case 9:
1360 this->target_temperature_high = value.as_float();
1361 break;
1362 case 23:
1363 this->target_humidity = value.as_float();
1364 break;
1365 default:
1366 return false;
1367 }
1368 return true;
1369}
1370#endif
1371#ifdef USE_NUMBER
1373 buffer.encode_string(1, this->object_id_ref_);
1374 buffer.encode_fixed32(2, this->key);
1375 buffer.encode_string(3, this->name_ref_);
1376#ifdef USE_ENTITY_ICON
1377 buffer.encode_string(5, this->icon_ref_);
1378#endif
1379 buffer.encode_float(6, this->min_value);
1380 buffer.encode_float(7, this->max_value);
1381 buffer.encode_float(8, this->step);
1382 buffer.encode_bool(9, this->disabled_by_default);
1383 buffer.encode_uint32(10, static_cast<uint32_t>(this->entity_category));
1384 buffer.encode_string(11, this->unit_of_measurement_ref_);
1385 buffer.encode_uint32(12, static_cast<uint32_t>(this->mode));
1386 buffer.encode_string(13, this->device_class_ref_);
1387#ifdef USE_DEVICES
1388 buffer.encode_uint32(14, this->device_id);
1389#endif
1390}
1392 size.add_length(1, this->object_id_ref_.size());
1393 size.add_fixed32(1, this->key);
1394 size.add_length(1, this->name_ref_.size());
1395#ifdef USE_ENTITY_ICON
1396 size.add_length(1, this->icon_ref_.size());
1397#endif
1398 size.add_float(1, this->min_value);
1399 size.add_float(1, this->max_value);
1400 size.add_float(1, this->step);
1401 size.add_bool(1, this->disabled_by_default);
1402 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1403 size.add_length(1, this->unit_of_measurement_ref_.size());
1404 size.add_uint32(1, static_cast<uint32_t>(this->mode));
1405 size.add_length(1, this->device_class_ref_.size());
1406#ifdef USE_DEVICES
1407 size.add_uint32(1, this->device_id);
1408#endif
1409}
1411 buffer.encode_fixed32(1, this->key);
1412 buffer.encode_float(2, this->state);
1413 buffer.encode_bool(3, this->missing_state);
1414#ifdef USE_DEVICES
1415 buffer.encode_uint32(4, this->device_id);
1416#endif
1417}
1419 size.add_fixed32(1, this->key);
1420 size.add_float(1, this->state);
1421 size.add_bool(1, this->missing_state);
1422#ifdef USE_DEVICES
1423 size.add_uint32(1, this->device_id);
1424#endif
1425}
1426bool NumberCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1427 switch (field_id) {
1428#ifdef USE_DEVICES
1429 case 3:
1430 this->device_id = value.as_uint32();
1431 break;
1432#endif
1433 default:
1434 return false;
1435 }
1436 return true;
1437}
1438bool NumberCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1439 switch (field_id) {
1440 case 1:
1441 this->key = value.as_fixed32();
1442 break;
1443 case 2:
1444 this->state = value.as_float();
1445 break;
1446 default:
1447 return false;
1448 }
1449 return true;
1450}
1451#endif
1452#ifdef USE_SELECT
1454 buffer.encode_string(1, this->object_id_ref_);
1455 buffer.encode_fixed32(2, this->key);
1456 buffer.encode_string(3, this->name_ref_);
1457#ifdef USE_ENTITY_ICON
1458 buffer.encode_string(5, this->icon_ref_);
1459#endif
1460 for (const auto &it : *this->options) {
1461 buffer.encode_string(6, it, true);
1462 }
1463 buffer.encode_bool(7, this->disabled_by_default);
1464 buffer.encode_uint32(8, static_cast<uint32_t>(this->entity_category));
1465#ifdef USE_DEVICES
1466 buffer.encode_uint32(9, this->device_id);
1467#endif
1468}
1470 size.add_length(1, this->object_id_ref_.size());
1471 size.add_fixed32(1, this->key);
1472 size.add_length(1, this->name_ref_.size());
1473#ifdef USE_ENTITY_ICON
1474 size.add_length(1, this->icon_ref_.size());
1475#endif
1476 if (!this->options->empty()) {
1477 for (const auto &it : *this->options) {
1478 size.add_length_force(1, it.size());
1479 }
1480 }
1481 size.add_bool(1, this->disabled_by_default);
1482 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1483#ifdef USE_DEVICES
1484 size.add_uint32(1, this->device_id);
1485#endif
1486}
1488 buffer.encode_fixed32(1, this->key);
1489 buffer.encode_string(2, this->state_ref_);
1490 buffer.encode_bool(3, this->missing_state);
1491#ifdef USE_DEVICES
1492 buffer.encode_uint32(4, this->device_id);
1493#endif
1494}
1496 size.add_fixed32(1, this->key);
1497 size.add_length(1, this->state_ref_.size());
1498 size.add_bool(1, this->missing_state);
1499#ifdef USE_DEVICES
1500 size.add_uint32(1, this->device_id);
1501#endif
1502}
1503bool SelectCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1504 switch (field_id) {
1505#ifdef USE_DEVICES
1506 case 3:
1507 this->device_id = value.as_uint32();
1508 break;
1509#endif
1510 default:
1511 return false;
1512 }
1513 return true;
1514}
1516 switch (field_id) {
1517 case 2:
1518 this->state = value.as_string();
1519 break;
1520 default:
1521 return false;
1522 }
1523 return true;
1524}
1525bool SelectCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1526 switch (field_id) {
1527 case 1:
1528 this->key = value.as_fixed32();
1529 break;
1530 default:
1531 return false;
1532 }
1533 return true;
1534}
1535#endif
1536#ifdef USE_SIREN
1538 buffer.encode_string(1, this->object_id_ref_);
1539 buffer.encode_fixed32(2, this->key);
1540 buffer.encode_string(3, this->name_ref_);
1541#ifdef USE_ENTITY_ICON
1542 buffer.encode_string(5, this->icon_ref_);
1543#endif
1544 buffer.encode_bool(6, this->disabled_by_default);
1545 for (auto &it : this->tones) {
1546 buffer.encode_string(7, it, true);
1547 }
1548 buffer.encode_bool(8, this->supports_duration);
1549 buffer.encode_bool(9, this->supports_volume);
1550 buffer.encode_uint32(10, static_cast<uint32_t>(this->entity_category));
1551#ifdef USE_DEVICES
1552 buffer.encode_uint32(11, this->device_id);
1553#endif
1554}
1556 size.add_length(1, this->object_id_ref_.size());
1557 size.add_fixed32(1, this->key);
1558 size.add_length(1, this->name_ref_.size());
1559#ifdef USE_ENTITY_ICON
1560 size.add_length(1, this->icon_ref_.size());
1561#endif
1562 size.add_bool(1, this->disabled_by_default);
1563 if (!this->tones.empty()) {
1564 for (const auto &it : this->tones) {
1565 size.add_length_force(1, it.size());
1566 }
1567 }
1568 size.add_bool(1, this->supports_duration);
1569 size.add_bool(1, this->supports_volume);
1570 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1571#ifdef USE_DEVICES
1572 size.add_uint32(1, this->device_id);
1573#endif
1574}
1576 buffer.encode_fixed32(1, this->key);
1577 buffer.encode_bool(2, this->state);
1578#ifdef USE_DEVICES
1579 buffer.encode_uint32(3, this->device_id);
1580#endif
1581}
1583 size.add_fixed32(1, this->key);
1584 size.add_bool(1, this->state);
1585#ifdef USE_DEVICES
1586 size.add_uint32(1, this->device_id);
1587#endif
1588}
1589bool SirenCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1590 switch (field_id) {
1591 case 2:
1592 this->has_state = value.as_bool();
1593 break;
1594 case 3:
1595 this->state = value.as_bool();
1596 break;
1597 case 4:
1598 this->has_tone = value.as_bool();
1599 break;
1600 case 6:
1601 this->has_duration = value.as_bool();
1602 break;
1603 case 7:
1604 this->duration = value.as_uint32();
1605 break;
1606 case 8:
1607 this->has_volume = value.as_bool();
1608 break;
1609#ifdef USE_DEVICES
1610 case 10:
1611 this->device_id = value.as_uint32();
1612 break;
1613#endif
1614 default:
1615 return false;
1616 }
1617 return true;
1618}
1620 switch (field_id) {
1621 case 5:
1622 this->tone = value.as_string();
1623 break;
1624 default:
1625 return false;
1626 }
1627 return true;
1628}
1629bool SirenCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1630 switch (field_id) {
1631 case 1:
1632 this->key = value.as_fixed32();
1633 break;
1634 case 9:
1635 this->volume = value.as_float();
1636 break;
1637 default:
1638 return false;
1639 }
1640 return true;
1641}
1642#endif
1643#ifdef USE_LOCK
1645 buffer.encode_string(1, this->object_id_ref_);
1646 buffer.encode_fixed32(2, this->key);
1647 buffer.encode_string(3, this->name_ref_);
1648#ifdef USE_ENTITY_ICON
1649 buffer.encode_string(5, this->icon_ref_);
1650#endif
1651 buffer.encode_bool(6, this->disabled_by_default);
1652 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
1653 buffer.encode_bool(8, this->assumed_state);
1654 buffer.encode_bool(9, this->supports_open);
1655 buffer.encode_bool(10, this->requires_code);
1656 buffer.encode_string(11, this->code_format_ref_);
1657#ifdef USE_DEVICES
1658 buffer.encode_uint32(12, this->device_id);
1659#endif
1660}
1662 size.add_length(1, this->object_id_ref_.size());
1663 size.add_fixed32(1, this->key);
1664 size.add_length(1, this->name_ref_.size());
1665#ifdef USE_ENTITY_ICON
1666 size.add_length(1, this->icon_ref_.size());
1667#endif
1668 size.add_bool(1, this->disabled_by_default);
1669 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1670 size.add_bool(1, this->assumed_state);
1671 size.add_bool(1, this->supports_open);
1672 size.add_bool(1, this->requires_code);
1673 size.add_length(1, this->code_format_ref_.size());
1674#ifdef USE_DEVICES
1675 size.add_uint32(1, this->device_id);
1676#endif
1677}
1679 buffer.encode_fixed32(1, this->key);
1680 buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
1681#ifdef USE_DEVICES
1682 buffer.encode_uint32(3, this->device_id);
1683#endif
1684}
1686 size.add_fixed32(1, this->key);
1687 size.add_uint32(1, static_cast<uint32_t>(this->state));
1688#ifdef USE_DEVICES
1689 size.add_uint32(1, this->device_id);
1690#endif
1691}
1692bool LockCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1693 switch (field_id) {
1694 case 2:
1695 this->command = static_cast<enums::LockCommand>(value.as_uint32());
1696 break;
1697 case 3:
1698 this->has_code = value.as_bool();
1699 break;
1700#ifdef USE_DEVICES
1701 case 5:
1702 this->device_id = value.as_uint32();
1703 break;
1704#endif
1705 default:
1706 return false;
1707 }
1708 return true;
1709}
1711 switch (field_id) {
1712 case 4:
1713 this->code = value.as_string();
1714 break;
1715 default:
1716 return false;
1717 }
1718 return true;
1719}
1720bool LockCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1721 switch (field_id) {
1722 case 1:
1723 this->key = value.as_fixed32();
1724 break;
1725 default:
1726 return false;
1727 }
1728 return true;
1729}
1730#endif
1731#ifdef USE_BUTTON
1733 buffer.encode_string(1, this->object_id_ref_);
1734 buffer.encode_fixed32(2, this->key);
1735 buffer.encode_string(3, this->name_ref_);
1736#ifdef USE_ENTITY_ICON
1737 buffer.encode_string(5, this->icon_ref_);
1738#endif
1739 buffer.encode_bool(6, this->disabled_by_default);
1740 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
1741 buffer.encode_string(8, this->device_class_ref_);
1742#ifdef USE_DEVICES
1743 buffer.encode_uint32(9, this->device_id);
1744#endif
1745}
1747 size.add_length(1, this->object_id_ref_.size());
1748 size.add_fixed32(1, this->key);
1749 size.add_length(1, this->name_ref_.size());
1750#ifdef USE_ENTITY_ICON
1751 size.add_length(1, this->icon_ref_.size());
1752#endif
1753 size.add_bool(1, this->disabled_by_default);
1754 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1755 size.add_length(1, this->device_class_ref_.size());
1756#ifdef USE_DEVICES
1757 size.add_uint32(1, this->device_id);
1758#endif
1759}
1760bool ButtonCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1761 switch (field_id) {
1762#ifdef USE_DEVICES
1763 case 2:
1764 this->device_id = value.as_uint32();
1765 break;
1766#endif
1767 default:
1768 return false;
1769 }
1770 return true;
1771}
1772bool ButtonCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1773 switch (field_id) {
1774 case 1:
1775 this->key = value.as_fixed32();
1776 break;
1777 default:
1778 return false;
1779 }
1780 return true;
1781}
1782#endif
1783#ifdef USE_MEDIA_PLAYER
1785 buffer.encode_string(1, this->format_ref_);
1786 buffer.encode_uint32(2, this->sample_rate);
1787 buffer.encode_uint32(3, this->num_channels);
1788 buffer.encode_uint32(4, static_cast<uint32_t>(this->purpose));
1789 buffer.encode_uint32(5, this->sample_bytes);
1790}
1792 size.add_length(1, this->format_ref_.size());
1793 size.add_uint32(1, this->sample_rate);
1794 size.add_uint32(1, this->num_channels);
1795 size.add_uint32(1, static_cast<uint32_t>(this->purpose));
1796 size.add_uint32(1, this->sample_bytes);
1797}
1799 buffer.encode_string(1, this->object_id_ref_);
1800 buffer.encode_fixed32(2, this->key);
1801 buffer.encode_string(3, this->name_ref_);
1802#ifdef USE_ENTITY_ICON
1803 buffer.encode_string(5, this->icon_ref_);
1804#endif
1805 buffer.encode_bool(6, this->disabled_by_default);
1806 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
1807 buffer.encode_bool(8, this->supports_pause);
1808 for (auto &it : this->supported_formats) {
1809 buffer.encode_message(9, it, true);
1810 }
1811#ifdef USE_DEVICES
1812 buffer.encode_uint32(10, this->device_id);
1813#endif
1814 buffer.encode_uint32(11, this->feature_flags);
1815}
1817 size.add_length(1, this->object_id_ref_.size());
1818 size.add_fixed32(1, this->key);
1819 size.add_length(1, this->name_ref_.size());
1820#ifdef USE_ENTITY_ICON
1821 size.add_length(1, this->icon_ref_.size());
1822#endif
1823 size.add_bool(1, this->disabled_by_default);
1824 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
1825 size.add_bool(1, this->supports_pause);
1827#ifdef USE_DEVICES
1828 size.add_uint32(1, this->device_id);
1829#endif
1830 size.add_uint32(1, this->feature_flags);
1831}
1833 buffer.encode_fixed32(1, this->key);
1834 buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
1835 buffer.encode_float(3, this->volume);
1836 buffer.encode_bool(4, this->muted);
1837#ifdef USE_DEVICES
1838 buffer.encode_uint32(5, this->device_id);
1839#endif
1840}
1842 size.add_fixed32(1, this->key);
1843 size.add_uint32(1, static_cast<uint32_t>(this->state));
1844 size.add_float(1, this->volume);
1845 size.add_bool(1, this->muted);
1846#ifdef USE_DEVICES
1847 size.add_uint32(1, this->device_id);
1848#endif
1849}
1851 switch (field_id) {
1852 case 2:
1853 this->has_command = value.as_bool();
1854 break;
1855 case 3:
1856 this->command = static_cast<enums::MediaPlayerCommand>(value.as_uint32());
1857 break;
1858 case 4:
1859 this->has_volume = value.as_bool();
1860 break;
1861 case 6:
1862 this->has_media_url = value.as_bool();
1863 break;
1864 case 8:
1865 this->has_announcement = value.as_bool();
1866 break;
1867 case 9:
1868 this->announcement = value.as_bool();
1869 break;
1870#ifdef USE_DEVICES
1871 case 10:
1872 this->device_id = value.as_uint32();
1873 break;
1874#endif
1875 default:
1876 return false;
1877 }
1878 return true;
1879}
1881 switch (field_id) {
1882 case 7:
1883 this->media_url = value.as_string();
1884 break;
1885 default:
1886 return false;
1887 }
1888 return true;
1889}
1891 switch (field_id) {
1892 case 1:
1893 this->key = value.as_fixed32();
1894 break;
1895 case 5:
1896 this->volume = value.as_float();
1897 break;
1898 default:
1899 return false;
1900 }
1901 return true;
1902}
1903#endif
1904#ifdef USE_BLUETOOTH_PROXY
1906 switch (field_id) {
1907 case 1:
1908 this->flags = value.as_uint32();
1909 break;
1910 default:
1911 return false;
1912 }
1913 return true;
1914}
1916 buffer.encode_uint64(1, this->address);
1917 buffer.encode_sint32(2, this->rssi);
1918 buffer.encode_uint32(3, this->address_type);
1919 buffer.encode_bytes(4, this->data, this->data_len);
1920}
1922 size.add_uint64(1, this->address);
1923 size.add_sint32(1, this->rssi);
1924 size.add_uint32(1, this->address_type);
1925 size.add_length(1, this->data_len);
1926}
1928 for (uint16_t i = 0; i < this->advertisements_len; i++) {
1929 buffer.encode_message(1, this->advertisements[i], true);
1930 }
1931}
1933 for (uint16_t i = 0; i < this->advertisements_len; i++) {
1934 size.add_message_object_force(1, this->advertisements[i]);
1935 }
1936}
1938 switch (field_id) {
1939 case 1:
1940 this->address = value.as_uint64();
1941 break;
1942 case 2:
1943 this->request_type = static_cast<enums::BluetoothDeviceRequestType>(value.as_uint32());
1944 break;
1945 case 3:
1946 this->has_address_type = value.as_bool();
1947 break;
1948 case 4:
1949 this->address_type = value.as_uint32();
1950 break;
1951 default:
1952 return false;
1953 }
1954 return true;
1955}
1957 buffer.encode_uint64(1, this->address);
1958 buffer.encode_bool(2, this->connected);
1959 buffer.encode_uint32(3, this->mtu);
1960 buffer.encode_int32(4, this->error);
1961}
1963 size.add_uint64(1, this->address);
1964 size.add_bool(1, this->connected);
1965 size.add_uint32(1, this->mtu);
1966 size.add_int32(1, this->error);
1967}
1969 switch (field_id) {
1970 case 1:
1971 this->address = value.as_uint64();
1972 break;
1973 default:
1974 return false;
1975 }
1976 return true;
1977}
1979 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
1980 buffer.encode_uint64(1, this->uuid[0], true);
1981 buffer.encode_uint64(1, this->uuid[1], true);
1982 }
1983 buffer.encode_uint32(2, this->handle);
1984 buffer.encode_uint32(3, this->short_uuid);
1985}
1987 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
1988 size.add_uint64_force(1, this->uuid[0]);
1989 size.add_uint64_force(1, this->uuid[1]);
1990 }
1991 size.add_uint32(1, this->handle);
1992 size.add_uint32(1, this->short_uuid);
1993}
1995 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
1996 buffer.encode_uint64(1, this->uuid[0], true);
1997 buffer.encode_uint64(1, this->uuid[1], true);
1998 }
1999 buffer.encode_uint32(2, this->handle);
2000 buffer.encode_uint32(3, this->properties);
2001 for (auto &it : this->descriptors) {
2002 buffer.encode_message(4, it, true);
2003 }
2004 buffer.encode_uint32(5, this->short_uuid);
2005}
2007 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2008 size.add_uint64_force(1, this->uuid[0]);
2009 size.add_uint64_force(1, this->uuid[1]);
2010 }
2011 size.add_uint32(1, this->handle);
2012 size.add_uint32(1, this->properties);
2013 size.add_repeated_message(1, this->descriptors);
2014 size.add_uint32(1, this->short_uuid);
2015}
2017 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2018 buffer.encode_uint64(1, this->uuid[0], true);
2019 buffer.encode_uint64(1, this->uuid[1], true);
2020 }
2021 buffer.encode_uint32(2, this->handle);
2022 for (auto &it : this->characteristics) {
2023 buffer.encode_message(3, it, true);
2024 }
2025 buffer.encode_uint32(4, this->short_uuid);
2026}
2028 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2029 size.add_uint64_force(1, this->uuid[0]);
2030 size.add_uint64_force(1, this->uuid[1]);
2031 }
2032 size.add_uint32(1, this->handle);
2034 size.add_uint32(1, this->short_uuid);
2035}
2037 buffer.encode_uint64(1, this->address);
2038 for (auto &it : this->services) {
2039 buffer.encode_message(2, it, true);
2040 }
2041}
2043 size.add_uint64(1, this->address);
2044 size.add_repeated_message(1, this->services);
2045}
2051 switch (field_id) {
2052 case 1:
2053 this->address = value.as_uint64();
2054 break;
2055 case 2:
2056 this->handle = value.as_uint32();
2057 break;
2058 default:
2059 return false;
2060 }
2061 return true;
2062}
2064 buffer.encode_uint64(1, this->address);
2065 buffer.encode_uint32(2, this->handle);
2066 buffer.encode_bytes(3, this->data_ptr_, this->data_len_);
2067}
2069 size.add_uint64(1, this->address);
2070 size.add_uint32(1, this->handle);
2071 size.add_length(1, this->data_len_);
2072}
2074 switch (field_id) {
2075 case 1:
2076 this->address = value.as_uint64();
2077 break;
2078 case 2:
2079 this->handle = value.as_uint32();
2080 break;
2081 case 3:
2082 this->response = value.as_bool();
2083 break;
2084 default:
2085 return false;
2086 }
2087 return true;
2088}
2090 switch (field_id) {
2091 case 4: {
2092 // Use raw data directly to avoid allocation
2093 this->data = value.data();
2094 this->data_len = value.size();
2095 break;
2096 }
2097 default:
2098 return false;
2099 }
2100 return true;
2101}
2103 switch (field_id) {
2104 case 1:
2105 this->address = value.as_uint64();
2106 break;
2107 case 2:
2108 this->handle = value.as_uint32();
2109 break;
2110 default:
2111 return false;
2112 }
2113 return true;
2114}
2116 switch (field_id) {
2117 case 1:
2118 this->address = value.as_uint64();
2119 break;
2120 case 2:
2121 this->handle = value.as_uint32();
2122 break;
2123 default:
2124 return false;
2125 }
2126 return true;
2127}
2129 switch (field_id) {
2130 case 3: {
2131 // Use raw data directly to avoid allocation
2132 this->data = value.data();
2133 this->data_len = value.size();
2134 break;
2135 }
2136 default:
2137 return false;
2138 }
2139 return true;
2140}
2142 switch (field_id) {
2143 case 1:
2144 this->address = value.as_uint64();
2145 break;
2146 case 2:
2147 this->handle = value.as_uint32();
2148 break;
2149 case 3:
2150 this->enable = value.as_bool();
2151 break;
2152 default:
2153 return false;
2154 }
2155 return true;
2156}
2158 buffer.encode_uint64(1, this->address);
2159 buffer.encode_uint32(2, this->handle);
2160 buffer.encode_bytes(3, this->data_ptr_, this->data_len_);
2161}
2163 size.add_uint64(1, this->address);
2164 size.add_uint32(1, this->handle);
2165 size.add_length(1, this->data_len_);
2166}
2168 buffer.encode_uint32(1, this->free);
2169 buffer.encode_uint32(2, this->limit);
2170 for (const auto &it : this->allocated) {
2171 if (it != 0) {
2172 buffer.encode_uint64(3, it, true);
2173 }
2174 }
2175}
2177 size.add_uint32(1, this->free);
2178 size.add_uint32(1, this->limit);
2179 for (const auto &it : this->allocated) {
2180 if (it != 0) {
2181 size.add_uint64_force(1, it);
2182 }
2183 }
2184}
2186 buffer.encode_uint64(1, this->address);
2187 buffer.encode_uint32(2, this->handle);
2188 buffer.encode_int32(3, this->error);
2189}
2191 size.add_uint64(1, this->address);
2192 size.add_uint32(1, this->handle);
2193 size.add_int32(1, this->error);
2194}
2196 buffer.encode_uint64(1, this->address);
2197 buffer.encode_uint32(2, this->handle);
2198}
2200 size.add_uint64(1, this->address);
2201 size.add_uint32(1, this->handle);
2202}
2204 buffer.encode_uint64(1, this->address);
2205 buffer.encode_uint32(2, this->handle);
2206}
2208 size.add_uint64(1, this->address);
2209 size.add_uint32(1, this->handle);
2210}
2212 buffer.encode_uint64(1, this->address);
2213 buffer.encode_bool(2, this->paired);
2214 buffer.encode_int32(3, this->error);
2215}
2217 size.add_uint64(1, this->address);
2218 size.add_bool(1, this->paired);
2219 size.add_int32(1, this->error);
2220}
2222 buffer.encode_uint64(1, this->address);
2223 buffer.encode_bool(2, this->success);
2224 buffer.encode_int32(3, this->error);
2225}
2227 size.add_uint64(1, this->address);
2228 size.add_bool(1, this->success);
2229 size.add_int32(1, this->error);
2230}
2232 buffer.encode_uint64(1, this->address);
2233 buffer.encode_bool(2, this->success);
2234 buffer.encode_int32(3, this->error);
2235}
2237 size.add_uint64(1, this->address);
2238 size.add_bool(1, this->success);
2239 size.add_int32(1, this->error);
2240}
2242 buffer.encode_uint32(1, static_cast<uint32_t>(this->state));
2243 buffer.encode_uint32(2, static_cast<uint32_t>(this->mode));
2244 buffer.encode_uint32(3, static_cast<uint32_t>(this->configured_mode));
2245}
2247 size.add_uint32(1, static_cast<uint32_t>(this->state));
2248 size.add_uint32(1, static_cast<uint32_t>(this->mode));
2249 size.add_uint32(1, static_cast<uint32_t>(this->configured_mode));
2250}
2252 switch (field_id) {
2253 case 1:
2254 this->mode = static_cast<enums::BluetoothScannerMode>(value.as_uint32());
2255 break;
2256 default:
2257 return false;
2258 }
2259 return true;
2260}
2261#endif
2262#ifdef USE_VOICE_ASSISTANT
2264 switch (field_id) {
2265 case 1:
2266 this->subscribe = value.as_bool();
2267 break;
2268 case 2:
2269 this->flags = value.as_uint32();
2270 break;
2271 default:
2272 return false;
2273 }
2274 return true;
2275}
2277 buffer.encode_uint32(1, this->noise_suppression_level);
2278 buffer.encode_uint32(2, this->auto_gain);
2279 buffer.encode_float(3, this->volume_multiplier);
2280}
2282 size.add_uint32(1, this->noise_suppression_level);
2283 size.add_uint32(1, this->auto_gain);
2284 size.add_float(1, this->volume_multiplier);
2285}
2287 buffer.encode_bool(1, this->start);
2288 buffer.encode_string(2, this->conversation_id_ref_);
2289 buffer.encode_uint32(3, this->flags);
2290 buffer.encode_message(4, this->audio_settings);
2291 buffer.encode_string(5, this->wake_word_phrase_ref_);
2292}
2294 size.add_bool(1, this->start);
2295 size.add_length(1, this->conversation_id_ref_.size());
2296 size.add_uint32(1, this->flags);
2297 size.add_message_object(1, this->audio_settings);
2298 size.add_length(1, this->wake_word_phrase_ref_.size());
2299}
2301 switch (field_id) {
2302 case 1:
2303 this->port = value.as_uint32();
2304 break;
2305 case 2:
2306 this->error = value.as_bool();
2307 break;
2308 default:
2309 return false;
2310 }
2311 return true;
2312}
2314 switch (field_id) {
2315 case 1:
2316 this->name = value.as_string();
2317 break;
2318 case 2:
2319 this->value = value.as_string();
2320 break;
2321 default:
2322 return false;
2323 }
2324 return true;
2325}
2327 switch (field_id) {
2328 case 1:
2329 this->event_type = static_cast<enums::VoiceAssistantEvent>(value.as_uint32());
2330 break;
2331 default:
2332 return false;
2333 }
2334 return true;
2335}
2337 switch (field_id) {
2338 case 2:
2339 this->data.emplace_back();
2340 value.decode_to_message(this->data.back());
2341 break;
2342 default:
2343 return false;
2344 }
2345 return true;
2346}
2347bool VoiceAssistantAudio::decode_varint(uint32_t field_id, ProtoVarInt value) {
2348 switch (field_id) {
2349 case 2:
2350 this->end = value.as_bool();
2351 break;
2352 default:
2353 return false;
2354 }
2355 return true;
2356}
2358 switch (field_id) {
2359 case 1:
2360 this->data = value.as_string();
2361 break;
2362 default:
2363 return false;
2364 }
2365 return true;
2366}
2368 buffer.encode_bytes(1, this->data_ptr_, this->data_len_);
2369 buffer.encode_bool(2, this->end);
2370}
2372 size.add_length(1, this->data_len_);
2373 size.add_bool(1, this->end);
2374}
2376 switch (field_id) {
2377 case 1:
2378 this->event_type = static_cast<enums::VoiceAssistantTimerEvent>(value.as_uint32());
2379 break;
2380 case 4:
2381 this->total_seconds = value.as_uint32();
2382 break;
2383 case 5:
2384 this->seconds_left = value.as_uint32();
2385 break;
2386 case 6:
2387 this->is_active = value.as_bool();
2388 break;
2389 default:
2390 return false;
2391 }
2392 return true;
2393}
2395 switch (field_id) {
2396 case 2:
2397 this->timer_id = value.as_string();
2398 break;
2399 case 3:
2400 this->name = value.as_string();
2401 break;
2402 default:
2403 return false;
2404 }
2405 return true;
2406}
2408 switch (field_id) {
2409 case 4:
2410 this->start_conversation = value.as_bool();
2411 break;
2412 default:
2413 return false;
2414 }
2415 return true;
2416}
2418 switch (field_id) {
2419 case 1:
2420 this->media_id = value.as_string();
2421 break;
2422 case 2:
2423 this->text = value.as_string();
2424 break;
2425 case 3:
2426 this->preannounce_media_id = value.as_string();
2427 break;
2428 default:
2429 return false;
2430 }
2431 return true;
2432}
2436 buffer.encode_string(1, this->id_ref_);
2437 buffer.encode_string(2, this->wake_word_ref_);
2438 for (auto &it : this->trained_languages) {
2439 buffer.encode_string(3, it, true);
2440 }
2441}
2443 size.add_length(1, this->id_ref_.size());
2444 size.add_length(1, this->wake_word_ref_.size());
2445 if (!this->trained_languages.empty()) {
2446 for (const auto &it : this->trained_languages) {
2447 size.add_length_force(1, it.size());
2448 }
2449 }
2450}
2452 switch (field_id) {
2453 case 5:
2454 this->model_size = value.as_uint32();
2455 break;
2456 default:
2457 return false;
2458 }
2459 return true;
2460}
2462 switch (field_id) {
2463 case 1:
2464 this->id = value.as_string();
2465 break;
2466 case 2:
2467 this->wake_word = value.as_string();
2468 break;
2469 case 3:
2470 this->trained_languages.push_back(value.as_string());
2471 break;
2472 case 4:
2473 this->model_type = value.as_string();
2474 break;
2475 case 6:
2476 this->model_hash = value.as_string();
2477 break;
2478 case 7:
2479 this->url = value.as_string();
2480 break;
2481 default:
2482 return false;
2483 }
2484 return true;
2485}
2487 switch (field_id) {
2488 case 1:
2489 this->external_wake_words.emplace_back();
2490 value.decode_to_message(this->external_wake_words.back());
2491 break;
2492 default:
2493 return false;
2494 }
2495 return true;
2496}
2498 for (auto &it : this->available_wake_words) {
2499 buffer.encode_message(1, it, true);
2500 }
2501 for (const auto &it : *this->active_wake_words) {
2502 buffer.encode_string(2, it, true);
2503 }
2504 buffer.encode_uint32(3, this->max_active_wake_words);
2505}
2508 if (!this->active_wake_words->empty()) {
2509 for (const auto &it : *this->active_wake_words) {
2510 size.add_length_force(1, it.size());
2511 }
2512 }
2513 size.add_uint32(1, this->max_active_wake_words);
2514}
2516 switch (field_id) {
2517 case 1:
2518 this->active_wake_words.push_back(value.as_string());
2519 break;
2520 default:
2521 return false;
2522 }
2523 return true;
2524}
2525#endif
2526#ifdef USE_ALARM_CONTROL_PANEL
2528 buffer.encode_string(1, this->object_id_ref_);
2529 buffer.encode_fixed32(2, this->key);
2530 buffer.encode_string(3, this->name_ref_);
2531#ifdef USE_ENTITY_ICON
2532 buffer.encode_string(5, this->icon_ref_);
2533#endif
2534 buffer.encode_bool(6, this->disabled_by_default);
2535 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2536 buffer.encode_uint32(8, this->supported_features);
2537 buffer.encode_bool(9, this->requires_code);
2538 buffer.encode_bool(10, this->requires_code_to_arm);
2539#ifdef USE_DEVICES
2540 buffer.encode_uint32(11, this->device_id);
2541#endif
2542}
2544 size.add_length(1, this->object_id_ref_.size());
2545 size.add_fixed32(1, this->key);
2546 size.add_length(1, this->name_ref_.size());
2547#ifdef USE_ENTITY_ICON
2548 size.add_length(1, this->icon_ref_.size());
2549#endif
2550 size.add_bool(1, this->disabled_by_default);
2551 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2552 size.add_uint32(1, this->supported_features);
2553 size.add_bool(1, this->requires_code);
2554 size.add_bool(1, this->requires_code_to_arm);
2555#ifdef USE_DEVICES
2556 size.add_uint32(1, this->device_id);
2557#endif
2558}
2560 buffer.encode_fixed32(1, this->key);
2561 buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
2562#ifdef USE_DEVICES
2563 buffer.encode_uint32(3, this->device_id);
2564#endif
2565}
2567 size.add_fixed32(1, this->key);
2568 size.add_uint32(1, static_cast<uint32_t>(this->state));
2569#ifdef USE_DEVICES
2570 size.add_uint32(1, this->device_id);
2571#endif
2572}
2574 switch (field_id) {
2575 case 2:
2576 this->command = static_cast<enums::AlarmControlPanelStateCommand>(value.as_uint32());
2577 break;
2578#ifdef USE_DEVICES
2579 case 4:
2580 this->device_id = value.as_uint32();
2581 break;
2582#endif
2583 default:
2584 return false;
2585 }
2586 return true;
2587}
2589 switch (field_id) {
2590 case 3:
2591 this->code = value.as_string();
2592 break;
2593 default:
2594 return false;
2595 }
2596 return true;
2597}
2599 switch (field_id) {
2600 case 1:
2601 this->key = value.as_fixed32();
2602 break;
2603 default:
2604 return false;
2605 }
2606 return true;
2607}
2608#endif
2609#ifdef USE_TEXT
2611 buffer.encode_string(1, this->object_id_ref_);
2612 buffer.encode_fixed32(2, this->key);
2613 buffer.encode_string(3, this->name_ref_);
2614#ifdef USE_ENTITY_ICON
2615 buffer.encode_string(5, this->icon_ref_);
2616#endif
2617 buffer.encode_bool(6, this->disabled_by_default);
2618 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2619 buffer.encode_uint32(8, this->min_length);
2620 buffer.encode_uint32(9, this->max_length);
2621 buffer.encode_string(10, this->pattern_ref_);
2622 buffer.encode_uint32(11, static_cast<uint32_t>(this->mode));
2623#ifdef USE_DEVICES
2624 buffer.encode_uint32(12, this->device_id);
2625#endif
2626}
2628 size.add_length(1, this->object_id_ref_.size());
2629 size.add_fixed32(1, this->key);
2630 size.add_length(1, this->name_ref_.size());
2631#ifdef USE_ENTITY_ICON
2632 size.add_length(1, this->icon_ref_.size());
2633#endif
2634 size.add_bool(1, this->disabled_by_default);
2635 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2636 size.add_uint32(1, this->min_length);
2637 size.add_uint32(1, this->max_length);
2638 size.add_length(1, this->pattern_ref_.size());
2639 size.add_uint32(1, static_cast<uint32_t>(this->mode));
2640#ifdef USE_DEVICES
2641 size.add_uint32(1, this->device_id);
2642#endif
2643}
2645 buffer.encode_fixed32(1, this->key);
2646 buffer.encode_string(2, this->state_ref_);
2647 buffer.encode_bool(3, this->missing_state);
2648#ifdef USE_DEVICES
2649 buffer.encode_uint32(4, this->device_id);
2650#endif
2651}
2653 size.add_fixed32(1, this->key);
2654 size.add_length(1, this->state_ref_.size());
2655 size.add_bool(1, this->missing_state);
2656#ifdef USE_DEVICES
2657 size.add_uint32(1, this->device_id);
2658#endif
2659}
2660bool TextCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2661 switch (field_id) {
2662#ifdef USE_DEVICES
2663 case 3:
2664 this->device_id = value.as_uint32();
2665 break;
2666#endif
2667 default:
2668 return false;
2669 }
2670 return true;
2671}
2673 switch (field_id) {
2674 case 2:
2675 this->state = value.as_string();
2676 break;
2677 default:
2678 return false;
2679 }
2680 return true;
2681}
2682bool TextCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2683 switch (field_id) {
2684 case 1:
2685 this->key = value.as_fixed32();
2686 break;
2687 default:
2688 return false;
2689 }
2690 return true;
2691}
2692#endif
2693#ifdef USE_DATETIME_DATE
2695 buffer.encode_string(1, this->object_id_ref_);
2696 buffer.encode_fixed32(2, this->key);
2697 buffer.encode_string(3, this->name_ref_);
2698#ifdef USE_ENTITY_ICON
2699 buffer.encode_string(5, this->icon_ref_);
2700#endif
2701 buffer.encode_bool(6, this->disabled_by_default);
2702 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2703#ifdef USE_DEVICES
2704 buffer.encode_uint32(8, this->device_id);
2705#endif
2706}
2708 size.add_length(1, this->object_id_ref_.size());
2709 size.add_fixed32(1, this->key);
2710 size.add_length(1, this->name_ref_.size());
2711#ifdef USE_ENTITY_ICON
2712 size.add_length(1, this->icon_ref_.size());
2713#endif
2714 size.add_bool(1, this->disabled_by_default);
2715 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2716#ifdef USE_DEVICES
2717 size.add_uint32(1, this->device_id);
2718#endif
2719}
2721 buffer.encode_fixed32(1, this->key);
2722 buffer.encode_bool(2, this->missing_state);
2723 buffer.encode_uint32(3, this->year);
2724 buffer.encode_uint32(4, this->month);
2725 buffer.encode_uint32(5, this->day);
2726#ifdef USE_DEVICES
2727 buffer.encode_uint32(6, this->device_id);
2728#endif
2729}
2731 size.add_fixed32(1, this->key);
2732 size.add_bool(1, this->missing_state);
2733 size.add_uint32(1, this->year);
2734 size.add_uint32(1, this->month);
2735 size.add_uint32(1, this->day);
2736#ifdef USE_DEVICES
2737 size.add_uint32(1, this->device_id);
2738#endif
2739}
2740bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2741 switch (field_id) {
2742 case 2:
2743 this->year = value.as_uint32();
2744 break;
2745 case 3:
2746 this->month = value.as_uint32();
2747 break;
2748 case 4:
2749 this->day = value.as_uint32();
2750 break;
2751#ifdef USE_DEVICES
2752 case 5:
2753 this->device_id = value.as_uint32();
2754 break;
2755#endif
2756 default:
2757 return false;
2758 }
2759 return true;
2760}
2761bool DateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2762 switch (field_id) {
2763 case 1:
2764 this->key = value.as_fixed32();
2765 break;
2766 default:
2767 return false;
2768 }
2769 return true;
2770}
2771#endif
2772#ifdef USE_DATETIME_TIME
2774 buffer.encode_string(1, this->object_id_ref_);
2775 buffer.encode_fixed32(2, this->key);
2776 buffer.encode_string(3, this->name_ref_);
2777#ifdef USE_ENTITY_ICON
2778 buffer.encode_string(5, this->icon_ref_);
2779#endif
2780 buffer.encode_bool(6, this->disabled_by_default);
2781 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2782#ifdef USE_DEVICES
2783 buffer.encode_uint32(8, this->device_id);
2784#endif
2785}
2787 size.add_length(1, this->object_id_ref_.size());
2788 size.add_fixed32(1, this->key);
2789 size.add_length(1, this->name_ref_.size());
2790#ifdef USE_ENTITY_ICON
2791 size.add_length(1, this->icon_ref_.size());
2792#endif
2793 size.add_bool(1, this->disabled_by_default);
2794 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2795#ifdef USE_DEVICES
2796 size.add_uint32(1, this->device_id);
2797#endif
2798}
2800 buffer.encode_fixed32(1, this->key);
2801 buffer.encode_bool(2, this->missing_state);
2802 buffer.encode_uint32(3, this->hour);
2803 buffer.encode_uint32(4, this->minute);
2804 buffer.encode_uint32(5, this->second);
2805#ifdef USE_DEVICES
2806 buffer.encode_uint32(6, this->device_id);
2807#endif
2808}
2810 size.add_fixed32(1, this->key);
2811 size.add_bool(1, this->missing_state);
2812 size.add_uint32(1, this->hour);
2813 size.add_uint32(1, this->minute);
2814 size.add_uint32(1, this->second);
2815#ifdef USE_DEVICES
2816 size.add_uint32(1, this->device_id);
2817#endif
2818}
2819bool TimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2820 switch (field_id) {
2821 case 2:
2822 this->hour = value.as_uint32();
2823 break;
2824 case 3:
2825 this->minute = value.as_uint32();
2826 break;
2827 case 4:
2828 this->second = value.as_uint32();
2829 break;
2830#ifdef USE_DEVICES
2831 case 5:
2832 this->device_id = value.as_uint32();
2833 break;
2834#endif
2835 default:
2836 return false;
2837 }
2838 return true;
2839}
2840bool TimeCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2841 switch (field_id) {
2842 case 1:
2843 this->key = value.as_fixed32();
2844 break;
2845 default:
2846 return false;
2847 }
2848 return true;
2849}
2850#endif
2851#ifdef USE_EVENT
2853 buffer.encode_string(1, this->object_id_ref_);
2854 buffer.encode_fixed32(2, this->key);
2855 buffer.encode_string(3, this->name_ref_);
2856#ifdef USE_ENTITY_ICON
2857 buffer.encode_string(5, this->icon_ref_);
2858#endif
2859 buffer.encode_bool(6, this->disabled_by_default);
2860 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2861 buffer.encode_string(8, this->device_class_ref_);
2862 for (auto &it : this->event_types) {
2863 buffer.encode_string(9, it, true);
2864 }
2865#ifdef USE_DEVICES
2866 buffer.encode_uint32(10, this->device_id);
2867#endif
2868}
2870 size.add_length(1, this->object_id_ref_.size());
2871 size.add_fixed32(1, this->key);
2872 size.add_length(1, this->name_ref_.size());
2873#ifdef USE_ENTITY_ICON
2874 size.add_length(1, this->icon_ref_.size());
2875#endif
2876 size.add_bool(1, this->disabled_by_default);
2877 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2878 size.add_length(1, this->device_class_ref_.size());
2879 if (!this->event_types.empty()) {
2880 for (const auto &it : this->event_types) {
2881 size.add_length_force(1, it.size());
2882 }
2883 }
2884#ifdef USE_DEVICES
2885 size.add_uint32(1, this->device_id);
2886#endif
2887}
2889 buffer.encode_fixed32(1, this->key);
2890 buffer.encode_string(2, this->event_type_ref_);
2891#ifdef USE_DEVICES
2892 buffer.encode_uint32(3, this->device_id);
2893#endif
2894}
2896 size.add_fixed32(1, this->key);
2897 size.add_length(1, this->event_type_ref_.size());
2898#ifdef USE_DEVICES
2899 size.add_uint32(1, this->device_id);
2900#endif
2901}
2902#endif
2903#ifdef USE_VALVE
2905 buffer.encode_string(1, this->object_id_ref_);
2906 buffer.encode_fixed32(2, this->key);
2907 buffer.encode_string(3, this->name_ref_);
2908#ifdef USE_ENTITY_ICON
2909 buffer.encode_string(5, this->icon_ref_);
2910#endif
2911 buffer.encode_bool(6, this->disabled_by_default);
2912 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2913 buffer.encode_string(8, this->device_class_ref_);
2914 buffer.encode_bool(9, this->assumed_state);
2915 buffer.encode_bool(10, this->supports_position);
2916 buffer.encode_bool(11, this->supports_stop);
2917#ifdef USE_DEVICES
2918 buffer.encode_uint32(12, this->device_id);
2919#endif
2920}
2922 size.add_length(1, this->object_id_ref_.size());
2923 size.add_fixed32(1, this->key);
2924 size.add_length(1, this->name_ref_.size());
2925#ifdef USE_ENTITY_ICON
2926 size.add_length(1, this->icon_ref_.size());
2927#endif
2928 size.add_bool(1, this->disabled_by_default);
2929 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
2930 size.add_length(1, this->device_class_ref_.size());
2931 size.add_bool(1, this->assumed_state);
2932 size.add_bool(1, this->supports_position);
2933 size.add_bool(1, this->supports_stop);
2934#ifdef USE_DEVICES
2935 size.add_uint32(1, this->device_id);
2936#endif
2937}
2939 buffer.encode_fixed32(1, this->key);
2940 buffer.encode_float(2, this->position);
2941 buffer.encode_uint32(3, static_cast<uint32_t>(this->current_operation));
2942#ifdef USE_DEVICES
2943 buffer.encode_uint32(4, this->device_id);
2944#endif
2945}
2947 size.add_fixed32(1, this->key);
2948 size.add_float(1, this->position);
2949 size.add_uint32(1, static_cast<uint32_t>(this->current_operation));
2950#ifdef USE_DEVICES
2951 size.add_uint32(1, this->device_id);
2952#endif
2953}
2954bool ValveCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2955 switch (field_id) {
2956 case 2:
2957 this->has_position = value.as_bool();
2958 break;
2959 case 4:
2960 this->stop = value.as_bool();
2961 break;
2962#ifdef USE_DEVICES
2963 case 5:
2964 this->device_id = value.as_uint32();
2965 break;
2966#endif
2967 default:
2968 return false;
2969 }
2970 return true;
2971}
2972bool ValveCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2973 switch (field_id) {
2974 case 1:
2975 this->key = value.as_fixed32();
2976 break;
2977 case 3:
2978 this->position = value.as_float();
2979 break;
2980 default:
2981 return false;
2982 }
2983 return true;
2984}
2985#endif
2986#ifdef USE_DATETIME_DATETIME
2988 buffer.encode_string(1, this->object_id_ref_);
2989 buffer.encode_fixed32(2, this->key);
2990 buffer.encode_string(3, this->name_ref_);
2991#ifdef USE_ENTITY_ICON
2992 buffer.encode_string(5, this->icon_ref_);
2993#endif
2994 buffer.encode_bool(6, this->disabled_by_default);
2995 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
2996#ifdef USE_DEVICES
2997 buffer.encode_uint32(8, this->device_id);
2998#endif
2999}
3001 size.add_length(1, this->object_id_ref_.size());
3002 size.add_fixed32(1, this->key);
3003 size.add_length(1, this->name_ref_.size());
3004#ifdef USE_ENTITY_ICON
3005 size.add_length(1, this->icon_ref_.size());
3006#endif
3007 size.add_bool(1, this->disabled_by_default);
3008 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
3009#ifdef USE_DEVICES
3010 size.add_uint32(1, this->device_id);
3011#endif
3012}
3014 buffer.encode_fixed32(1, this->key);
3015 buffer.encode_bool(2, this->missing_state);
3016 buffer.encode_fixed32(3, this->epoch_seconds);
3017#ifdef USE_DEVICES
3018 buffer.encode_uint32(4, this->device_id);
3019#endif
3020}
3022 size.add_fixed32(1, this->key);
3023 size.add_bool(1, this->missing_state);
3024 size.add_fixed32(1, this->epoch_seconds);
3025#ifdef USE_DEVICES
3026 size.add_uint32(1, this->device_id);
3027#endif
3028}
3030 switch (field_id) {
3031#ifdef USE_DEVICES
3032 case 3:
3033 this->device_id = value.as_uint32();
3034 break;
3035#endif
3036 default:
3037 return false;
3038 }
3039 return true;
3040}
3041bool DateTimeCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
3042 switch (field_id) {
3043 case 1:
3044 this->key = value.as_fixed32();
3045 break;
3046 case 2:
3047 this->epoch_seconds = value.as_fixed32();
3048 break;
3049 default:
3050 return false;
3051 }
3052 return true;
3053}
3054#endif
3055#ifdef USE_UPDATE
3057 buffer.encode_string(1, this->object_id_ref_);
3058 buffer.encode_fixed32(2, this->key);
3059 buffer.encode_string(3, this->name_ref_);
3060#ifdef USE_ENTITY_ICON
3061 buffer.encode_string(5, this->icon_ref_);
3062#endif
3063 buffer.encode_bool(6, this->disabled_by_default);
3064 buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
3065 buffer.encode_string(8, this->device_class_ref_);
3066#ifdef USE_DEVICES
3067 buffer.encode_uint32(9, this->device_id);
3068#endif
3069}
3071 size.add_length(1, this->object_id_ref_.size());
3072 size.add_fixed32(1, this->key);
3073 size.add_length(1, this->name_ref_.size());
3074#ifdef USE_ENTITY_ICON
3075 size.add_length(1, this->icon_ref_.size());
3076#endif
3077 size.add_bool(1, this->disabled_by_default);
3078 size.add_uint32(1, static_cast<uint32_t>(this->entity_category));
3079 size.add_length(1, this->device_class_ref_.size());
3080#ifdef USE_DEVICES
3081 size.add_uint32(1, this->device_id);
3082#endif
3083}
3085 buffer.encode_fixed32(1, this->key);
3086 buffer.encode_bool(2, this->missing_state);
3087 buffer.encode_bool(3, this->in_progress);
3088 buffer.encode_bool(4, this->has_progress);
3089 buffer.encode_float(5, this->progress);
3090 buffer.encode_string(6, this->current_version_ref_);
3091 buffer.encode_string(7, this->latest_version_ref_);
3092 buffer.encode_string(8, this->title_ref_);
3093 buffer.encode_string(9, this->release_summary_ref_);
3094 buffer.encode_string(10, this->release_url_ref_);
3095#ifdef USE_DEVICES
3096 buffer.encode_uint32(11, this->device_id);
3097#endif
3098}
3100 size.add_fixed32(1, this->key);
3101 size.add_bool(1, this->missing_state);
3102 size.add_bool(1, this->in_progress);
3103 size.add_bool(1, this->has_progress);
3104 size.add_float(1, this->progress);
3105 size.add_length(1, this->current_version_ref_.size());
3106 size.add_length(1, this->latest_version_ref_.size());
3107 size.add_length(1, this->title_ref_.size());
3108 size.add_length(1, this->release_summary_ref_.size());
3109 size.add_length(1, this->release_url_ref_.size());
3110#ifdef USE_DEVICES
3111 size.add_uint32(1, this->device_id);
3112#endif
3113}
3114bool UpdateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
3115 switch (field_id) {
3116 case 2:
3117 this->command = static_cast<enums::UpdateCommand>(value.as_uint32());
3118 break;
3119#ifdef USE_DEVICES
3120 case 3:
3121 this->device_id = value.as_uint32();
3122 break;
3123#endif
3124 default:
3125 return false;
3126 }
3127 return true;
3128}
3129bool UpdateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
3130 switch (field_id) {
3131 case 1:
3132 this->key = value.as_fixed32();
3133 break;
3134 default:
3135 return false;
3136 }
3137 return true;
3138}
3139#endif
3140#ifdef USE_ZWAVE_PROXY
3142 switch (field_id) {
3143 case 1: {
3144 // Use raw data directly to avoid allocation
3145 this->data = value.data();
3146 this->data_len = value.size();
3147 break;
3148 }
3149 default:
3150 return false;
3151 }
3152 return true;
3153}
3154void ZWaveProxyFrame::encode(ProtoWriteBuffer buffer) const { buffer.encode_bytes(1, this->data, this->data_len); }
3156bool ZWaveProxyRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
3157 switch (field_id) {
3158 case 1:
3159 this->type = static_cast<enums::ZWaveProxyRequestType>(value.as_uint32());
3160 break;
3161 default:
3162 return false;
3163 }
3164 return true;
3165}
3167 switch (field_id) {
3168 case 2: {
3169 // Use raw data directly to avoid allocation
3170 this->data = value.data();
3171 this->data_len = value.size();
3172 break;
3173 }
3174 default:
3175 return false;
3176 }
3177 return true;
3178}
3180 buffer.encode_uint32(1, static_cast<uint32_t>(this->type));
3181 buffer.encode_bytes(2, this->data, this->data_len);
3182}
3184 size.add_uint32(1, static_cast<uint32_t>(this->type));
3185 size.add_length(2, this->data_len);
3186}
3187#endif
3188
3189} // 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:2598
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2573
enums::AlarmControlPanelStateCommand command
Definition api_pb2.h:2601
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2588
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2566
enums::AlarmControlPanelState state
Definition api_pb2.h:2585
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2559
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:2139
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2167
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2176
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2236
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2231
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1956
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1962
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2216
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2211
enums::BluetoothDeviceRequestType request_type
Definition api_pb2.h:1864
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1937
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2221
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2226
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1994
std::vector< BluetoothGATTDescriptor > descriptors
Definition api_pb2.h:1926
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2006
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:1923
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1986
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:1910
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1978
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2185
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2190
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2046
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2049
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1968
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2042
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2036
std::vector< BluetoothGATTService > services
Definition api_pb2.h:1958
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2157
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2162
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2141
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2207
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2203
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2102
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2050
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2063
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2068
std::vector< BluetoothGATTCharacteristic > characteristics
Definition api_pb2.h:1940
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2027
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2016
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:1938
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2128
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2115
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2089
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2073
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2199
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2195
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1921
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1915
std::array< BluetoothLERawAdvertisement, BLUETOOTH_PROXY_ADVERTISEMENT_BATCH_SIZE > advertisements
Definition api_pb2.h:1846
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1927
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1932
enums::BluetoothScannerMode mode
Definition api_pb2.h:2292
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2251
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2241
enums::BluetoothScannerMode mode
Definition api_pb2.h:2275
enums::BluetoothScannerState state
Definition api_pb2.h:2274
enums::BluetoothScannerMode configured_mode
Definition api_pb2.h:2276
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2246
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1760
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1772
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1132
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1124
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1116
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1348
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1449
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1447
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1281
enums::ClimatePreset preset
Definition api_pb2.h:1453
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1335
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1414
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1415
enums::ClimateAction action
Definition api_pb2.h:1413
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1243
enums::ClimatePreset preset
Definition api_pb2.h:1418
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1262
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:2761
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2740
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2720
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2730
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3041
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3029
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3021
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3013
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:2895
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2888
std::vector< int32_t > int_array
Definition api_pb2.h:1283
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1041
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1019
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1054
std::vector< std::string > string_array
Definition api_pb2.h:1285
std::vector< float > float_array
Definition api_pb2.h:1284
std::vector< ExecuteServiceArgument > args
Definition api_pb2.h:1303
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1078
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1067
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:988
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:975
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:958
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:897
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:875
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:915
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:928
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:2543
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2527
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:1746
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1732
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1103
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1090
const std::set< std::string > * supported_custom_presets
Definition api_pb2.h:1387
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1189
const std::set< climate::ClimateSwingMode > * supported_swing_modes
Definition api_pb2.h:1384
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1147
const std::set< std::string > * supported_custom_fan_modes
Definition api_pb2.h:1385
const std::set< climate::ClimateFanMode > * supported_fan_modes
Definition api_pb2.h:1383
const std::set< climate::ClimatePreset > * supported_presets
Definition api_pb2.h:1386
const std::set< climate::ClimateMode > * supported_modes
Definition api_pb2.h:1378
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:2694
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2707
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3000
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2987
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2869
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2852
std::vector< std::string > event_types
Definition api_pb2.h:2788
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:1644
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1661
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1798
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1816
std::vector< MediaPlayerSupportedFormat > supported_formats
Definition api_pb2.h:1755
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1391
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1372
const std::vector< std::string > * options
Definition api_pb2.h:1534
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1469
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1453
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:1003
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:999
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1014
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1007
std::vector< ListEntitiesServicesArgument > args
Definition api_pb2.h:1266
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1537
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1555
std::vector< std::string > tones
Definition api_pb2.h:1587
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:2627
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2610
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:2773
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2786
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3070
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3056
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2921
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2904
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1692
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1720
enums::LockCommand command
Definition api_pb2.h:1683
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1710
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1685
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1678
enums::MediaPlayerCommand command
Definition api_pb2.h:1791
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1890
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1850
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1880
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1841
enums::MediaPlayerState state
Definition api_pb2.h:1772
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1832
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1791
enums::MediaPlayerFormatPurpose purpose
Definition api_pb2.h:1737
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1784
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:1438
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1426
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1410
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1418
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:1515
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1503
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1525
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1487
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1495
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:1619
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1589
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1629
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:1582
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1575
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1905
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:953
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:948
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:2263
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:2672
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2682
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2660
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:2652
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2644
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2840
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2819
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2809
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2799
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3129
enums::UpdateCommand command
Definition api_pb2.h:2976
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3114
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3099
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3084
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2954
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2972
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2938
enums::ValveOperation current_operation
Definition api_pb2.h:2844
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2946
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2434
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2433
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2417
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2407
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2367
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2371
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2357
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2347
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2276
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2281
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2486
std::vector< VoiceAssistantExternalWakeWord > external_wake_words
Definition api_pb2.h:2517
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2506
std::vector< VoiceAssistantWakeWord > available_wake_words
Definition api_pb2.h:2532
const std::vector< std::string > * active_wake_words
Definition api_pb2.h:2533
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2497
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2313
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2336
enums::VoiceAssistantEvent event_type
Definition api_pb2.h:2387
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2326
std::vector< VoiceAssistantEventData > data
Definition api_pb2.h:2388
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2461
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2451
std::vector< std::string > trained_languages
Definition api_pb2.h:2497
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2293
VoiceAssistantAudioSettings audio_settings
Definition api_pb2.h:2342
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2286
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2300
std::vector< std::string > active_wake_words
Definition api_pb2.h:2550
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2515
enums::VoiceAssistantTimerEvent event_type
Definition api_pb2.h:2429
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2394
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2375
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2435
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:2442
std::vector< std::string > trained_languages
Definition api_pb2.h:2484
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3141
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3154
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3155
void calculate_size(ProtoSize &size) const override
Definition api_pb2.cpp:3183
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3166
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3156
enums::ZWaveProxyRequestType type
Definition api_pb2.h:3012
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3179