ESPHome 2025.5.0
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 "api_pb2_size.h"
5#include "esphome/core/log.h"
6
7#include <cinttypes>
8
9namespace esphome {
10namespace api {
11
12#ifdef HAS_PROTO_MESSAGE_DUMP
14 switch (value) {
16 return "ENTITY_CATEGORY_NONE";
18 return "ENTITY_CATEGORY_CONFIG";
20 return "ENTITY_CATEGORY_DIAGNOSTIC";
21 default:
22 return "UNKNOWN";
23 }
24}
25#endif
26#ifdef HAS_PROTO_MESSAGE_DUMP
28 switch (value) {
30 return "LEGACY_COVER_STATE_OPEN";
32 return "LEGACY_COVER_STATE_CLOSED";
33 default:
34 return "UNKNOWN";
35 }
36}
37#endif
38#ifdef HAS_PROTO_MESSAGE_DUMP
40 switch (value) {
42 return "COVER_OPERATION_IDLE";
44 return "COVER_OPERATION_IS_OPENING";
46 return "COVER_OPERATION_IS_CLOSING";
47 default:
48 return "UNKNOWN";
49 }
50}
51#endif
52#ifdef HAS_PROTO_MESSAGE_DUMP
54 switch (value) {
56 return "LEGACY_COVER_COMMAND_OPEN";
58 return "LEGACY_COVER_COMMAND_CLOSE";
60 return "LEGACY_COVER_COMMAND_STOP";
61 default:
62 return "UNKNOWN";
63 }
64}
65#endif
66#ifdef HAS_PROTO_MESSAGE_DUMP
68 switch (value) {
70 return "FAN_SPEED_LOW";
72 return "FAN_SPEED_MEDIUM";
74 return "FAN_SPEED_HIGH";
75 default:
76 return "UNKNOWN";
77 }
78}
79#endif
80#ifdef HAS_PROTO_MESSAGE_DUMP
82 switch (value) {
84 return "FAN_DIRECTION_FORWARD";
86 return "FAN_DIRECTION_REVERSE";
87 default:
88 return "UNKNOWN";
89 }
90}
91#endif
92#ifdef HAS_PROTO_MESSAGE_DUMP
94 switch (value) {
96 return "COLOR_MODE_UNKNOWN";
98 return "COLOR_MODE_ON_OFF";
100 return "COLOR_MODE_BRIGHTNESS";
102 return "COLOR_MODE_WHITE";
104 return "COLOR_MODE_COLOR_TEMPERATURE";
106 return "COLOR_MODE_COLD_WARM_WHITE";
108 return "COLOR_MODE_RGB";
110 return "COLOR_MODE_RGB_WHITE";
112 return "COLOR_MODE_RGB_COLOR_TEMPERATURE";
114 return "COLOR_MODE_RGB_COLD_WARM_WHITE";
115 default:
116 return "UNKNOWN";
117 }
118}
119#endif
120#ifdef HAS_PROTO_MESSAGE_DUMP
122 switch (value) {
124 return "STATE_CLASS_NONE";
126 return "STATE_CLASS_MEASUREMENT";
128 return "STATE_CLASS_TOTAL_INCREASING";
130 return "STATE_CLASS_TOTAL";
131 default:
132 return "UNKNOWN";
133 }
134}
135#endif
136#ifdef HAS_PROTO_MESSAGE_DUMP
138 switch (value) {
140 return "LAST_RESET_NONE";
142 return "LAST_RESET_NEVER";
144 return "LAST_RESET_AUTO";
145 default:
146 return "UNKNOWN";
147 }
148}
149#endif
150#ifdef HAS_PROTO_MESSAGE_DUMP
152 switch (value) {
154 return "LOG_LEVEL_NONE";
156 return "LOG_LEVEL_ERROR";
158 return "LOG_LEVEL_WARN";
160 return "LOG_LEVEL_INFO";
162 return "LOG_LEVEL_CONFIG";
164 return "LOG_LEVEL_DEBUG";
166 return "LOG_LEVEL_VERBOSE";
168 return "LOG_LEVEL_VERY_VERBOSE";
169 default:
170 return "UNKNOWN";
171 }
172}
173#endif
174#ifdef HAS_PROTO_MESSAGE_DUMP
176 switch (value) {
178 return "SERVICE_ARG_TYPE_BOOL";
180 return "SERVICE_ARG_TYPE_INT";
182 return "SERVICE_ARG_TYPE_FLOAT";
184 return "SERVICE_ARG_TYPE_STRING";
186 return "SERVICE_ARG_TYPE_BOOL_ARRAY";
188 return "SERVICE_ARG_TYPE_INT_ARRAY";
190 return "SERVICE_ARG_TYPE_FLOAT_ARRAY";
192 return "SERVICE_ARG_TYPE_STRING_ARRAY";
193 default:
194 return "UNKNOWN";
195 }
196}
197#endif
198#ifdef HAS_PROTO_MESSAGE_DUMP
200 switch (value) {
202 return "CLIMATE_MODE_OFF";
204 return "CLIMATE_MODE_HEAT_COOL";
206 return "CLIMATE_MODE_COOL";
208 return "CLIMATE_MODE_HEAT";
210 return "CLIMATE_MODE_FAN_ONLY";
212 return "CLIMATE_MODE_DRY";
214 return "CLIMATE_MODE_AUTO";
215 default:
216 return "UNKNOWN";
217 }
218}
219#endif
220#ifdef HAS_PROTO_MESSAGE_DUMP
222 switch (value) {
224 return "CLIMATE_FAN_ON";
226 return "CLIMATE_FAN_OFF";
228 return "CLIMATE_FAN_AUTO";
230 return "CLIMATE_FAN_LOW";
232 return "CLIMATE_FAN_MEDIUM";
234 return "CLIMATE_FAN_HIGH";
236 return "CLIMATE_FAN_MIDDLE";
238 return "CLIMATE_FAN_FOCUS";
240 return "CLIMATE_FAN_DIFFUSE";
242 return "CLIMATE_FAN_QUIET";
243 default:
244 return "UNKNOWN";
245 }
246}
247#endif
248#ifdef HAS_PROTO_MESSAGE_DUMP
250 switch (value) {
252 return "CLIMATE_SWING_OFF";
254 return "CLIMATE_SWING_BOTH";
256 return "CLIMATE_SWING_VERTICAL";
258 return "CLIMATE_SWING_HORIZONTAL";
259 default:
260 return "UNKNOWN";
261 }
262}
263#endif
264#ifdef HAS_PROTO_MESSAGE_DUMP
266 switch (value) {
268 return "CLIMATE_ACTION_OFF";
270 return "CLIMATE_ACTION_COOLING";
272 return "CLIMATE_ACTION_HEATING";
274 return "CLIMATE_ACTION_IDLE";
276 return "CLIMATE_ACTION_DRYING";
278 return "CLIMATE_ACTION_FAN";
279 default:
280 return "UNKNOWN";
281 }
282}
283#endif
284#ifdef HAS_PROTO_MESSAGE_DUMP
286 switch (value) {
288 return "CLIMATE_PRESET_NONE";
290 return "CLIMATE_PRESET_HOME";
292 return "CLIMATE_PRESET_AWAY";
294 return "CLIMATE_PRESET_BOOST";
296 return "CLIMATE_PRESET_COMFORT";
298 return "CLIMATE_PRESET_ECO";
300 return "CLIMATE_PRESET_SLEEP";
302 return "CLIMATE_PRESET_ACTIVITY";
303 default:
304 return "UNKNOWN";
305 }
306}
307#endif
308#ifdef HAS_PROTO_MESSAGE_DUMP
310 switch (value) {
312 return "NUMBER_MODE_AUTO";
314 return "NUMBER_MODE_BOX";
316 return "NUMBER_MODE_SLIDER";
317 default:
318 return "UNKNOWN";
319 }
320}
321#endif
322#ifdef HAS_PROTO_MESSAGE_DUMP
324 switch (value) {
326 return "LOCK_STATE_NONE";
328 return "LOCK_STATE_LOCKED";
330 return "LOCK_STATE_UNLOCKED";
332 return "LOCK_STATE_JAMMED";
334 return "LOCK_STATE_LOCKING";
336 return "LOCK_STATE_UNLOCKING";
337 default:
338 return "UNKNOWN";
339 }
340}
341#endif
342#ifdef HAS_PROTO_MESSAGE_DUMP
344 switch (value) {
346 return "LOCK_UNLOCK";
347 case enums::LOCK_LOCK:
348 return "LOCK_LOCK";
349 case enums::LOCK_OPEN:
350 return "LOCK_OPEN";
351 default:
352 return "UNKNOWN";
353 }
354}
355#endif
356#ifdef HAS_PROTO_MESSAGE_DUMP
358 switch (value) {
360 return "MEDIA_PLAYER_STATE_NONE";
362 return "MEDIA_PLAYER_STATE_IDLE";
364 return "MEDIA_PLAYER_STATE_PLAYING";
366 return "MEDIA_PLAYER_STATE_PAUSED";
367 default:
368 return "UNKNOWN";
369 }
370}
371#endif
372#ifdef HAS_PROTO_MESSAGE_DUMP
374 switch (value) {
376 return "MEDIA_PLAYER_COMMAND_PLAY";
378 return "MEDIA_PLAYER_COMMAND_PAUSE";
380 return "MEDIA_PLAYER_COMMAND_STOP";
382 return "MEDIA_PLAYER_COMMAND_MUTE";
384 return "MEDIA_PLAYER_COMMAND_UNMUTE";
385 default:
386 return "UNKNOWN";
387 }
388}
389#endif
390#ifdef HAS_PROTO_MESSAGE_DUMP
392 switch (value) {
394 return "MEDIA_PLAYER_FORMAT_PURPOSE_DEFAULT";
396 return "MEDIA_PLAYER_FORMAT_PURPOSE_ANNOUNCEMENT";
397 default:
398 return "UNKNOWN";
399 }
400}
401#endif
402#ifdef HAS_PROTO_MESSAGE_DUMP
403template<>
405 switch (value) {
407 return "BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT";
409 return "BLUETOOTH_DEVICE_REQUEST_TYPE_DISCONNECT";
411 return "BLUETOOTH_DEVICE_REQUEST_TYPE_PAIR";
413 return "BLUETOOTH_DEVICE_REQUEST_TYPE_UNPAIR";
415 return "BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT_V3_WITH_CACHE";
417 return "BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT_V3_WITHOUT_CACHE";
419 return "BLUETOOTH_DEVICE_REQUEST_TYPE_CLEAR_CACHE";
420 default:
421 return "UNKNOWN";
422 }
423}
424#endif
425#ifdef HAS_PROTO_MESSAGE_DUMP
427 switch (value) {
429 return "BLUETOOTH_SCANNER_STATE_IDLE";
431 return "BLUETOOTH_SCANNER_STATE_STARTING";
433 return "BLUETOOTH_SCANNER_STATE_RUNNING";
435 return "BLUETOOTH_SCANNER_STATE_FAILED";
437 return "BLUETOOTH_SCANNER_STATE_STOPPING";
439 return "BLUETOOTH_SCANNER_STATE_STOPPED";
440 default:
441 return "UNKNOWN";
442 }
443}
444#endif
445#ifdef HAS_PROTO_MESSAGE_DUMP
447 switch (value) {
449 return "BLUETOOTH_SCANNER_MODE_PASSIVE";
451 return "BLUETOOTH_SCANNER_MODE_ACTIVE";
452 default:
453 return "UNKNOWN";
454 }
455}
456#endif
457#ifdef HAS_PROTO_MESSAGE_DUMP
458template<>
460 switch (value) {
462 return "VOICE_ASSISTANT_SUBSCRIBE_NONE";
464 return "VOICE_ASSISTANT_SUBSCRIBE_API_AUDIO";
465 default:
466 return "UNKNOWN";
467 }
468}
469#endif
470#ifdef HAS_PROTO_MESSAGE_DUMP
472 switch (value) {
474 return "VOICE_ASSISTANT_REQUEST_NONE";
476 return "VOICE_ASSISTANT_REQUEST_USE_VAD";
478 return "VOICE_ASSISTANT_REQUEST_USE_WAKE_WORD";
479 default:
480 return "UNKNOWN";
481 }
482}
483#endif
484#ifdef HAS_PROTO_MESSAGE_DUMP
486 switch (value) {
488 return "VOICE_ASSISTANT_ERROR";
490 return "VOICE_ASSISTANT_RUN_START";
492 return "VOICE_ASSISTANT_RUN_END";
494 return "VOICE_ASSISTANT_STT_START";
496 return "VOICE_ASSISTANT_STT_END";
498 return "VOICE_ASSISTANT_INTENT_START";
500 return "VOICE_ASSISTANT_INTENT_END";
502 return "VOICE_ASSISTANT_TTS_START";
504 return "VOICE_ASSISTANT_TTS_END";
506 return "VOICE_ASSISTANT_WAKE_WORD_START";
508 return "VOICE_ASSISTANT_WAKE_WORD_END";
510 return "VOICE_ASSISTANT_STT_VAD_START";
512 return "VOICE_ASSISTANT_STT_VAD_END";
514 return "VOICE_ASSISTANT_TTS_STREAM_START";
516 return "VOICE_ASSISTANT_TTS_STREAM_END";
517 default:
518 return "UNKNOWN";
519 }
520}
521#endif
522#ifdef HAS_PROTO_MESSAGE_DUMP
524 switch (value) {
526 return "VOICE_ASSISTANT_TIMER_STARTED";
528 return "VOICE_ASSISTANT_TIMER_UPDATED";
530 return "VOICE_ASSISTANT_TIMER_CANCELLED";
532 return "VOICE_ASSISTANT_TIMER_FINISHED";
533 default:
534 return "UNKNOWN";
535 }
536}
537#endif
538#ifdef HAS_PROTO_MESSAGE_DUMP
540 switch (value) {
542 return "ALARM_STATE_DISARMED";
544 return "ALARM_STATE_ARMED_HOME";
546 return "ALARM_STATE_ARMED_AWAY";
548 return "ALARM_STATE_ARMED_NIGHT";
550 return "ALARM_STATE_ARMED_VACATION";
552 return "ALARM_STATE_ARMED_CUSTOM_BYPASS";
554 return "ALARM_STATE_PENDING";
556 return "ALARM_STATE_ARMING";
558 return "ALARM_STATE_DISARMING";
560 return "ALARM_STATE_TRIGGERED";
561 default:
562 return "UNKNOWN";
563 }
564}
565#endif
566#ifdef HAS_PROTO_MESSAGE_DUMP
567template<>
569 switch (value) {
571 return "ALARM_CONTROL_PANEL_DISARM";
573 return "ALARM_CONTROL_PANEL_ARM_AWAY";
575 return "ALARM_CONTROL_PANEL_ARM_HOME";
577 return "ALARM_CONTROL_PANEL_ARM_NIGHT";
579 return "ALARM_CONTROL_PANEL_ARM_VACATION";
581 return "ALARM_CONTROL_PANEL_ARM_CUSTOM_BYPASS";
583 return "ALARM_CONTROL_PANEL_TRIGGER";
584 default:
585 return "UNKNOWN";
586 }
587}
588#endif
589#ifdef HAS_PROTO_MESSAGE_DUMP
591 switch (value) {
593 return "TEXT_MODE_TEXT";
595 return "TEXT_MODE_PASSWORD";
596 default:
597 return "UNKNOWN";
598 }
599}
600#endif
601#ifdef HAS_PROTO_MESSAGE_DUMP
603 switch (value) {
605 return "VALVE_OPERATION_IDLE";
607 return "VALVE_OPERATION_IS_OPENING";
609 return "VALVE_OPERATION_IS_CLOSING";
610 default:
611 return "UNKNOWN";
612 }
613}
614#endif
615#ifdef HAS_PROTO_MESSAGE_DUMP
617 switch (value) {
619 return "UPDATE_COMMAND_NONE";
621 return "UPDATE_COMMAND_UPDATE";
623 return "UPDATE_COMMAND_CHECK";
624 default:
625 return "UNKNOWN";
626 }
627}
628#endif
629bool HelloRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
630 switch (field_id) {
631 case 2: {
632 this->api_version_major = value.as_uint32();
633 return true;
634 }
635 case 3: {
636 this->api_version_minor = value.as_uint32();
637 return true;
638 }
639 default:
640 return false;
641 }
642}
643bool HelloRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
644 switch (field_id) {
645 case 1: {
646 this->client_info = value.as_string();
647 return true;
648 }
649 default:
650 return false;
651 }
652}
654 buffer.encode_string(1, this->client_info);
655 buffer.encode_uint32(2, this->api_version_major);
656 buffer.encode_uint32(3, this->api_version_minor);
657}
658void HelloRequest::calculate_size(uint32_t &total_size) const {
659 ProtoSize::add_string_field(total_size, 1, this->client_info, false);
660 ProtoSize::add_uint32_field(total_size, 1, this->api_version_major, false);
661 ProtoSize::add_uint32_field(total_size, 1, this->api_version_minor, false);
662}
663#ifdef HAS_PROTO_MESSAGE_DUMP
664void HelloRequest::dump_to(std::string &out) const {
665 __attribute__((unused)) char buffer[64];
666 out.append("HelloRequest {\n");
667 out.append(" client_info: ");
668 out.append("'").append(this->client_info).append("'");
669 out.append("\n");
670
671 out.append(" api_version_major: ");
672 sprintf(buffer, "%" PRIu32, this->api_version_major);
673 out.append(buffer);
674 out.append("\n");
675
676 out.append(" api_version_minor: ");
677 sprintf(buffer, "%" PRIu32, this->api_version_minor);
678 out.append(buffer);
679 out.append("\n");
680 out.append("}");
681}
682#endif
683bool HelloResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
684 switch (field_id) {
685 case 1: {
686 this->api_version_major = value.as_uint32();
687 return true;
688 }
689 case 2: {
690 this->api_version_minor = value.as_uint32();
691 return true;
692 }
693 default:
694 return false;
695 }
696}
698 switch (field_id) {
699 case 3: {
700 this->server_info = value.as_string();
701 return true;
702 }
703 case 4: {
704 this->name = value.as_string();
705 return true;
706 }
707 default:
708 return false;
709 }
710}
712 buffer.encode_uint32(1, this->api_version_major);
713 buffer.encode_uint32(2, this->api_version_minor);
714 buffer.encode_string(3, this->server_info);
715 buffer.encode_string(4, this->name);
716}
717void HelloResponse::calculate_size(uint32_t &total_size) const {
718 ProtoSize::add_uint32_field(total_size, 1, this->api_version_major, false);
719 ProtoSize::add_uint32_field(total_size, 1, this->api_version_minor, false);
720 ProtoSize::add_string_field(total_size, 1, this->server_info, false);
721 ProtoSize::add_string_field(total_size, 1, this->name, false);
722}
723#ifdef HAS_PROTO_MESSAGE_DUMP
724void HelloResponse::dump_to(std::string &out) const {
725 __attribute__((unused)) char buffer[64];
726 out.append("HelloResponse {\n");
727 out.append(" api_version_major: ");
728 sprintf(buffer, "%" PRIu32, this->api_version_major);
729 out.append(buffer);
730 out.append("\n");
731
732 out.append(" api_version_minor: ");
733 sprintf(buffer, "%" PRIu32, this->api_version_minor);
734 out.append(buffer);
735 out.append("\n");
736
737 out.append(" server_info: ");
738 out.append("'").append(this->server_info).append("'");
739 out.append("\n");
740
741 out.append(" name: ");
742 out.append("'").append(this->name).append("'");
743 out.append("\n");
744 out.append("}");
745}
746#endif
748 switch (field_id) {
749 case 1: {
750 this->password = value.as_string();
751 return true;
752 }
753 default:
754 return false;
755 }
756}
757void ConnectRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_string(1, this->password); }
758void ConnectRequest::calculate_size(uint32_t &total_size) const {
759 ProtoSize::add_string_field(total_size, 1, this->password, false);
760}
761#ifdef HAS_PROTO_MESSAGE_DUMP
762void ConnectRequest::dump_to(std::string &out) const {
763 __attribute__((unused)) char buffer[64];
764 out.append("ConnectRequest {\n");
765 out.append(" password: ");
766 out.append("'").append(this->password).append("'");
767 out.append("\n");
768 out.append("}");
769}
770#endif
771bool ConnectResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
772 switch (field_id) {
773 case 1: {
774 this->invalid_password = value.as_bool();
775 return true;
776 }
777 default:
778 return false;
779 }
780}
782void ConnectResponse::calculate_size(uint32_t &total_size) const {
783 ProtoSize::add_bool_field(total_size, 1, this->invalid_password, false);
784}
785#ifdef HAS_PROTO_MESSAGE_DUMP
786void ConnectResponse::dump_to(std::string &out) const {
787 __attribute__((unused)) char buffer[64];
788 out.append("ConnectResponse {\n");
789 out.append(" invalid_password: ");
790 out.append(YESNO(this->invalid_password));
791 out.append("\n");
792 out.append("}");
793}
794#endif
796void DisconnectRequest::calculate_size(uint32_t &total_size) const {}
797#ifdef HAS_PROTO_MESSAGE_DUMP
798void DisconnectRequest::dump_to(std::string &out) const { out.append("DisconnectRequest {}"); }
799#endif
801void DisconnectResponse::calculate_size(uint32_t &total_size) const {}
802#ifdef HAS_PROTO_MESSAGE_DUMP
803void DisconnectResponse::dump_to(std::string &out) const { out.append("DisconnectResponse {}"); }
804#endif
806void PingRequest::calculate_size(uint32_t &total_size) const {}
807#ifdef HAS_PROTO_MESSAGE_DUMP
808void PingRequest::dump_to(std::string &out) const { out.append("PingRequest {}"); }
809#endif
811void PingResponse::calculate_size(uint32_t &total_size) const {}
812#ifdef HAS_PROTO_MESSAGE_DUMP
813void PingResponse::dump_to(std::string &out) const { out.append("PingResponse {}"); }
814#endif
816void DeviceInfoRequest::calculate_size(uint32_t &total_size) const {}
817#ifdef HAS_PROTO_MESSAGE_DUMP
818void DeviceInfoRequest::dump_to(std::string &out) const { out.append("DeviceInfoRequest {}"); }
819#endif
820bool DeviceInfoResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
821 switch (field_id) {
822 case 1: {
823 this->uses_password = value.as_bool();
824 return true;
825 }
826 case 7: {
827 this->has_deep_sleep = value.as_bool();
828 return true;
829 }
830 case 10: {
831 this->webserver_port = value.as_uint32();
832 return true;
833 }
834 case 11: {
836 return true;
837 }
838 case 15: {
840 return true;
841 }
842 case 14: {
844 return true;
845 }
846 case 17: {
848 return true;
849 }
850 case 19: {
851 this->api_encryption_supported = value.as_bool();
852 return true;
853 }
854 default:
855 return false;
856 }
857}
859 switch (field_id) {
860 case 2: {
861 this->name = value.as_string();
862 return true;
863 }
864 case 3: {
865 this->mac_address = value.as_string();
866 return true;
867 }
868 case 4: {
869 this->esphome_version = value.as_string();
870 return true;
871 }
872 case 5: {
873 this->compilation_time = value.as_string();
874 return true;
875 }
876 case 6: {
877 this->model = value.as_string();
878 return true;
879 }
880 case 8: {
881 this->project_name = value.as_string();
882 return true;
883 }
884 case 9: {
885 this->project_version = value.as_string();
886 return true;
887 }
888 case 12: {
889 this->manufacturer = value.as_string();
890 return true;
891 }
892 case 13: {
893 this->friendly_name = value.as_string();
894 return true;
895 }
896 case 16: {
897 this->suggested_area = value.as_string();
898 return true;
899 }
900 case 18: {
901 this->bluetooth_mac_address = value.as_string();
902 return true;
903 }
904 default:
905 return false;
906 }
907}
909 buffer.encode_bool(1, this->uses_password);
910 buffer.encode_string(2, this->name);
911 buffer.encode_string(3, this->mac_address);
912 buffer.encode_string(4, this->esphome_version);
913 buffer.encode_string(5, this->compilation_time);
914 buffer.encode_string(6, this->model);
915 buffer.encode_bool(7, this->has_deep_sleep);
916 buffer.encode_string(8, this->project_name);
917 buffer.encode_string(9, this->project_version);
918 buffer.encode_uint32(10, this->webserver_port);
921 buffer.encode_string(12, this->manufacturer);
922 buffer.encode_string(13, this->friendly_name);
925 buffer.encode_string(16, this->suggested_area);
926 buffer.encode_string(18, this->bluetooth_mac_address);
927 buffer.encode_bool(19, this->api_encryption_supported);
928}
929void DeviceInfoResponse::calculate_size(uint32_t &total_size) const {
930 ProtoSize::add_bool_field(total_size, 1, this->uses_password, false);
931 ProtoSize::add_string_field(total_size, 1, this->name, false);
932 ProtoSize::add_string_field(total_size, 1, this->mac_address, false);
933 ProtoSize::add_string_field(total_size, 1, this->esphome_version, false);
934 ProtoSize::add_string_field(total_size, 1, this->compilation_time, false);
935 ProtoSize::add_string_field(total_size, 1, this->model, false);
936 ProtoSize::add_bool_field(total_size, 1, this->has_deep_sleep, false);
937 ProtoSize::add_string_field(total_size, 1, this->project_name, false);
938 ProtoSize::add_string_field(total_size, 1, this->project_version, false);
939 ProtoSize::add_uint32_field(total_size, 1, this->webserver_port, false);
942 ProtoSize::add_string_field(total_size, 1, this->manufacturer, false);
943 ProtoSize::add_string_field(total_size, 1, this->friendly_name, false);
946 ProtoSize::add_string_field(total_size, 2, this->suggested_area, false);
947 ProtoSize::add_string_field(total_size, 2, this->bluetooth_mac_address, false);
948 ProtoSize::add_bool_field(total_size, 2, this->api_encryption_supported, false);
949}
950#ifdef HAS_PROTO_MESSAGE_DUMP
951void DeviceInfoResponse::dump_to(std::string &out) const {
952 __attribute__((unused)) char buffer[64];
953 out.append("DeviceInfoResponse {\n");
954 out.append(" uses_password: ");
955 out.append(YESNO(this->uses_password));
956 out.append("\n");
957
958 out.append(" name: ");
959 out.append("'").append(this->name).append("'");
960 out.append("\n");
961
962 out.append(" mac_address: ");
963 out.append("'").append(this->mac_address).append("'");
964 out.append("\n");
965
966 out.append(" esphome_version: ");
967 out.append("'").append(this->esphome_version).append("'");
968 out.append("\n");
969
970 out.append(" compilation_time: ");
971 out.append("'").append(this->compilation_time).append("'");
972 out.append("\n");
973
974 out.append(" model: ");
975 out.append("'").append(this->model).append("'");
976 out.append("\n");
977
978 out.append(" has_deep_sleep: ");
979 out.append(YESNO(this->has_deep_sleep));
980 out.append("\n");
981
982 out.append(" project_name: ");
983 out.append("'").append(this->project_name).append("'");
984 out.append("\n");
985
986 out.append(" project_version: ");
987 out.append("'").append(this->project_version).append("'");
988 out.append("\n");
989
990 out.append(" webserver_port: ");
991 sprintf(buffer, "%" PRIu32, this->webserver_port);
992 out.append(buffer);
993 out.append("\n");
994
995 out.append(" legacy_bluetooth_proxy_version: ");
996 sprintf(buffer, "%" PRIu32, this->legacy_bluetooth_proxy_version);
997 out.append(buffer);
998 out.append("\n");
999
1000 out.append(" bluetooth_proxy_feature_flags: ");
1001 sprintf(buffer, "%" PRIu32, this->bluetooth_proxy_feature_flags);
1002 out.append(buffer);
1003 out.append("\n");
1004
1005 out.append(" manufacturer: ");
1006 out.append("'").append(this->manufacturer).append("'");
1007 out.append("\n");
1008
1009 out.append(" friendly_name: ");
1010 out.append("'").append(this->friendly_name).append("'");
1011 out.append("\n");
1012
1013 out.append(" legacy_voice_assistant_version: ");
1014 sprintf(buffer, "%" PRIu32, this->legacy_voice_assistant_version);
1015 out.append(buffer);
1016 out.append("\n");
1017
1018 out.append(" voice_assistant_feature_flags: ");
1019 sprintf(buffer, "%" PRIu32, this->voice_assistant_feature_flags);
1020 out.append(buffer);
1021 out.append("\n");
1022
1023 out.append(" suggested_area: ");
1024 out.append("'").append(this->suggested_area).append("'");
1025 out.append("\n");
1026
1027 out.append(" bluetooth_mac_address: ");
1028 out.append("'").append(this->bluetooth_mac_address).append("'");
1029 out.append("\n");
1030
1031 out.append(" api_encryption_supported: ");
1032 out.append(YESNO(this->api_encryption_supported));
1033 out.append("\n");
1034 out.append("}");
1035}
1036#endif
1038void ListEntitiesRequest::calculate_size(uint32_t &total_size) const {}
1039#ifdef HAS_PROTO_MESSAGE_DUMP
1040void ListEntitiesRequest::dump_to(std::string &out) const { out.append("ListEntitiesRequest {}"); }
1041#endif
1043void ListEntitiesDoneResponse::calculate_size(uint32_t &total_size) const {}
1044#ifdef HAS_PROTO_MESSAGE_DUMP
1045void ListEntitiesDoneResponse::dump_to(std::string &out) const { out.append("ListEntitiesDoneResponse {}"); }
1046#endif
1048void SubscribeStatesRequest::calculate_size(uint32_t &total_size) const {}
1049#ifdef HAS_PROTO_MESSAGE_DUMP
1050void SubscribeStatesRequest::dump_to(std::string &out) const { out.append("SubscribeStatesRequest {}"); }
1051#endif
1053 switch (field_id) {
1054 case 6: {
1055 this->is_status_binary_sensor = value.as_bool();
1056 return true;
1057 }
1058 case 7: {
1059 this->disabled_by_default = value.as_bool();
1060 return true;
1061 }
1062 case 9: {
1064 return true;
1065 }
1066 default:
1067 return false;
1068 }
1069}
1071 switch (field_id) {
1072 case 1: {
1073 this->object_id = value.as_string();
1074 return true;
1075 }
1076 case 3: {
1077 this->name = value.as_string();
1078 return true;
1079 }
1080 case 4: {
1081 this->unique_id = value.as_string();
1082 return true;
1083 }
1084 case 5: {
1085 this->device_class = value.as_string();
1086 return true;
1087 }
1088 case 8: {
1089 this->icon = value.as_string();
1090 return true;
1091 }
1092 default:
1093 return false;
1094 }
1095}
1097 switch (field_id) {
1098 case 2: {
1099 this->key = value.as_fixed32();
1100 return true;
1101 }
1102 default:
1103 return false;
1104 }
1105}
1107 buffer.encode_string(1, this->object_id);
1108 buffer.encode_fixed32(2, this->key);
1109 buffer.encode_string(3, this->name);
1110 buffer.encode_string(4, this->unique_id);
1111 buffer.encode_string(5, this->device_class);
1112 buffer.encode_bool(6, this->is_status_binary_sensor);
1113 buffer.encode_bool(7, this->disabled_by_default);
1114 buffer.encode_string(8, this->icon);
1116}
1118 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
1119 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1120 ProtoSize::add_string_field(total_size, 1, this->name, false);
1121 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
1122 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
1123 ProtoSize::add_bool_field(total_size, 1, this->is_status_binary_sensor, false);
1124 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
1125 ProtoSize::add_string_field(total_size, 1, this->icon, false);
1126 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
1127}
1128#ifdef HAS_PROTO_MESSAGE_DUMP
1129void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const {
1130 __attribute__((unused)) char buffer[64];
1131 out.append("ListEntitiesBinarySensorResponse {\n");
1132 out.append(" object_id: ");
1133 out.append("'").append(this->object_id).append("'");
1134 out.append("\n");
1135
1136 out.append(" key: ");
1137 sprintf(buffer, "%" PRIu32, this->key);
1138 out.append(buffer);
1139 out.append("\n");
1140
1141 out.append(" name: ");
1142 out.append("'").append(this->name).append("'");
1143 out.append("\n");
1144
1145 out.append(" unique_id: ");
1146 out.append("'").append(this->unique_id).append("'");
1147 out.append("\n");
1148
1149 out.append(" device_class: ");
1150 out.append("'").append(this->device_class).append("'");
1151 out.append("\n");
1152
1153 out.append(" is_status_binary_sensor: ");
1154 out.append(YESNO(this->is_status_binary_sensor));
1155 out.append("\n");
1156
1157 out.append(" disabled_by_default: ");
1158 out.append(YESNO(this->disabled_by_default));
1159 out.append("\n");
1160
1161 out.append(" icon: ");
1162 out.append("'").append(this->icon).append("'");
1163 out.append("\n");
1164
1165 out.append(" entity_category: ");
1167 out.append("\n");
1168 out.append("}");
1169}
1170#endif
1172 switch (field_id) {
1173 case 2: {
1174 this->state = value.as_bool();
1175 return true;
1176 }
1177 case 3: {
1178 this->missing_state = value.as_bool();
1179 return true;
1180 }
1181 default:
1182 return false;
1183 }
1184}
1186 switch (field_id) {
1187 case 1: {
1188 this->key = value.as_fixed32();
1189 return true;
1190 }
1191 default:
1192 return false;
1193 }
1194}
1196 buffer.encode_fixed32(1, this->key);
1197 buffer.encode_bool(2, this->state);
1198 buffer.encode_bool(3, this->missing_state);
1199}
1200void BinarySensorStateResponse::calculate_size(uint32_t &total_size) const {
1201 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1202 ProtoSize::add_bool_field(total_size, 1, this->state, false);
1203 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
1204}
1205#ifdef HAS_PROTO_MESSAGE_DUMP
1206void BinarySensorStateResponse::dump_to(std::string &out) const {
1207 __attribute__((unused)) char buffer[64];
1208 out.append("BinarySensorStateResponse {\n");
1209 out.append(" key: ");
1210 sprintf(buffer, "%" PRIu32, this->key);
1211 out.append(buffer);
1212 out.append("\n");
1213
1214 out.append(" state: ");
1215 out.append(YESNO(this->state));
1216 out.append("\n");
1217
1218 out.append(" missing_state: ");
1219 out.append(YESNO(this->missing_state));
1220 out.append("\n");
1221 out.append("}");
1222}
1223#endif
1225 switch (field_id) {
1226 case 5: {
1227 this->assumed_state = value.as_bool();
1228 return true;
1229 }
1230 case 6: {
1231 this->supports_position = value.as_bool();
1232 return true;
1233 }
1234 case 7: {
1235 this->supports_tilt = value.as_bool();
1236 return true;
1237 }
1238 case 9: {
1239 this->disabled_by_default = value.as_bool();
1240 return true;
1241 }
1242 case 11: {
1244 return true;
1245 }
1246 case 12: {
1247 this->supports_stop = value.as_bool();
1248 return true;
1249 }
1250 default:
1251 return false;
1252 }
1253}
1255 switch (field_id) {
1256 case 1: {
1257 this->object_id = value.as_string();
1258 return true;
1259 }
1260 case 3: {
1261 this->name = value.as_string();
1262 return true;
1263 }
1264 case 4: {
1265 this->unique_id = value.as_string();
1266 return true;
1267 }
1268 case 8: {
1269 this->device_class = value.as_string();
1270 return true;
1271 }
1272 case 10: {
1273 this->icon = value.as_string();
1274 return true;
1275 }
1276 default:
1277 return false;
1278 }
1279}
1281 switch (field_id) {
1282 case 2: {
1283 this->key = value.as_fixed32();
1284 return true;
1285 }
1286 default:
1287 return false;
1288 }
1289}
1291 buffer.encode_string(1, this->object_id);
1292 buffer.encode_fixed32(2, this->key);
1293 buffer.encode_string(3, this->name);
1294 buffer.encode_string(4, this->unique_id);
1295 buffer.encode_bool(5, this->assumed_state);
1296 buffer.encode_bool(6, this->supports_position);
1297 buffer.encode_bool(7, this->supports_tilt);
1298 buffer.encode_string(8, this->device_class);
1299 buffer.encode_bool(9, this->disabled_by_default);
1300 buffer.encode_string(10, this->icon);
1302 buffer.encode_bool(12, this->supports_stop);
1303}
1304void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const {
1305 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
1306 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1307 ProtoSize::add_string_field(total_size, 1, this->name, false);
1308 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
1309 ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false);
1310 ProtoSize::add_bool_field(total_size, 1, this->supports_position, false);
1311 ProtoSize::add_bool_field(total_size, 1, this->supports_tilt, false);
1312 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
1313 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
1314 ProtoSize::add_string_field(total_size, 1, this->icon, false);
1315 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
1316 ProtoSize::add_bool_field(total_size, 1, this->supports_stop, false);
1317}
1318#ifdef HAS_PROTO_MESSAGE_DUMP
1319void ListEntitiesCoverResponse::dump_to(std::string &out) const {
1320 __attribute__((unused)) char buffer[64];
1321 out.append("ListEntitiesCoverResponse {\n");
1322 out.append(" object_id: ");
1323 out.append("'").append(this->object_id).append("'");
1324 out.append("\n");
1325
1326 out.append(" key: ");
1327 sprintf(buffer, "%" PRIu32, this->key);
1328 out.append(buffer);
1329 out.append("\n");
1330
1331 out.append(" name: ");
1332 out.append("'").append(this->name).append("'");
1333 out.append("\n");
1334
1335 out.append(" unique_id: ");
1336 out.append("'").append(this->unique_id).append("'");
1337 out.append("\n");
1338
1339 out.append(" assumed_state: ");
1340 out.append(YESNO(this->assumed_state));
1341 out.append("\n");
1342
1343 out.append(" supports_position: ");
1344 out.append(YESNO(this->supports_position));
1345 out.append("\n");
1346
1347 out.append(" supports_tilt: ");
1348 out.append(YESNO(this->supports_tilt));
1349 out.append("\n");
1350
1351 out.append(" device_class: ");
1352 out.append("'").append(this->device_class).append("'");
1353 out.append("\n");
1354
1355 out.append(" disabled_by_default: ");
1356 out.append(YESNO(this->disabled_by_default));
1357 out.append("\n");
1358
1359 out.append(" icon: ");
1360 out.append("'").append(this->icon).append("'");
1361 out.append("\n");
1362
1363 out.append(" entity_category: ");
1365 out.append("\n");
1366
1367 out.append(" supports_stop: ");
1368 out.append(YESNO(this->supports_stop));
1369 out.append("\n");
1370 out.append("}");
1371}
1372#endif
1373bool CoverStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
1374 switch (field_id) {
1375 case 2: {
1377 return true;
1378 }
1379 case 5: {
1381 return true;
1382 }
1383 default:
1384 return false;
1385 }
1386}
1387bool CoverStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
1388 switch (field_id) {
1389 case 1: {
1390 this->key = value.as_fixed32();
1391 return true;
1392 }
1393 case 3: {
1394 this->position = value.as_float();
1395 return true;
1396 }
1397 case 4: {
1398 this->tilt = value.as_float();
1399 return true;
1400 }
1401 default:
1402 return false;
1403 }
1404}
1406 buffer.encode_fixed32(1, this->key);
1408 buffer.encode_float(3, this->position);
1409 buffer.encode_float(4, this->tilt);
1411}
1412void CoverStateResponse::calculate_size(uint32_t &total_size) const {
1413 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1414 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_state), false);
1415 ProtoSize::add_fixed_field<4>(total_size, 1, this->position != 0.0f, false);
1416 ProtoSize::add_fixed_field<4>(total_size, 1, this->tilt != 0.0f, false);
1417 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation), false);
1418}
1419#ifdef HAS_PROTO_MESSAGE_DUMP
1420void CoverStateResponse::dump_to(std::string &out) const {
1421 __attribute__((unused)) char buffer[64];
1422 out.append("CoverStateResponse {\n");
1423 out.append(" key: ");
1424 sprintf(buffer, "%" PRIu32, this->key);
1425 out.append(buffer);
1426 out.append("\n");
1427
1428 out.append(" legacy_state: ");
1430 out.append("\n");
1431
1432 out.append(" position: ");
1433 sprintf(buffer, "%g", this->position);
1434 out.append(buffer);
1435 out.append("\n");
1436
1437 out.append(" tilt: ");
1438 sprintf(buffer, "%g", this->tilt);
1439 out.append(buffer);
1440 out.append("\n");
1441
1442 out.append(" current_operation: ");
1444 out.append("\n");
1445 out.append("}");
1446}
1447#endif
1448bool CoverCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1449 switch (field_id) {
1450 case 2: {
1451 this->has_legacy_command = value.as_bool();
1452 return true;
1453 }
1454 case 3: {
1456 return true;
1457 }
1458 case 4: {
1459 this->has_position = value.as_bool();
1460 return true;
1461 }
1462 case 6: {
1463 this->has_tilt = value.as_bool();
1464 return true;
1465 }
1466 case 8: {
1467 this->stop = value.as_bool();
1468 return true;
1469 }
1470 default:
1471 return false;
1472 }
1473}
1474bool CoverCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1475 switch (field_id) {
1476 case 1: {
1477 this->key = value.as_fixed32();
1478 return true;
1479 }
1480 case 5: {
1481 this->position = value.as_float();
1482 return true;
1483 }
1484 case 7: {
1485 this->tilt = value.as_float();
1486 return true;
1487 }
1488 default:
1489 return false;
1490 }
1491}
1493 buffer.encode_fixed32(1, this->key);
1494 buffer.encode_bool(2, this->has_legacy_command);
1496 buffer.encode_bool(4, this->has_position);
1497 buffer.encode_float(5, this->position);
1498 buffer.encode_bool(6, this->has_tilt);
1499 buffer.encode_float(7, this->tilt);
1500 buffer.encode_bool(8, this->stop);
1501}
1502void CoverCommandRequest::calculate_size(uint32_t &total_size) const {
1503 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1504 ProtoSize::add_bool_field(total_size, 1, this->has_legacy_command, false);
1505 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_command), false);
1506 ProtoSize::add_bool_field(total_size, 1, this->has_position, false);
1507 ProtoSize::add_fixed_field<4>(total_size, 1, this->position != 0.0f, false);
1508 ProtoSize::add_bool_field(total_size, 1, this->has_tilt, false);
1509 ProtoSize::add_fixed_field<4>(total_size, 1, this->tilt != 0.0f, false);
1510 ProtoSize::add_bool_field(total_size, 1, this->stop, false);
1511}
1512#ifdef HAS_PROTO_MESSAGE_DUMP
1513void CoverCommandRequest::dump_to(std::string &out) const {
1514 __attribute__((unused)) char buffer[64];
1515 out.append("CoverCommandRequest {\n");
1516 out.append(" key: ");
1517 sprintf(buffer, "%" PRIu32, this->key);
1518 out.append(buffer);
1519 out.append("\n");
1520
1521 out.append(" has_legacy_command: ");
1522 out.append(YESNO(this->has_legacy_command));
1523 out.append("\n");
1524
1525 out.append(" legacy_command: ");
1527 out.append("\n");
1528
1529 out.append(" has_position: ");
1530 out.append(YESNO(this->has_position));
1531 out.append("\n");
1532
1533 out.append(" position: ");
1534 sprintf(buffer, "%g", this->position);
1535 out.append(buffer);
1536 out.append("\n");
1537
1538 out.append(" has_tilt: ");
1539 out.append(YESNO(this->has_tilt));
1540 out.append("\n");
1541
1542 out.append(" tilt: ");
1543 sprintf(buffer, "%g", this->tilt);
1544 out.append(buffer);
1545 out.append("\n");
1546
1547 out.append(" stop: ");
1548 out.append(YESNO(this->stop));
1549 out.append("\n");
1550 out.append("}");
1551}
1552#endif
1554 switch (field_id) {
1555 case 5: {
1556 this->supports_oscillation = value.as_bool();
1557 return true;
1558 }
1559 case 6: {
1560 this->supports_speed = value.as_bool();
1561 return true;
1562 }
1563 case 7: {
1564 this->supports_direction = value.as_bool();
1565 return true;
1566 }
1567 case 8: {
1568 this->supported_speed_count = value.as_int32();
1569 return true;
1570 }
1571 case 9: {
1572 this->disabled_by_default = value.as_bool();
1573 return true;
1574 }
1575 case 11: {
1577 return true;
1578 }
1579 default:
1580 return false;
1581 }
1582}
1584 switch (field_id) {
1585 case 1: {
1586 this->object_id = value.as_string();
1587 return true;
1588 }
1589 case 3: {
1590 this->name = value.as_string();
1591 return true;
1592 }
1593 case 4: {
1594 this->unique_id = value.as_string();
1595 return true;
1596 }
1597 case 10: {
1598 this->icon = value.as_string();
1599 return true;
1600 }
1601 case 12: {
1602 this->supported_preset_modes.push_back(value.as_string());
1603 return true;
1604 }
1605 default:
1606 return false;
1607 }
1608}
1610 switch (field_id) {
1611 case 2: {
1612 this->key = value.as_fixed32();
1613 return true;
1614 }
1615 default:
1616 return false;
1617 }
1618}
1620 buffer.encode_string(1, this->object_id);
1621 buffer.encode_fixed32(2, this->key);
1622 buffer.encode_string(3, this->name);
1623 buffer.encode_string(4, this->unique_id);
1624 buffer.encode_bool(5, this->supports_oscillation);
1625 buffer.encode_bool(6, this->supports_speed);
1626 buffer.encode_bool(7, this->supports_direction);
1627 buffer.encode_int32(8, this->supported_speed_count);
1628 buffer.encode_bool(9, this->disabled_by_default);
1629 buffer.encode_string(10, this->icon);
1631 for (auto &it : this->supported_preset_modes) {
1632 buffer.encode_string(12, it, true);
1633 }
1634}
1635void ListEntitiesFanResponse::calculate_size(uint32_t &total_size) const {
1636 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
1637 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1638 ProtoSize::add_string_field(total_size, 1, this->name, false);
1639 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
1640 ProtoSize::add_bool_field(total_size, 1, this->supports_oscillation, false);
1641 ProtoSize::add_bool_field(total_size, 1, this->supports_speed, false);
1642 ProtoSize::add_bool_field(total_size, 1, this->supports_direction, false);
1643 ProtoSize::add_int32_field(total_size, 1, this->supported_speed_count, false);
1644 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
1645 ProtoSize::add_string_field(total_size, 1, this->icon, false);
1646 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
1647 if (!this->supported_preset_modes.empty()) {
1648 for (const auto &it : this->supported_preset_modes) {
1649 ProtoSize::add_string_field(total_size, 1, it, true);
1650 }
1651 }
1652}
1653#ifdef HAS_PROTO_MESSAGE_DUMP
1654void ListEntitiesFanResponse::dump_to(std::string &out) const {
1655 __attribute__((unused)) char buffer[64];
1656 out.append("ListEntitiesFanResponse {\n");
1657 out.append(" object_id: ");
1658 out.append("'").append(this->object_id).append("'");
1659 out.append("\n");
1660
1661 out.append(" key: ");
1662 sprintf(buffer, "%" PRIu32, this->key);
1663 out.append(buffer);
1664 out.append("\n");
1665
1666 out.append(" name: ");
1667 out.append("'").append(this->name).append("'");
1668 out.append("\n");
1669
1670 out.append(" unique_id: ");
1671 out.append("'").append(this->unique_id).append("'");
1672 out.append("\n");
1673
1674 out.append(" supports_oscillation: ");
1675 out.append(YESNO(this->supports_oscillation));
1676 out.append("\n");
1677
1678 out.append(" supports_speed: ");
1679 out.append(YESNO(this->supports_speed));
1680 out.append("\n");
1681
1682 out.append(" supports_direction: ");
1683 out.append(YESNO(this->supports_direction));
1684 out.append("\n");
1685
1686 out.append(" supported_speed_count: ");
1687 sprintf(buffer, "%" PRId32, this->supported_speed_count);
1688 out.append(buffer);
1689 out.append("\n");
1690
1691 out.append(" disabled_by_default: ");
1692 out.append(YESNO(this->disabled_by_default));
1693 out.append("\n");
1694
1695 out.append(" icon: ");
1696 out.append("'").append(this->icon).append("'");
1697 out.append("\n");
1698
1699 out.append(" entity_category: ");
1701 out.append("\n");
1702
1703 for (const auto &it : this->supported_preset_modes) {
1704 out.append(" supported_preset_modes: ");
1705 out.append("'").append(it).append("'");
1706 out.append("\n");
1707 }
1708 out.append("}");
1709}
1710#endif
1711bool FanStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
1712 switch (field_id) {
1713 case 2: {
1714 this->state = value.as_bool();
1715 return true;
1716 }
1717 case 3: {
1718 this->oscillating = value.as_bool();
1719 return true;
1720 }
1721 case 4: {
1722 this->speed = value.as_enum<enums::FanSpeed>();
1723 return true;
1724 }
1725 case 5: {
1726 this->direction = value.as_enum<enums::FanDirection>();
1727 return true;
1728 }
1729 case 6: {
1730 this->speed_level = value.as_int32();
1731 return true;
1732 }
1733 default:
1734 return false;
1735 }
1736}
1738 switch (field_id) {
1739 case 7: {
1740 this->preset_mode = value.as_string();
1741 return true;
1742 }
1743 default:
1744 return false;
1745 }
1746}
1747bool FanStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
1748 switch (field_id) {
1749 case 1: {
1750 this->key = value.as_fixed32();
1751 return true;
1752 }
1753 default:
1754 return false;
1755 }
1756}
1758 buffer.encode_fixed32(1, this->key);
1759 buffer.encode_bool(2, this->state);
1760 buffer.encode_bool(3, this->oscillating);
1761 buffer.encode_enum<enums::FanSpeed>(4, this->speed);
1762 buffer.encode_enum<enums::FanDirection>(5, this->direction);
1763 buffer.encode_int32(6, this->speed_level);
1764 buffer.encode_string(7, this->preset_mode);
1765}
1766void FanStateResponse::calculate_size(uint32_t &total_size) const {
1767 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1768 ProtoSize::add_bool_field(total_size, 1, this->state, false);
1769 ProtoSize::add_bool_field(total_size, 1, this->oscillating, false);
1770 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->speed), false);
1771 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->direction), false);
1772 ProtoSize::add_int32_field(total_size, 1, this->speed_level, false);
1773 ProtoSize::add_string_field(total_size, 1, this->preset_mode, false);
1774}
1775#ifdef HAS_PROTO_MESSAGE_DUMP
1776void FanStateResponse::dump_to(std::string &out) const {
1777 __attribute__((unused)) char buffer[64];
1778 out.append("FanStateResponse {\n");
1779 out.append(" key: ");
1780 sprintf(buffer, "%" PRIu32, this->key);
1781 out.append(buffer);
1782 out.append("\n");
1783
1784 out.append(" state: ");
1785 out.append(YESNO(this->state));
1786 out.append("\n");
1787
1788 out.append(" oscillating: ");
1789 out.append(YESNO(this->oscillating));
1790 out.append("\n");
1791
1792 out.append(" speed: ");
1794 out.append("\n");
1795
1796 out.append(" direction: ");
1798 out.append("\n");
1799
1800 out.append(" speed_level: ");
1801 sprintf(buffer, "%" PRId32, this->speed_level);
1802 out.append(buffer);
1803 out.append("\n");
1804
1805 out.append(" preset_mode: ");
1806 out.append("'").append(this->preset_mode).append("'");
1807 out.append("\n");
1808 out.append("}");
1809}
1810#endif
1811bool FanCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1812 switch (field_id) {
1813 case 2: {
1814 this->has_state = value.as_bool();
1815 return true;
1816 }
1817 case 3: {
1818 this->state = value.as_bool();
1819 return true;
1820 }
1821 case 4: {
1822 this->has_speed = value.as_bool();
1823 return true;
1824 }
1825 case 5: {
1826 this->speed = value.as_enum<enums::FanSpeed>();
1827 return true;
1828 }
1829 case 6: {
1830 this->has_oscillating = value.as_bool();
1831 return true;
1832 }
1833 case 7: {
1834 this->oscillating = value.as_bool();
1835 return true;
1836 }
1837 case 8: {
1838 this->has_direction = value.as_bool();
1839 return true;
1840 }
1841 case 9: {
1842 this->direction = value.as_enum<enums::FanDirection>();
1843 return true;
1844 }
1845 case 10: {
1846 this->has_speed_level = value.as_bool();
1847 return true;
1848 }
1849 case 11: {
1850 this->speed_level = value.as_int32();
1851 return true;
1852 }
1853 case 12: {
1854 this->has_preset_mode = value.as_bool();
1855 return true;
1856 }
1857 default:
1858 return false;
1859 }
1860}
1862 switch (field_id) {
1863 case 13: {
1864 this->preset_mode = value.as_string();
1865 return true;
1866 }
1867 default:
1868 return false;
1869 }
1870}
1871bool FanCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1872 switch (field_id) {
1873 case 1: {
1874 this->key = value.as_fixed32();
1875 return true;
1876 }
1877 default:
1878 return false;
1879 }
1880}
1882 buffer.encode_fixed32(1, this->key);
1883 buffer.encode_bool(2, this->has_state);
1884 buffer.encode_bool(3, this->state);
1885 buffer.encode_bool(4, this->has_speed);
1886 buffer.encode_enum<enums::FanSpeed>(5, this->speed);
1887 buffer.encode_bool(6, this->has_oscillating);
1888 buffer.encode_bool(7, this->oscillating);
1889 buffer.encode_bool(8, this->has_direction);
1890 buffer.encode_enum<enums::FanDirection>(9, this->direction);
1891 buffer.encode_bool(10, this->has_speed_level);
1892 buffer.encode_int32(11, this->speed_level);
1893 buffer.encode_bool(12, this->has_preset_mode);
1894 buffer.encode_string(13, this->preset_mode);
1895}
1896void FanCommandRequest::calculate_size(uint32_t &total_size) const {
1897 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
1898 ProtoSize::add_bool_field(total_size, 1, this->has_state, false);
1899 ProtoSize::add_bool_field(total_size, 1, this->state, false);
1900 ProtoSize::add_bool_field(total_size, 1, this->has_speed, false);
1901 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->speed), false);
1902 ProtoSize::add_bool_field(total_size, 1, this->has_oscillating, false);
1903 ProtoSize::add_bool_field(total_size, 1, this->oscillating, false);
1904 ProtoSize::add_bool_field(total_size, 1, this->has_direction, false);
1905 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->direction), false);
1906 ProtoSize::add_bool_field(total_size, 1, this->has_speed_level, false);
1907 ProtoSize::add_int32_field(total_size, 1, this->speed_level, false);
1908 ProtoSize::add_bool_field(total_size, 1, this->has_preset_mode, false);
1909 ProtoSize::add_string_field(total_size, 1, this->preset_mode, false);
1910}
1911#ifdef HAS_PROTO_MESSAGE_DUMP
1912void FanCommandRequest::dump_to(std::string &out) const {
1913 __attribute__((unused)) char buffer[64];
1914 out.append("FanCommandRequest {\n");
1915 out.append(" key: ");
1916 sprintf(buffer, "%" PRIu32, this->key);
1917 out.append(buffer);
1918 out.append("\n");
1919
1920 out.append(" has_state: ");
1921 out.append(YESNO(this->has_state));
1922 out.append("\n");
1923
1924 out.append(" state: ");
1925 out.append(YESNO(this->state));
1926 out.append("\n");
1927
1928 out.append(" has_speed: ");
1929 out.append(YESNO(this->has_speed));
1930 out.append("\n");
1931
1932 out.append(" speed: ");
1934 out.append("\n");
1935
1936 out.append(" has_oscillating: ");
1937 out.append(YESNO(this->has_oscillating));
1938 out.append("\n");
1939
1940 out.append(" oscillating: ");
1941 out.append(YESNO(this->oscillating));
1942 out.append("\n");
1943
1944 out.append(" has_direction: ");
1945 out.append(YESNO(this->has_direction));
1946 out.append("\n");
1947
1948 out.append(" direction: ");
1950 out.append("\n");
1951
1952 out.append(" has_speed_level: ");
1953 out.append(YESNO(this->has_speed_level));
1954 out.append("\n");
1955
1956 out.append(" speed_level: ");
1957 sprintf(buffer, "%" PRId32, this->speed_level);
1958 out.append(buffer);
1959 out.append("\n");
1960
1961 out.append(" has_preset_mode: ");
1962 out.append(YESNO(this->has_preset_mode));
1963 out.append("\n");
1964
1965 out.append(" preset_mode: ");
1966 out.append("'").append(this->preset_mode).append("'");
1967 out.append("\n");
1968 out.append("}");
1969}
1970#endif
1972 switch (field_id) {
1973 case 12: {
1974 this->supported_color_modes.push_back(value.as_enum<enums::ColorMode>());
1975 return true;
1976 }
1977 case 5: {
1978 this->legacy_supports_brightness = value.as_bool();
1979 return true;
1980 }
1981 case 6: {
1982 this->legacy_supports_rgb = value.as_bool();
1983 return true;
1984 }
1985 case 7: {
1986 this->legacy_supports_white_value = value.as_bool();
1987 return true;
1988 }
1989 case 8: {
1991 return true;
1992 }
1993 case 13: {
1994 this->disabled_by_default = value.as_bool();
1995 return true;
1996 }
1997 case 15: {
1999 return true;
2000 }
2001 default:
2002 return false;
2003 }
2004}
2006 switch (field_id) {
2007 case 1: {
2008 this->object_id = value.as_string();
2009 return true;
2010 }
2011 case 3: {
2012 this->name = value.as_string();
2013 return true;
2014 }
2015 case 4: {
2016 this->unique_id = value.as_string();
2017 return true;
2018 }
2019 case 11: {
2020 this->effects.push_back(value.as_string());
2021 return true;
2022 }
2023 case 14: {
2024 this->icon = value.as_string();
2025 return true;
2026 }
2027 default:
2028 return false;
2029 }
2030}
2032 switch (field_id) {
2033 case 2: {
2034 this->key = value.as_fixed32();
2035 return true;
2036 }
2037 case 9: {
2038 this->min_mireds = value.as_float();
2039 return true;
2040 }
2041 case 10: {
2042 this->max_mireds = value.as_float();
2043 return true;
2044 }
2045 default:
2046 return false;
2047 }
2048}
2050 buffer.encode_string(1, this->object_id);
2051 buffer.encode_fixed32(2, this->key);
2052 buffer.encode_string(3, this->name);
2053 buffer.encode_string(4, this->unique_id);
2054 for (auto &it : this->supported_color_modes) {
2055 buffer.encode_enum<enums::ColorMode>(12, it, true);
2056 }
2057 buffer.encode_bool(5, this->legacy_supports_brightness);
2058 buffer.encode_bool(6, this->legacy_supports_rgb);
2061 buffer.encode_float(9, this->min_mireds);
2062 buffer.encode_float(10, this->max_mireds);
2063 for (auto &it : this->effects) {
2064 buffer.encode_string(11, it, true);
2065 }
2066 buffer.encode_bool(13, this->disabled_by_default);
2067 buffer.encode_string(14, this->icon);
2069}
2070void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const {
2071 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
2072 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2073 ProtoSize::add_string_field(total_size, 1, this->name, false);
2074 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
2075 if (!this->supported_color_modes.empty()) {
2076 for (const auto &it : this->supported_color_modes) {
2077 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(it), true);
2078 }
2079 }
2080 ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_brightness, false);
2081 ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_rgb, false);
2082 ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_white_value, false);
2084 ProtoSize::add_fixed_field<4>(total_size, 1, this->min_mireds != 0.0f, false);
2085 ProtoSize::add_fixed_field<4>(total_size, 1, this->max_mireds != 0.0f, false);
2086 if (!this->effects.empty()) {
2087 for (const auto &it : this->effects) {
2088 ProtoSize::add_string_field(total_size, 1, it, true);
2089 }
2090 }
2091 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
2092 ProtoSize::add_string_field(total_size, 1, this->icon, false);
2093 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
2094}
2095#ifdef HAS_PROTO_MESSAGE_DUMP
2096void ListEntitiesLightResponse::dump_to(std::string &out) const {
2097 __attribute__((unused)) char buffer[64];
2098 out.append("ListEntitiesLightResponse {\n");
2099 out.append(" object_id: ");
2100 out.append("'").append(this->object_id).append("'");
2101 out.append("\n");
2102
2103 out.append(" key: ");
2104 sprintf(buffer, "%" PRIu32, this->key);
2105 out.append(buffer);
2106 out.append("\n");
2107
2108 out.append(" name: ");
2109 out.append("'").append(this->name).append("'");
2110 out.append("\n");
2111
2112 out.append(" unique_id: ");
2113 out.append("'").append(this->unique_id).append("'");
2114 out.append("\n");
2115
2116 for (const auto &it : this->supported_color_modes) {
2117 out.append(" supported_color_modes: ");
2119 out.append("\n");
2120 }
2121
2122 out.append(" legacy_supports_brightness: ");
2123 out.append(YESNO(this->legacy_supports_brightness));
2124 out.append("\n");
2125
2126 out.append(" legacy_supports_rgb: ");
2127 out.append(YESNO(this->legacy_supports_rgb));
2128 out.append("\n");
2129
2130 out.append(" legacy_supports_white_value: ");
2131 out.append(YESNO(this->legacy_supports_white_value));
2132 out.append("\n");
2133
2134 out.append(" legacy_supports_color_temperature: ");
2135 out.append(YESNO(this->legacy_supports_color_temperature));
2136 out.append("\n");
2137
2138 out.append(" min_mireds: ");
2139 sprintf(buffer, "%g", this->min_mireds);
2140 out.append(buffer);
2141 out.append("\n");
2142
2143 out.append(" max_mireds: ");
2144 sprintf(buffer, "%g", this->max_mireds);
2145 out.append(buffer);
2146 out.append("\n");
2147
2148 for (const auto &it : this->effects) {
2149 out.append(" effects: ");
2150 out.append("'").append(it).append("'");
2151 out.append("\n");
2152 }
2153
2154 out.append(" disabled_by_default: ");
2155 out.append(YESNO(this->disabled_by_default));
2156 out.append("\n");
2157
2158 out.append(" icon: ");
2159 out.append("'").append(this->icon).append("'");
2160 out.append("\n");
2161
2162 out.append(" entity_category: ");
2164 out.append("\n");
2165 out.append("}");
2166}
2167#endif
2168bool LightStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
2169 switch (field_id) {
2170 case 2: {
2171 this->state = value.as_bool();
2172 return true;
2173 }
2174 case 11: {
2175 this->color_mode = value.as_enum<enums::ColorMode>();
2176 return true;
2177 }
2178 default:
2179 return false;
2180 }
2181}
2183 switch (field_id) {
2184 case 9: {
2185 this->effect = value.as_string();
2186 return true;
2187 }
2188 default:
2189 return false;
2190 }
2191}
2192bool LightStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
2193 switch (field_id) {
2194 case 1: {
2195 this->key = value.as_fixed32();
2196 return true;
2197 }
2198 case 3: {
2199 this->brightness = value.as_float();
2200 return true;
2201 }
2202 case 10: {
2203 this->color_brightness = value.as_float();
2204 return true;
2205 }
2206 case 4: {
2207 this->red = value.as_float();
2208 return true;
2209 }
2210 case 5: {
2211 this->green = value.as_float();
2212 return true;
2213 }
2214 case 6: {
2215 this->blue = value.as_float();
2216 return true;
2217 }
2218 case 7: {
2219 this->white = value.as_float();
2220 return true;
2221 }
2222 case 8: {
2223 this->color_temperature = value.as_float();
2224 return true;
2225 }
2226 case 12: {
2227 this->cold_white = value.as_float();
2228 return true;
2229 }
2230 case 13: {
2231 this->warm_white = value.as_float();
2232 return true;
2233 }
2234 default:
2235 return false;
2236 }
2237}
2239 buffer.encode_fixed32(1, this->key);
2240 buffer.encode_bool(2, this->state);
2241 buffer.encode_float(3, this->brightness);
2242 buffer.encode_enum<enums::ColorMode>(11, this->color_mode);
2243 buffer.encode_float(10, this->color_brightness);
2244 buffer.encode_float(4, this->red);
2245 buffer.encode_float(5, this->green);
2246 buffer.encode_float(6, this->blue);
2247 buffer.encode_float(7, this->white);
2248 buffer.encode_float(8, this->color_temperature);
2249 buffer.encode_float(12, this->cold_white);
2250 buffer.encode_float(13, this->warm_white);
2251 buffer.encode_string(9, this->effect);
2252}
2253void LightStateResponse::calculate_size(uint32_t &total_size) const {
2254 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2255 ProtoSize::add_bool_field(total_size, 1, this->state, false);
2256 ProtoSize::add_fixed_field<4>(total_size, 1, this->brightness != 0.0f, false);
2257 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->color_mode), false);
2258 ProtoSize::add_fixed_field<4>(total_size, 1, this->color_brightness != 0.0f, false);
2259 ProtoSize::add_fixed_field<4>(total_size, 1, this->red != 0.0f, false);
2260 ProtoSize::add_fixed_field<4>(total_size, 1, this->green != 0.0f, false);
2261 ProtoSize::add_fixed_field<4>(total_size, 1, this->blue != 0.0f, false);
2262 ProtoSize::add_fixed_field<4>(total_size, 1, this->white != 0.0f, false);
2263 ProtoSize::add_fixed_field<4>(total_size, 1, this->color_temperature != 0.0f, false);
2264 ProtoSize::add_fixed_field<4>(total_size, 1, this->cold_white != 0.0f, false);
2265 ProtoSize::add_fixed_field<4>(total_size, 1, this->warm_white != 0.0f, false);
2266 ProtoSize::add_string_field(total_size, 1, this->effect, false);
2267}
2268#ifdef HAS_PROTO_MESSAGE_DUMP
2269void LightStateResponse::dump_to(std::string &out) const {
2270 __attribute__((unused)) char buffer[64];
2271 out.append("LightStateResponse {\n");
2272 out.append(" key: ");
2273 sprintf(buffer, "%" PRIu32, this->key);
2274 out.append(buffer);
2275 out.append("\n");
2276
2277 out.append(" state: ");
2278 out.append(YESNO(this->state));
2279 out.append("\n");
2280
2281 out.append(" brightness: ");
2282 sprintf(buffer, "%g", this->brightness);
2283 out.append(buffer);
2284 out.append("\n");
2285
2286 out.append(" color_mode: ");
2288 out.append("\n");
2289
2290 out.append(" color_brightness: ");
2291 sprintf(buffer, "%g", this->color_brightness);
2292 out.append(buffer);
2293 out.append("\n");
2294
2295 out.append(" red: ");
2296 sprintf(buffer, "%g", this->red);
2297 out.append(buffer);
2298 out.append("\n");
2299
2300 out.append(" green: ");
2301 sprintf(buffer, "%g", this->green);
2302 out.append(buffer);
2303 out.append("\n");
2304
2305 out.append(" blue: ");
2306 sprintf(buffer, "%g", this->blue);
2307 out.append(buffer);
2308 out.append("\n");
2309
2310 out.append(" white: ");
2311 sprintf(buffer, "%g", this->white);
2312 out.append(buffer);
2313 out.append("\n");
2314
2315 out.append(" color_temperature: ");
2316 sprintf(buffer, "%g", this->color_temperature);
2317 out.append(buffer);
2318 out.append("\n");
2319
2320 out.append(" cold_white: ");
2321 sprintf(buffer, "%g", this->cold_white);
2322 out.append(buffer);
2323 out.append("\n");
2324
2325 out.append(" warm_white: ");
2326 sprintf(buffer, "%g", this->warm_white);
2327 out.append(buffer);
2328 out.append("\n");
2329
2330 out.append(" effect: ");
2331 out.append("'").append(this->effect).append("'");
2332 out.append("\n");
2333 out.append("}");
2334}
2335#endif
2336bool LightCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2337 switch (field_id) {
2338 case 2: {
2339 this->has_state = value.as_bool();
2340 return true;
2341 }
2342 case 3: {
2343 this->state = value.as_bool();
2344 return true;
2345 }
2346 case 4: {
2347 this->has_brightness = value.as_bool();
2348 return true;
2349 }
2350 case 22: {
2351 this->has_color_mode = value.as_bool();
2352 return true;
2353 }
2354 case 23: {
2355 this->color_mode = value.as_enum<enums::ColorMode>();
2356 return true;
2357 }
2358 case 20: {
2359 this->has_color_brightness = value.as_bool();
2360 return true;
2361 }
2362 case 6: {
2363 this->has_rgb = value.as_bool();
2364 return true;
2365 }
2366 case 10: {
2367 this->has_white = value.as_bool();
2368 return true;
2369 }
2370 case 12: {
2371 this->has_color_temperature = value.as_bool();
2372 return true;
2373 }
2374 case 24: {
2375 this->has_cold_white = value.as_bool();
2376 return true;
2377 }
2378 case 26: {
2379 this->has_warm_white = value.as_bool();
2380 return true;
2381 }
2382 case 14: {
2383 this->has_transition_length = value.as_bool();
2384 return true;
2385 }
2386 case 15: {
2387 this->transition_length = value.as_uint32();
2388 return true;
2389 }
2390 case 16: {
2391 this->has_flash_length = value.as_bool();
2392 return true;
2393 }
2394 case 17: {
2395 this->flash_length = value.as_uint32();
2396 return true;
2397 }
2398 case 18: {
2399 this->has_effect = value.as_bool();
2400 return true;
2401 }
2402 default:
2403 return false;
2404 }
2405}
2407 switch (field_id) {
2408 case 19: {
2409 this->effect = value.as_string();
2410 return true;
2411 }
2412 default:
2413 return false;
2414 }
2415}
2416bool LightCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2417 switch (field_id) {
2418 case 1: {
2419 this->key = value.as_fixed32();
2420 return true;
2421 }
2422 case 5: {
2423 this->brightness = value.as_float();
2424 return true;
2425 }
2426 case 21: {
2427 this->color_brightness = value.as_float();
2428 return true;
2429 }
2430 case 7: {
2431 this->red = value.as_float();
2432 return true;
2433 }
2434 case 8: {
2435 this->green = value.as_float();
2436 return true;
2437 }
2438 case 9: {
2439 this->blue = value.as_float();
2440 return true;
2441 }
2442 case 11: {
2443 this->white = value.as_float();
2444 return true;
2445 }
2446 case 13: {
2447 this->color_temperature = value.as_float();
2448 return true;
2449 }
2450 case 25: {
2451 this->cold_white = value.as_float();
2452 return true;
2453 }
2454 case 27: {
2455 this->warm_white = value.as_float();
2456 return true;
2457 }
2458 default:
2459 return false;
2460 }
2461}
2463 buffer.encode_fixed32(1, this->key);
2464 buffer.encode_bool(2, this->has_state);
2465 buffer.encode_bool(3, this->state);
2466 buffer.encode_bool(4, this->has_brightness);
2467 buffer.encode_float(5, this->brightness);
2468 buffer.encode_bool(22, this->has_color_mode);
2469 buffer.encode_enum<enums::ColorMode>(23, this->color_mode);
2470 buffer.encode_bool(20, this->has_color_brightness);
2471 buffer.encode_float(21, this->color_brightness);
2472 buffer.encode_bool(6, this->has_rgb);
2473 buffer.encode_float(7, this->red);
2474 buffer.encode_float(8, this->green);
2475 buffer.encode_float(9, this->blue);
2476 buffer.encode_bool(10, this->has_white);
2477 buffer.encode_float(11, this->white);
2478 buffer.encode_bool(12, this->has_color_temperature);
2479 buffer.encode_float(13, this->color_temperature);
2480 buffer.encode_bool(24, this->has_cold_white);
2481 buffer.encode_float(25, this->cold_white);
2482 buffer.encode_bool(26, this->has_warm_white);
2483 buffer.encode_float(27, this->warm_white);
2484 buffer.encode_bool(14, this->has_transition_length);
2485 buffer.encode_uint32(15, this->transition_length);
2486 buffer.encode_bool(16, this->has_flash_length);
2487 buffer.encode_uint32(17, this->flash_length);
2488 buffer.encode_bool(18, this->has_effect);
2489 buffer.encode_string(19, this->effect);
2490}
2491void LightCommandRequest::calculate_size(uint32_t &total_size) const {
2492 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2493 ProtoSize::add_bool_field(total_size, 1, this->has_state, false);
2494 ProtoSize::add_bool_field(total_size, 1, this->state, false);
2495 ProtoSize::add_bool_field(total_size, 1, this->has_brightness, false);
2496 ProtoSize::add_fixed_field<4>(total_size, 1, this->brightness != 0.0f, false);
2497 ProtoSize::add_bool_field(total_size, 2, this->has_color_mode, false);
2498 ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(this->color_mode), false);
2499 ProtoSize::add_bool_field(total_size, 2, this->has_color_brightness, false);
2500 ProtoSize::add_fixed_field<4>(total_size, 2, this->color_brightness != 0.0f, false);
2501 ProtoSize::add_bool_field(total_size, 1, this->has_rgb, false);
2502 ProtoSize::add_fixed_field<4>(total_size, 1, this->red != 0.0f, false);
2503 ProtoSize::add_fixed_field<4>(total_size, 1, this->green != 0.0f, false);
2504 ProtoSize::add_fixed_field<4>(total_size, 1, this->blue != 0.0f, false);
2505 ProtoSize::add_bool_field(total_size, 1, this->has_white, false);
2506 ProtoSize::add_fixed_field<4>(total_size, 1, this->white != 0.0f, false);
2507 ProtoSize::add_bool_field(total_size, 1, this->has_color_temperature, false);
2508 ProtoSize::add_fixed_field<4>(total_size, 1, this->color_temperature != 0.0f, false);
2509 ProtoSize::add_bool_field(total_size, 2, this->has_cold_white, false);
2510 ProtoSize::add_fixed_field<4>(total_size, 2, this->cold_white != 0.0f, false);
2511 ProtoSize::add_bool_field(total_size, 2, this->has_warm_white, false);
2512 ProtoSize::add_fixed_field<4>(total_size, 2, this->warm_white != 0.0f, false);
2513 ProtoSize::add_bool_field(total_size, 1, this->has_transition_length, false);
2514 ProtoSize::add_uint32_field(total_size, 1, this->transition_length, false);
2515 ProtoSize::add_bool_field(total_size, 2, this->has_flash_length, false);
2516 ProtoSize::add_uint32_field(total_size, 2, this->flash_length, false);
2517 ProtoSize::add_bool_field(total_size, 2, this->has_effect, false);
2518 ProtoSize::add_string_field(total_size, 2, this->effect, false);
2519}
2520#ifdef HAS_PROTO_MESSAGE_DUMP
2521void LightCommandRequest::dump_to(std::string &out) const {
2522 __attribute__((unused)) char buffer[64];
2523 out.append("LightCommandRequest {\n");
2524 out.append(" key: ");
2525 sprintf(buffer, "%" PRIu32, this->key);
2526 out.append(buffer);
2527 out.append("\n");
2528
2529 out.append(" has_state: ");
2530 out.append(YESNO(this->has_state));
2531 out.append("\n");
2532
2533 out.append(" state: ");
2534 out.append(YESNO(this->state));
2535 out.append("\n");
2536
2537 out.append(" has_brightness: ");
2538 out.append(YESNO(this->has_brightness));
2539 out.append("\n");
2540
2541 out.append(" brightness: ");
2542 sprintf(buffer, "%g", this->brightness);
2543 out.append(buffer);
2544 out.append("\n");
2545
2546 out.append(" has_color_mode: ");
2547 out.append(YESNO(this->has_color_mode));
2548 out.append("\n");
2549
2550 out.append(" color_mode: ");
2552 out.append("\n");
2553
2554 out.append(" has_color_brightness: ");
2555 out.append(YESNO(this->has_color_brightness));
2556 out.append("\n");
2557
2558 out.append(" color_brightness: ");
2559 sprintf(buffer, "%g", this->color_brightness);
2560 out.append(buffer);
2561 out.append("\n");
2562
2563 out.append(" has_rgb: ");
2564 out.append(YESNO(this->has_rgb));
2565 out.append("\n");
2566
2567 out.append(" red: ");
2568 sprintf(buffer, "%g", this->red);
2569 out.append(buffer);
2570 out.append("\n");
2571
2572 out.append(" green: ");
2573 sprintf(buffer, "%g", this->green);
2574 out.append(buffer);
2575 out.append("\n");
2576
2577 out.append(" blue: ");
2578 sprintf(buffer, "%g", this->blue);
2579 out.append(buffer);
2580 out.append("\n");
2581
2582 out.append(" has_white: ");
2583 out.append(YESNO(this->has_white));
2584 out.append("\n");
2585
2586 out.append(" white: ");
2587 sprintf(buffer, "%g", this->white);
2588 out.append(buffer);
2589 out.append("\n");
2590
2591 out.append(" has_color_temperature: ");
2592 out.append(YESNO(this->has_color_temperature));
2593 out.append("\n");
2594
2595 out.append(" color_temperature: ");
2596 sprintf(buffer, "%g", this->color_temperature);
2597 out.append(buffer);
2598 out.append("\n");
2599
2600 out.append(" has_cold_white: ");
2601 out.append(YESNO(this->has_cold_white));
2602 out.append("\n");
2603
2604 out.append(" cold_white: ");
2605 sprintf(buffer, "%g", this->cold_white);
2606 out.append(buffer);
2607 out.append("\n");
2608
2609 out.append(" has_warm_white: ");
2610 out.append(YESNO(this->has_warm_white));
2611 out.append("\n");
2612
2613 out.append(" warm_white: ");
2614 sprintf(buffer, "%g", this->warm_white);
2615 out.append(buffer);
2616 out.append("\n");
2617
2618 out.append(" has_transition_length: ");
2619 out.append(YESNO(this->has_transition_length));
2620 out.append("\n");
2621
2622 out.append(" transition_length: ");
2623 sprintf(buffer, "%" PRIu32, this->transition_length);
2624 out.append(buffer);
2625 out.append("\n");
2626
2627 out.append(" has_flash_length: ");
2628 out.append(YESNO(this->has_flash_length));
2629 out.append("\n");
2630
2631 out.append(" flash_length: ");
2632 sprintf(buffer, "%" PRIu32, this->flash_length);
2633 out.append(buffer);
2634 out.append("\n");
2635
2636 out.append(" has_effect: ");
2637 out.append(YESNO(this->has_effect));
2638 out.append("\n");
2639
2640 out.append(" effect: ");
2641 out.append("'").append(this->effect).append("'");
2642 out.append("\n");
2643 out.append("}");
2644}
2645#endif
2647 switch (field_id) {
2648 case 7: {
2649 this->accuracy_decimals = value.as_int32();
2650 return true;
2651 }
2652 case 8: {
2653 this->force_update = value.as_bool();
2654 return true;
2655 }
2656 case 10: {
2658 return true;
2659 }
2660 case 11: {
2662 return true;
2663 }
2664 case 12: {
2665 this->disabled_by_default = value.as_bool();
2666 return true;
2667 }
2668 case 13: {
2670 return true;
2671 }
2672 default:
2673 return false;
2674 }
2675}
2677 switch (field_id) {
2678 case 1: {
2679 this->object_id = value.as_string();
2680 return true;
2681 }
2682 case 3: {
2683 this->name = value.as_string();
2684 return true;
2685 }
2686 case 4: {
2687 this->unique_id = value.as_string();
2688 return true;
2689 }
2690 case 5: {
2691 this->icon = value.as_string();
2692 return true;
2693 }
2694 case 6: {
2695 this->unit_of_measurement = value.as_string();
2696 return true;
2697 }
2698 case 9: {
2699 this->device_class = value.as_string();
2700 return true;
2701 }
2702 default:
2703 return false;
2704 }
2705}
2707 switch (field_id) {
2708 case 2: {
2709 this->key = value.as_fixed32();
2710 return true;
2711 }
2712 default:
2713 return false;
2714 }
2715}
2717 buffer.encode_string(1, this->object_id);
2718 buffer.encode_fixed32(2, this->key);
2719 buffer.encode_string(3, this->name);
2720 buffer.encode_string(4, this->unique_id);
2721 buffer.encode_string(5, this->icon);
2722 buffer.encode_string(6, this->unit_of_measurement);
2723 buffer.encode_int32(7, this->accuracy_decimals);
2724 buffer.encode_bool(8, this->force_update);
2725 buffer.encode_string(9, this->device_class);
2728 buffer.encode_bool(12, this->disabled_by_default);
2730}
2731void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const {
2732 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
2733 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2734 ProtoSize::add_string_field(total_size, 1, this->name, false);
2735 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
2736 ProtoSize::add_string_field(total_size, 1, this->icon, false);
2737 ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement, false);
2738 ProtoSize::add_int32_field(total_size, 1, this->accuracy_decimals, false);
2739 ProtoSize::add_bool_field(total_size, 1, this->force_update, false);
2740 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
2741 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state_class), false);
2742 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_last_reset_type), false);
2743 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
2744 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
2745}
2746#ifdef HAS_PROTO_MESSAGE_DUMP
2747void ListEntitiesSensorResponse::dump_to(std::string &out) const {
2748 __attribute__((unused)) char buffer[64];
2749 out.append("ListEntitiesSensorResponse {\n");
2750 out.append(" object_id: ");
2751 out.append("'").append(this->object_id).append("'");
2752 out.append("\n");
2753
2754 out.append(" key: ");
2755 sprintf(buffer, "%" PRIu32, this->key);
2756 out.append(buffer);
2757 out.append("\n");
2758
2759 out.append(" name: ");
2760 out.append("'").append(this->name).append("'");
2761 out.append("\n");
2762
2763 out.append(" unique_id: ");
2764 out.append("'").append(this->unique_id).append("'");
2765 out.append("\n");
2766
2767 out.append(" icon: ");
2768 out.append("'").append(this->icon).append("'");
2769 out.append("\n");
2770
2771 out.append(" unit_of_measurement: ");
2772 out.append("'").append(this->unit_of_measurement).append("'");
2773 out.append("\n");
2774
2775 out.append(" accuracy_decimals: ");
2776 sprintf(buffer, "%" PRId32, this->accuracy_decimals);
2777 out.append(buffer);
2778 out.append("\n");
2779
2780 out.append(" force_update: ");
2781 out.append(YESNO(this->force_update));
2782 out.append("\n");
2783
2784 out.append(" device_class: ");
2785 out.append("'").append(this->device_class).append("'");
2786 out.append("\n");
2787
2788 out.append(" state_class: ");
2790 out.append("\n");
2791
2792 out.append(" legacy_last_reset_type: ");
2794 out.append("\n");
2795
2796 out.append(" disabled_by_default: ");
2797 out.append(YESNO(this->disabled_by_default));
2798 out.append("\n");
2799
2800 out.append(" entity_category: ");
2802 out.append("\n");
2803 out.append("}");
2804}
2805#endif
2806bool SensorStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
2807 switch (field_id) {
2808 case 3: {
2809 this->missing_state = value.as_bool();
2810 return true;
2811 }
2812 default:
2813 return false;
2814 }
2815}
2816bool SensorStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
2817 switch (field_id) {
2818 case 1: {
2819 this->key = value.as_fixed32();
2820 return true;
2821 }
2822 case 2: {
2823 this->state = value.as_float();
2824 return true;
2825 }
2826 default:
2827 return false;
2828 }
2829}
2831 buffer.encode_fixed32(1, this->key);
2832 buffer.encode_float(2, this->state);
2833 buffer.encode_bool(3, this->missing_state);
2834}
2835void SensorStateResponse::calculate_size(uint32_t &total_size) const {
2836 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2837 ProtoSize::add_fixed_field<4>(total_size, 1, this->state != 0.0f, false);
2838 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
2839}
2840#ifdef HAS_PROTO_MESSAGE_DUMP
2841void SensorStateResponse::dump_to(std::string &out) const {
2842 __attribute__((unused)) char buffer[64];
2843 out.append("SensorStateResponse {\n");
2844 out.append(" key: ");
2845 sprintf(buffer, "%" PRIu32, this->key);
2846 out.append(buffer);
2847 out.append("\n");
2848
2849 out.append(" state: ");
2850 sprintf(buffer, "%g", this->state);
2851 out.append(buffer);
2852 out.append("\n");
2853
2854 out.append(" missing_state: ");
2855 out.append(YESNO(this->missing_state));
2856 out.append("\n");
2857 out.append("}");
2858}
2859#endif
2861 switch (field_id) {
2862 case 6: {
2863 this->assumed_state = value.as_bool();
2864 return true;
2865 }
2866 case 7: {
2867 this->disabled_by_default = value.as_bool();
2868 return true;
2869 }
2870 case 8: {
2872 return true;
2873 }
2874 default:
2875 return false;
2876 }
2877}
2879 switch (field_id) {
2880 case 1: {
2881 this->object_id = value.as_string();
2882 return true;
2883 }
2884 case 3: {
2885 this->name = value.as_string();
2886 return true;
2887 }
2888 case 4: {
2889 this->unique_id = value.as_string();
2890 return true;
2891 }
2892 case 5: {
2893 this->icon = value.as_string();
2894 return true;
2895 }
2896 case 9: {
2897 this->device_class = value.as_string();
2898 return true;
2899 }
2900 default:
2901 return false;
2902 }
2903}
2905 switch (field_id) {
2906 case 2: {
2907 this->key = value.as_fixed32();
2908 return true;
2909 }
2910 default:
2911 return false;
2912 }
2913}
2915 buffer.encode_string(1, this->object_id);
2916 buffer.encode_fixed32(2, this->key);
2917 buffer.encode_string(3, this->name);
2918 buffer.encode_string(4, this->unique_id);
2919 buffer.encode_string(5, this->icon);
2920 buffer.encode_bool(6, this->assumed_state);
2921 buffer.encode_bool(7, this->disabled_by_default);
2923 buffer.encode_string(9, this->device_class);
2924}
2925void ListEntitiesSwitchResponse::calculate_size(uint32_t &total_size) const {
2926 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
2927 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
2928 ProtoSize::add_string_field(total_size, 1, this->name, false);
2929 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
2930 ProtoSize::add_string_field(total_size, 1, this->icon, false);
2931 ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false);
2932 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
2933 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
2934 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
2935}
2936#ifdef HAS_PROTO_MESSAGE_DUMP
2937void ListEntitiesSwitchResponse::dump_to(std::string &out) const {
2938 __attribute__((unused)) char buffer[64];
2939 out.append("ListEntitiesSwitchResponse {\n");
2940 out.append(" object_id: ");
2941 out.append("'").append(this->object_id).append("'");
2942 out.append("\n");
2943
2944 out.append(" key: ");
2945 sprintf(buffer, "%" PRIu32, this->key);
2946 out.append(buffer);
2947 out.append("\n");
2948
2949 out.append(" name: ");
2950 out.append("'").append(this->name).append("'");
2951 out.append("\n");
2952
2953 out.append(" unique_id: ");
2954 out.append("'").append(this->unique_id).append("'");
2955 out.append("\n");
2956
2957 out.append(" icon: ");
2958 out.append("'").append(this->icon).append("'");
2959 out.append("\n");
2960
2961 out.append(" assumed_state: ");
2962 out.append(YESNO(this->assumed_state));
2963 out.append("\n");
2964
2965 out.append(" disabled_by_default: ");
2966 out.append(YESNO(this->disabled_by_default));
2967 out.append("\n");
2968
2969 out.append(" entity_category: ");
2971 out.append("\n");
2972
2973 out.append(" device_class: ");
2974 out.append("'").append(this->device_class).append("'");
2975 out.append("\n");
2976 out.append("}");
2977}
2978#endif
2979bool SwitchStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
2980 switch (field_id) {
2981 case 2: {
2982 this->state = value.as_bool();
2983 return true;
2984 }
2985 default:
2986 return false;
2987 }
2988}
2989bool SwitchStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
2990 switch (field_id) {
2991 case 1: {
2992 this->key = value.as_fixed32();
2993 return true;
2994 }
2995 default:
2996 return false;
2997 }
2998}
3000 buffer.encode_fixed32(1, this->key);
3001 buffer.encode_bool(2, this->state);
3002}
3003void SwitchStateResponse::calculate_size(uint32_t &total_size) const {
3004 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3005 ProtoSize::add_bool_field(total_size, 1, this->state, false);
3006}
3007#ifdef HAS_PROTO_MESSAGE_DUMP
3008void SwitchStateResponse::dump_to(std::string &out) const {
3009 __attribute__((unused)) char buffer[64];
3010 out.append("SwitchStateResponse {\n");
3011 out.append(" key: ");
3012 sprintf(buffer, "%" PRIu32, this->key);
3013 out.append(buffer);
3014 out.append("\n");
3015
3016 out.append(" state: ");
3017 out.append(YESNO(this->state));
3018 out.append("\n");
3019 out.append("}");
3020}
3021#endif
3022bool SwitchCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
3023 switch (field_id) {
3024 case 2: {
3025 this->state = value.as_bool();
3026 return true;
3027 }
3028 default:
3029 return false;
3030 }
3031}
3032bool SwitchCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
3033 switch (field_id) {
3034 case 1: {
3035 this->key = value.as_fixed32();
3036 return true;
3037 }
3038 default:
3039 return false;
3040 }
3041}
3043 buffer.encode_fixed32(1, this->key);
3044 buffer.encode_bool(2, this->state);
3045}
3046void SwitchCommandRequest::calculate_size(uint32_t &total_size) const {
3047 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3048 ProtoSize::add_bool_field(total_size, 1, this->state, false);
3049}
3050#ifdef HAS_PROTO_MESSAGE_DUMP
3051void SwitchCommandRequest::dump_to(std::string &out) const {
3052 __attribute__((unused)) char buffer[64];
3053 out.append("SwitchCommandRequest {\n");
3054 out.append(" key: ");
3055 sprintf(buffer, "%" PRIu32, this->key);
3056 out.append(buffer);
3057 out.append("\n");
3058
3059 out.append(" state: ");
3060 out.append(YESNO(this->state));
3061 out.append("\n");
3062 out.append("}");
3063}
3064#endif
3066 switch (field_id) {
3067 case 6: {
3068 this->disabled_by_default = value.as_bool();
3069 return true;
3070 }
3071 case 7: {
3073 return true;
3074 }
3075 default:
3076 return false;
3077 }
3078}
3080 switch (field_id) {
3081 case 1: {
3082 this->object_id = value.as_string();
3083 return true;
3084 }
3085 case 3: {
3086 this->name = value.as_string();
3087 return true;
3088 }
3089 case 4: {
3090 this->unique_id = value.as_string();
3091 return true;
3092 }
3093 case 5: {
3094 this->icon = value.as_string();
3095 return true;
3096 }
3097 case 8: {
3098 this->device_class = value.as_string();
3099 return true;
3100 }
3101 default:
3102 return false;
3103 }
3104}
3106 switch (field_id) {
3107 case 2: {
3108 this->key = value.as_fixed32();
3109 return true;
3110 }
3111 default:
3112 return false;
3113 }
3114}
3116 buffer.encode_string(1, this->object_id);
3117 buffer.encode_fixed32(2, this->key);
3118 buffer.encode_string(3, this->name);
3119 buffer.encode_string(4, this->unique_id);
3120 buffer.encode_string(5, this->icon);
3121 buffer.encode_bool(6, this->disabled_by_default);
3123 buffer.encode_string(8, this->device_class);
3124}
3125void ListEntitiesTextSensorResponse::calculate_size(uint32_t &total_size) const {
3126 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
3127 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3128 ProtoSize::add_string_field(total_size, 1, this->name, false);
3129 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
3130 ProtoSize::add_string_field(total_size, 1, this->icon, false);
3131 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
3132 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
3133 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
3134}
3135#ifdef HAS_PROTO_MESSAGE_DUMP
3136void ListEntitiesTextSensorResponse::dump_to(std::string &out) const {
3137 __attribute__((unused)) char buffer[64];
3138 out.append("ListEntitiesTextSensorResponse {\n");
3139 out.append(" object_id: ");
3140 out.append("'").append(this->object_id).append("'");
3141 out.append("\n");
3142
3143 out.append(" key: ");
3144 sprintf(buffer, "%" PRIu32, this->key);
3145 out.append(buffer);
3146 out.append("\n");
3147
3148 out.append(" name: ");
3149 out.append("'").append(this->name).append("'");
3150 out.append("\n");
3151
3152 out.append(" unique_id: ");
3153 out.append("'").append(this->unique_id).append("'");
3154 out.append("\n");
3155
3156 out.append(" icon: ");
3157 out.append("'").append(this->icon).append("'");
3158 out.append("\n");
3159
3160 out.append(" disabled_by_default: ");
3161 out.append(YESNO(this->disabled_by_default));
3162 out.append("\n");
3163
3164 out.append(" entity_category: ");
3166 out.append("\n");
3167
3168 out.append(" device_class: ");
3169 out.append("'").append(this->device_class).append("'");
3170 out.append("\n");
3171 out.append("}");
3172}
3173#endif
3175 switch (field_id) {
3176 case 3: {
3177 this->missing_state = value.as_bool();
3178 return true;
3179 }
3180 default:
3181 return false;
3182 }
3183}
3185 switch (field_id) {
3186 case 2: {
3187 this->state = value.as_string();
3188 return true;
3189 }
3190 default:
3191 return false;
3192 }
3193}
3195 switch (field_id) {
3196 case 1: {
3197 this->key = value.as_fixed32();
3198 return true;
3199 }
3200 default:
3201 return false;
3202 }
3203}
3205 buffer.encode_fixed32(1, this->key);
3206 buffer.encode_string(2, this->state);
3207 buffer.encode_bool(3, this->missing_state);
3208}
3209void TextSensorStateResponse::calculate_size(uint32_t &total_size) const {
3210 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3211 ProtoSize::add_string_field(total_size, 1, this->state, false);
3212 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
3213}
3214#ifdef HAS_PROTO_MESSAGE_DUMP
3215void TextSensorStateResponse::dump_to(std::string &out) const {
3216 __attribute__((unused)) char buffer[64];
3217 out.append("TextSensorStateResponse {\n");
3218 out.append(" key: ");
3219 sprintf(buffer, "%" PRIu32, this->key);
3220 out.append(buffer);
3221 out.append("\n");
3222
3223 out.append(" state: ");
3224 out.append("'").append(this->state).append("'");
3225 out.append("\n");
3226
3227 out.append(" missing_state: ");
3228 out.append(YESNO(this->missing_state));
3229 out.append("\n");
3230 out.append("}");
3231}
3232#endif
3233bool SubscribeLogsRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
3234 switch (field_id) {
3235 case 1: {
3236 this->level = value.as_enum<enums::LogLevel>();
3237 return true;
3238 }
3239 case 2: {
3240 this->dump_config = value.as_bool();
3241 return true;
3242 }
3243 default:
3244 return false;
3245 }
3246}
3248 buffer.encode_enum<enums::LogLevel>(1, this->level);
3249 buffer.encode_bool(2, this->dump_config);
3250}
3251void SubscribeLogsRequest::calculate_size(uint32_t &total_size) const {
3252 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->level), false);
3253 ProtoSize::add_bool_field(total_size, 1, this->dump_config, false);
3254}
3255#ifdef HAS_PROTO_MESSAGE_DUMP
3256void SubscribeLogsRequest::dump_to(std::string &out) const {
3257 __attribute__((unused)) char buffer[64];
3258 out.append("SubscribeLogsRequest {\n");
3259 out.append(" level: ");
3261 out.append("\n");
3262
3263 out.append(" dump_config: ");
3264 out.append(YESNO(this->dump_config));
3265 out.append("\n");
3266 out.append("}");
3267}
3268#endif
3270 switch (field_id) {
3271 case 1: {
3272 this->level = value.as_enum<enums::LogLevel>();
3273 return true;
3274 }
3275 case 4: {
3276 this->send_failed = value.as_bool();
3277 return true;
3278 }
3279 default:
3280 return false;
3281 }
3282}
3284 switch (field_id) {
3285 case 3: {
3286 this->message = value.as_string();
3287 return true;
3288 }
3289 default:
3290 return false;
3291 }
3292}
3294 buffer.encode_enum<enums::LogLevel>(1, this->level);
3295 buffer.encode_string(3, this->message);
3296 buffer.encode_bool(4, this->send_failed);
3297}
3298void SubscribeLogsResponse::calculate_size(uint32_t &total_size) const {
3299 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->level), false);
3300 ProtoSize::add_string_field(total_size, 1, this->message, false);
3301 ProtoSize::add_bool_field(total_size, 1, this->send_failed, false);
3302}
3303#ifdef HAS_PROTO_MESSAGE_DUMP
3304void SubscribeLogsResponse::dump_to(std::string &out) const {
3305 __attribute__((unused)) char buffer[64];
3306 out.append("SubscribeLogsResponse {\n");
3307 out.append(" level: ");
3309 out.append("\n");
3310
3311 out.append(" message: ");
3312 out.append("'").append(this->message).append("'");
3313 out.append("\n");
3314
3315 out.append(" send_failed: ");
3316 out.append(YESNO(this->send_failed));
3317 out.append("\n");
3318 out.append("}");
3319}
3320#endif
3322 switch (field_id) {
3323 case 1: {
3324 this->key = value.as_string();
3325 return true;
3326 }
3327 default:
3328 return false;
3329 }
3330}
3332void NoiseEncryptionSetKeyRequest::calculate_size(uint32_t &total_size) const {
3333 ProtoSize::add_string_field(total_size, 1, this->key, false);
3334}
3335#ifdef HAS_PROTO_MESSAGE_DUMP
3336void NoiseEncryptionSetKeyRequest::dump_to(std::string &out) const {
3337 __attribute__((unused)) char buffer[64];
3338 out.append("NoiseEncryptionSetKeyRequest {\n");
3339 out.append(" key: ");
3340 out.append("'").append(this->key).append("'");
3341 out.append("\n");
3342 out.append("}");
3343}
3344#endif
3346 switch (field_id) {
3347 case 1: {
3348 this->success = value.as_bool();
3349 return true;
3350 }
3351 default:
3352 return false;
3353 }
3354}
3356void NoiseEncryptionSetKeyResponse::calculate_size(uint32_t &total_size) const {
3357 ProtoSize::add_bool_field(total_size, 1, this->success, false);
3358}
3359#ifdef HAS_PROTO_MESSAGE_DUMP
3360void NoiseEncryptionSetKeyResponse::dump_to(std::string &out) const {
3361 __attribute__((unused)) char buffer[64];
3362 out.append("NoiseEncryptionSetKeyResponse {\n");
3363 out.append(" success: ");
3364 out.append(YESNO(this->success));
3365 out.append("\n");
3366 out.append("}");
3367}
3368#endif
3371#ifdef HAS_PROTO_MESSAGE_DUMP
3373 out.append("SubscribeHomeassistantServicesRequest {}");
3374}
3375#endif
3377 switch (field_id) {
3378 case 1: {
3379 this->key = value.as_string();
3380 return true;
3381 }
3382 case 2: {
3383 this->value = value.as_string();
3384 return true;
3385 }
3386 default:
3387 return false;
3388 }
3389}
3391 buffer.encode_string(1, this->key);
3392 buffer.encode_string(2, this->value);
3393}
3394void HomeassistantServiceMap::calculate_size(uint32_t &total_size) const {
3395 ProtoSize::add_string_field(total_size, 1, this->key, false);
3396 ProtoSize::add_string_field(total_size, 1, this->value, false);
3397}
3398#ifdef HAS_PROTO_MESSAGE_DUMP
3399void HomeassistantServiceMap::dump_to(std::string &out) const {
3400 __attribute__((unused)) char buffer[64];
3401 out.append("HomeassistantServiceMap {\n");
3402 out.append(" key: ");
3403 out.append("'").append(this->key).append("'");
3404 out.append("\n");
3405
3406 out.append(" value: ");
3407 out.append("'").append(this->value).append("'");
3408 out.append("\n");
3409 out.append("}");
3410}
3411#endif
3413 switch (field_id) {
3414 case 5: {
3415 this->is_event = value.as_bool();
3416 return true;
3417 }
3418 default:
3419 return false;
3420 }
3421}
3423 switch (field_id) {
3424 case 1: {
3425 this->service = value.as_string();
3426 return true;
3427 }
3428 case 2: {
3429 this->data.push_back(value.as_message<HomeassistantServiceMap>());
3430 return true;
3431 }
3432 case 3: {
3433 this->data_template.push_back(value.as_message<HomeassistantServiceMap>());
3434 return true;
3435 }
3436 case 4: {
3437 this->variables.push_back(value.as_message<HomeassistantServiceMap>());
3438 return true;
3439 }
3440 default:
3441 return false;
3442 }
3443}
3445 buffer.encode_string(1, this->service);
3446 for (auto &it : this->data) {
3447 buffer.encode_message<HomeassistantServiceMap>(2, it, true);
3448 }
3449 for (auto &it : this->data_template) {
3450 buffer.encode_message<HomeassistantServiceMap>(3, it, true);
3451 }
3452 for (auto &it : this->variables) {
3453 buffer.encode_message<HomeassistantServiceMap>(4, it, true);
3454 }
3455 buffer.encode_bool(5, this->is_event);
3456}
3457void HomeassistantServiceResponse::calculate_size(uint32_t &total_size) const {
3458 ProtoSize::add_string_field(total_size, 1, this->service, false);
3459 ProtoSize::add_repeated_message(total_size, 1, this->data);
3460 ProtoSize::add_repeated_message(total_size, 1, this->data_template);
3461 ProtoSize::add_repeated_message(total_size, 1, this->variables);
3462 ProtoSize::add_bool_field(total_size, 1, this->is_event, false);
3463}
3464#ifdef HAS_PROTO_MESSAGE_DUMP
3465void HomeassistantServiceResponse::dump_to(std::string &out) const {
3466 __attribute__((unused)) char buffer[64];
3467 out.append("HomeassistantServiceResponse {\n");
3468 out.append(" service: ");
3469 out.append("'").append(this->service).append("'");
3470 out.append("\n");
3471
3472 for (const auto &it : this->data) {
3473 out.append(" data: ");
3474 it.dump_to(out);
3475 out.append("\n");
3476 }
3477
3478 for (const auto &it : this->data_template) {
3479 out.append(" data_template: ");
3480 it.dump_to(out);
3481 out.append("\n");
3482 }
3483
3484 for (const auto &it : this->variables) {
3485 out.append(" variables: ");
3486 it.dump_to(out);
3487 out.append("\n");
3488 }
3489
3490 out.append(" is_event: ");
3491 out.append(YESNO(this->is_event));
3492 out.append("\n");
3493 out.append("}");
3494}
3495#endif
3498#ifdef HAS_PROTO_MESSAGE_DUMP
3500 out.append("SubscribeHomeAssistantStatesRequest {}");
3501}
3502#endif
3504 switch (field_id) {
3505 case 3: {
3506 this->once = value.as_bool();
3507 return true;
3508 }
3509 default:
3510 return false;
3511 }
3512}
3514 switch (field_id) {
3515 case 1: {
3516 this->entity_id = value.as_string();
3517 return true;
3518 }
3519 case 2: {
3520 this->attribute = value.as_string();
3521 return true;
3522 }
3523 default:
3524 return false;
3525 }
3526}
3528 buffer.encode_string(1, this->entity_id);
3529 buffer.encode_string(2, this->attribute);
3530 buffer.encode_bool(3, this->once);
3531}
3533 ProtoSize::add_string_field(total_size, 1, this->entity_id, false);
3534 ProtoSize::add_string_field(total_size, 1, this->attribute, false);
3535 ProtoSize::add_bool_field(total_size, 1, this->once, false);
3536}
3537#ifdef HAS_PROTO_MESSAGE_DUMP
3539 __attribute__((unused)) char buffer[64];
3540 out.append("SubscribeHomeAssistantStateResponse {\n");
3541 out.append(" entity_id: ");
3542 out.append("'").append(this->entity_id).append("'");
3543 out.append("\n");
3544
3545 out.append(" attribute: ");
3546 out.append("'").append(this->attribute).append("'");
3547 out.append("\n");
3548
3549 out.append(" once: ");
3550 out.append(YESNO(this->once));
3551 out.append("\n");
3552 out.append("}");
3553}
3554#endif
3556 switch (field_id) {
3557 case 1: {
3558 this->entity_id = value.as_string();
3559 return true;
3560 }
3561 case 2: {
3562 this->state = value.as_string();
3563 return true;
3564 }
3565 case 3: {
3566 this->attribute = value.as_string();
3567 return true;
3568 }
3569 default:
3570 return false;
3571 }
3572}
3574 buffer.encode_string(1, this->entity_id);
3575 buffer.encode_string(2, this->state);
3576 buffer.encode_string(3, this->attribute);
3577}
3578void HomeAssistantStateResponse::calculate_size(uint32_t &total_size) const {
3579 ProtoSize::add_string_field(total_size, 1, this->entity_id, false);
3580 ProtoSize::add_string_field(total_size, 1, this->state, false);
3581 ProtoSize::add_string_field(total_size, 1, this->attribute, false);
3582}
3583#ifdef HAS_PROTO_MESSAGE_DUMP
3584void HomeAssistantStateResponse::dump_to(std::string &out) const {
3585 __attribute__((unused)) char buffer[64];
3586 out.append("HomeAssistantStateResponse {\n");
3587 out.append(" entity_id: ");
3588 out.append("'").append(this->entity_id).append("'");
3589 out.append("\n");
3590
3591 out.append(" state: ");
3592 out.append("'").append(this->state).append("'");
3593 out.append("\n");
3594
3595 out.append(" attribute: ");
3596 out.append("'").append(this->attribute).append("'");
3597 out.append("\n");
3598 out.append("}");
3599}
3600#endif
3602void GetTimeRequest::calculate_size(uint32_t &total_size) const {}
3603#ifdef HAS_PROTO_MESSAGE_DUMP
3604void GetTimeRequest::dump_to(std::string &out) const { out.append("GetTimeRequest {}"); }
3605#endif
3606bool GetTimeResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
3607 switch (field_id) {
3608 case 1: {
3609 this->epoch_seconds = value.as_fixed32();
3610 return true;
3611 }
3612 default:
3613 return false;
3614 }
3615}
3617void GetTimeResponse::calculate_size(uint32_t &total_size) const {
3618 ProtoSize::add_fixed_field<4>(total_size, 1, this->epoch_seconds != 0, false);
3619}
3620#ifdef HAS_PROTO_MESSAGE_DUMP
3621void GetTimeResponse::dump_to(std::string &out) const {
3622 __attribute__((unused)) char buffer[64];
3623 out.append("GetTimeResponse {\n");
3624 out.append(" epoch_seconds: ");
3625 sprintf(buffer, "%" PRIu32, this->epoch_seconds);
3626 out.append(buffer);
3627 out.append("\n");
3628 out.append("}");
3629}
3630#endif
3632 switch (field_id) {
3633 case 2: {
3634 this->type = value.as_enum<enums::ServiceArgType>();
3635 return true;
3636 }
3637 default:
3638 return false;
3639 }
3640}
3642 switch (field_id) {
3643 case 1: {
3644 this->name = value.as_string();
3645 return true;
3646 }
3647 default:
3648 return false;
3649 }
3650}
3652 buffer.encode_string(1, this->name);
3653 buffer.encode_enum<enums::ServiceArgType>(2, this->type);
3654}
3655void ListEntitiesServicesArgument::calculate_size(uint32_t &total_size) const {
3656 ProtoSize::add_string_field(total_size, 1, this->name, false);
3657 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->type), false);
3658}
3659#ifdef HAS_PROTO_MESSAGE_DUMP
3660void ListEntitiesServicesArgument::dump_to(std::string &out) const {
3661 __attribute__((unused)) char buffer[64];
3662 out.append("ListEntitiesServicesArgument {\n");
3663 out.append(" name: ");
3664 out.append("'").append(this->name).append("'");
3665 out.append("\n");
3666
3667 out.append(" type: ");
3669 out.append("\n");
3670 out.append("}");
3671}
3672#endif
3674 switch (field_id) {
3675 case 1: {
3676 this->name = value.as_string();
3677 return true;
3678 }
3679 case 3: {
3680 this->args.push_back(value.as_message<ListEntitiesServicesArgument>());
3681 return true;
3682 }
3683 default:
3684 return false;
3685 }
3686}
3688 switch (field_id) {
3689 case 2: {
3690 this->key = value.as_fixed32();
3691 return true;
3692 }
3693 default:
3694 return false;
3695 }
3696}
3698 buffer.encode_string(1, this->name);
3699 buffer.encode_fixed32(2, this->key);
3700 for (auto &it : this->args) {
3701 buffer.encode_message<ListEntitiesServicesArgument>(3, it, true);
3702 }
3703}
3704void ListEntitiesServicesResponse::calculate_size(uint32_t &total_size) const {
3705 ProtoSize::add_string_field(total_size, 1, this->name, false);
3706 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3707 ProtoSize::add_repeated_message(total_size, 1, this->args);
3708}
3709#ifdef HAS_PROTO_MESSAGE_DUMP
3710void ListEntitiesServicesResponse::dump_to(std::string &out) const {
3711 __attribute__((unused)) char buffer[64];
3712 out.append("ListEntitiesServicesResponse {\n");
3713 out.append(" name: ");
3714 out.append("'").append(this->name).append("'");
3715 out.append("\n");
3716
3717 out.append(" key: ");
3718 sprintf(buffer, "%" PRIu32, this->key);
3719 out.append(buffer);
3720 out.append("\n");
3721
3722 for (const auto &it : this->args) {
3723 out.append(" args: ");
3724 it.dump_to(out);
3725 out.append("\n");
3726 }
3727 out.append("}");
3728}
3729#endif
3731 switch (field_id) {
3732 case 1: {
3733 this->bool_ = value.as_bool();
3734 return true;
3735 }
3736 case 2: {
3737 this->legacy_int = value.as_int32();
3738 return true;
3739 }
3740 case 5: {
3741 this->int_ = value.as_sint32();
3742 return true;
3743 }
3744 case 6: {
3745 this->bool_array.push_back(value.as_bool());
3746 return true;
3747 }
3748 case 7: {
3749 this->int_array.push_back(value.as_sint32());
3750 return true;
3751 }
3752 default:
3753 return false;
3754 }
3755}
3757 switch (field_id) {
3758 case 4: {
3759 this->string_ = value.as_string();
3760 return true;
3761 }
3762 case 9: {
3763 this->string_array.push_back(value.as_string());
3764 return true;
3765 }
3766 default:
3767 return false;
3768 }
3769}
3770bool ExecuteServiceArgument::decode_32bit(uint32_t field_id, Proto32Bit value) {
3771 switch (field_id) {
3772 case 3: {
3773 this->float_ = value.as_float();
3774 return true;
3775 }
3776 case 8: {
3777 this->float_array.push_back(value.as_float());
3778 return true;
3779 }
3780 default:
3781 return false;
3782 }
3783}
3785 buffer.encode_bool(1, this->bool_);
3786 buffer.encode_int32(2, this->legacy_int);
3787 buffer.encode_float(3, this->float_);
3788 buffer.encode_string(4, this->string_);
3789 buffer.encode_sint32(5, this->int_);
3790 for (auto it : this->bool_array) {
3791 buffer.encode_bool(6, it, true);
3792 }
3793 for (auto &it : this->int_array) {
3794 buffer.encode_sint32(7, it, true);
3795 }
3796 for (auto &it : this->float_array) {
3797 buffer.encode_float(8, it, true);
3798 }
3799 for (auto &it : this->string_array) {
3800 buffer.encode_string(9, it, true);
3801 }
3802}
3803void ExecuteServiceArgument::calculate_size(uint32_t &total_size) const {
3804 ProtoSize::add_bool_field(total_size, 1, this->bool_, false);
3805 ProtoSize::add_int32_field(total_size, 1, this->legacy_int, false);
3806 ProtoSize::add_fixed_field<4>(total_size, 1, this->float_ != 0.0f, false);
3807 ProtoSize::add_string_field(total_size, 1, this->string_, false);
3808 ProtoSize::add_sint32_field(total_size, 1, this->int_, false);
3809 if (!this->bool_array.empty()) {
3810 for (const auto it : this->bool_array) {
3811 ProtoSize::add_bool_field(total_size, 1, it, true);
3812 }
3813 }
3814 if (!this->int_array.empty()) {
3815 for (const auto &it : this->int_array) {
3816 ProtoSize::add_sint32_field(total_size, 1, it, true);
3817 }
3818 }
3819 if (!this->float_array.empty()) {
3820 for (const auto &it : this->float_array) {
3821 ProtoSize::add_fixed_field<4>(total_size, 1, it != 0.0f, true);
3822 }
3823 }
3824 if (!this->string_array.empty()) {
3825 for (const auto &it : this->string_array) {
3826 ProtoSize::add_string_field(total_size, 1, it, true);
3827 }
3828 }
3829}
3830#ifdef HAS_PROTO_MESSAGE_DUMP
3831void ExecuteServiceArgument::dump_to(std::string &out) const {
3832 __attribute__((unused)) char buffer[64];
3833 out.append("ExecuteServiceArgument {\n");
3834 out.append(" bool_: ");
3835 out.append(YESNO(this->bool_));
3836 out.append("\n");
3837
3838 out.append(" legacy_int: ");
3839 sprintf(buffer, "%" PRId32, this->legacy_int);
3840 out.append(buffer);
3841 out.append("\n");
3842
3843 out.append(" float_: ");
3844 sprintf(buffer, "%g", this->float_);
3845 out.append(buffer);
3846 out.append("\n");
3847
3848 out.append(" string_: ");
3849 out.append("'").append(this->string_).append("'");
3850 out.append("\n");
3851
3852 out.append(" int_: ");
3853 sprintf(buffer, "%" PRId32, this->int_);
3854 out.append(buffer);
3855 out.append("\n");
3856
3857 for (const auto it : this->bool_array) {
3858 out.append(" bool_array: ");
3859 out.append(YESNO(it));
3860 out.append("\n");
3861 }
3862
3863 for (const auto &it : this->int_array) {
3864 out.append(" int_array: ");
3865 sprintf(buffer, "%" PRId32, it);
3866 out.append(buffer);
3867 out.append("\n");
3868 }
3869
3870 for (const auto &it : this->float_array) {
3871 out.append(" float_array: ");
3872 sprintf(buffer, "%g", it);
3873 out.append(buffer);
3874 out.append("\n");
3875 }
3876
3877 for (const auto &it : this->string_array) {
3878 out.append(" string_array: ");
3879 out.append("'").append(it).append("'");
3880 out.append("\n");
3881 }
3882 out.append("}");
3883}
3884#endif
3886 switch (field_id) {
3887 case 2: {
3888 this->args.push_back(value.as_message<ExecuteServiceArgument>());
3889 return true;
3890 }
3891 default:
3892 return false;
3893 }
3894}
3895bool ExecuteServiceRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
3896 switch (field_id) {
3897 case 1: {
3898 this->key = value.as_fixed32();
3899 return true;
3900 }
3901 default:
3902 return false;
3903 }
3904}
3906 buffer.encode_fixed32(1, this->key);
3907 for (auto &it : this->args) {
3908 buffer.encode_message<ExecuteServiceArgument>(2, it, true);
3909 }
3910}
3911void ExecuteServiceRequest::calculate_size(uint32_t &total_size) const {
3912 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3913 ProtoSize::add_repeated_message(total_size, 1, this->args);
3914}
3915#ifdef HAS_PROTO_MESSAGE_DUMP
3916void ExecuteServiceRequest::dump_to(std::string &out) const {
3917 __attribute__((unused)) char buffer[64];
3918 out.append("ExecuteServiceRequest {\n");
3919 out.append(" key: ");
3920 sprintf(buffer, "%" PRIu32, this->key);
3921 out.append(buffer);
3922 out.append("\n");
3923
3924 for (const auto &it : this->args) {
3925 out.append(" args: ");
3926 it.dump_to(out);
3927 out.append("\n");
3928 }
3929 out.append("}");
3930}
3931#endif
3933 switch (field_id) {
3934 case 5: {
3935 this->disabled_by_default = value.as_bool();
3936 return true;
3937 }
3938 case 7: {
3940 return true;
3941 }
3942 default:
3943 return false;
3944 }
3945}
3947 switch (field_id) {
3948 case 1: {
3949 this->object_id = value.as_string();
3950 return true;
3951 }
3952 case 3: {
3953 this->name = value.as_string();
3954 return true;
3955 }
3956 case 4: {
3957 this->unique_id = value.as_string();
3958 return true;
3959 }
3960 case 6: {
3961 this->icon = value.as_string();
3962 return true;
3963 }
3964 default:
3965 return false;
3966 }
3967}
3969 switch (field_id) {
3970 case 2: {
3971 this->key = value.as_fixed32();
3972 return true;
3973 }
3974 default:
3975 return false;
3976 }
3977}
3979 buffer.encode_string(1, this->object_id);
3980 buffer.encode_fixed32(2, this->key);
3981 buffer.encode_string(3, this->name);
3982 buffer.encode_string(4, this->unique_id);
3983 buffer.encode_bool(5, this->disabled_by_default);
3984 buffer.encode_string(6, this->icon);
3986}
3987void ListEntitiesCameraResponse::calculate_size(uint32_t &total_size) const {
3988 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
3989 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
3990 ProtoSize::add_string_field(total_size, 1, this->name, false);
3991 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
3992 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
3993 ProtoSize::add_string_field(total_size, 1, this->icon, false);
3994 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
3995}
3996#ifdef HAS_PROTO_MESSAGE_DUMP
3997void ListEntitiesCameraResponse::dump_to(std::string &out) const {
3998 __attribute__((unused)) char buffer[64];
3999 out.append("ListEntitiesCameraResponse {\n");
4000 out.append(" object_id: ");
4001 out.append("'").append(this->object_id).append("'");
4002 out.append("\n");
4003
4004 out.append(" key: ");
4005 sprintf(buffer, "%" PRIu32, this->key);
4006 out.append(buffer);
4007 out.append("\n");
4008
4009 out.append(" name: ");
4010 out.append("'").append(this->name).append("'");
4011 out.append("\n");
4012
4013 out.append(" unique_id: ");
4014 out.append("'").append(this->unique_id).append("'");
4015 out.append("\n");
4016
4017 out.append(" disabled_by_default: ");
4018 out.append(YESNO(this->disabled_by_default));
4019 out.append("\n");
4020
4021 out.append(" icon: ");
4022 out.append("'").append(this->icon).append("'");
4023 out.append("\n");
4024
4025 out.append(" entity_category: ");
4027 out.append("\n");
4028 out.append("}");
4029}
4030#endif
4031bool CameraImageResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
4032 switch (field_id) {
4033 case 3: {
4034 this->done = value.as_bool();
4035 return true;
4036 }
4037 default:
4038 return false;
4039 }
4040}
4042 switch (field_id) {
4043 case 2: {
4044 this->data = value.as_string();
4045 return true;
4046 }
4047 default:
4048 return false;
4049 }
4050}
4051bool CameraImageResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
4052 switch (field_id) {
4053 case 1: {
4054 this->key = value.as_fixed32();
4055 return true;
4056 }
4057 default:
4058 return false;
4059 }
4060}
4062 buffer.encode_fixed32(1, this->key);
4063 buffer.encode_string(2, this->data);
4064 buffer.encode_bool(3, this->done);
4065}
4066void CameraImageResponse::calculate_size(uint32_t &total_size) const {
4067 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4068 ProtoSize::add_string_field(total_size, 1, this->data, false);
4069 ProtoSize::add_bool_field(total_size, 1, this->done, false);
4070}
4071#ifdef HAS_PROTO_MESSAGE_DUMP
4072void CameraImageResponse::dump_to(std::string &out) const {
4073 __attribute__((unused)) char buffer[64];
4074 out.append("CameraImageResponse {\n");
4075 out.append(" key: ");
4076 sprintf(buffer, "%" PRIu32, this->key);
4077 out.append(buffer);
4078 out.append("\n");
4079
4080 out.append(" data: ");
4081 out.append("'").append(this->data).append("'");
4082 out.append("\n");
4083
4084 out.append(" done: ");
4085 out.append(YESNO(this->done));
4086 out.append("\n");
4087 out.append("}");
4088}
4089#endif
4090bool CameraImageRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
4091 switch (field_id) {
4092 case 1: {
4093 this->single = value.as_bool();
4094 return true;
4095 }
4096 case 2: {
4097 this->stream = value.as_bool();
4098 return true;
4099 }
4100 default:
4101 return false;
4102 }
4103}
4105 buffer.encode_bool(1, this->single);
4106 buffer.encode_bool(2, this->stream);
4107}
4108void CameraImageRequest::calculate_size(uint32_t &total_size) const {
4109 ProtoSize::add_bool_field(total_size, 1, this->single, false);
4110 ProtoSize::add_bool_field(total_size, 1, this->stream, false);
4111}
4112#ifdef HAS_PROTO_MESSAGE_DUMP
4113void CameraImageRequest::dump_to(std::string &out) const {
4114 __attribute__((unused)) char buffer[64];
4115 out.append("CameraImageRequest {\n");
4116 out.append(" single: ");
4117 out.append(YESNO(this->single));
4118 out.append("\n");
4119
4120 out.append(" stream: ");
4121 out.append(YESNO(this->stream));
4122 out.append("\n");
4123 out.append("}");
4124}
4125#endif
4127 switch (field_id) {
4128 case 5: {
4129 this->supports_current_temperature = value.as_bool();
4130 return true;
4131 }
4132 case 6: {
4134 return true;
4135 }
4136 case 7: {
4137 this->supported_modes.push_back(value.as_enum<enums::ClimateMode>());
4138 return true;
4139 }
4140 case 11: {
4141 this->legacy_supports_away = value.as_bool();
4142 return true;
4143 }
4144 case 12: {
4145 this->supports_action = value.as_bool();
4146 return true;
4147 }
4148 case 13: {
4149 this->supported_fan_modes.push_back(value.as_enum<enums::ClimateFanMode>());
4150 return true;
4151 }
4152 case 14: {
4153 this->supported_swing_modes.push_back(value.as_enum<enums::ClimateSwingMode>());
4154 return true;
4155 }
4156 case 16: {
4157 this->supported_presets.push_back(value.as_enum<enums::ClimatePreset>());
4158 return true;
4159 }
4160 case 18: {
4161 this->disabled_by_default = value.as_bool();
4162 return true;
4163 }
4164 case 20: {
4166 return true;
4167 }
4168 case 22: {
4169 this->supports_current_humidity = value.as_bool();
4170 return true;
4171 }
4172 case 23: {
4173 this->supports_target_humidity = value.as_bool();
4174 return true;
4175 }
4176 default:
4177 return false;
4178 }
4179}
4181 switch (field_id) {
4182 case 1: {
4183 this->object_id = value.as_string();
4184 return true;
4185 }
4186 case 3: {
4187 this->name = value.as_string();
4188 return true;
4189 }
4190 case 4: {
4191 this->unique_id = value.as_string();
4192 return true;
4193 }
4194 case 15: {
4195 this->supported_custom_fan_modes.push_back(value.as_string());
4196 return true;
4197 }
4198 case 17: {
4199 this->supported_custom_presets.push_back(value.as_string());
4200 return true;
4201 }
4202 case 19: {
4203 this->icon = value.as_string();
4204 return true;
4205 }
4206 default:
4207 return false;
4208 }
4209}
4211 switch (field_id) {
4212 case 2: {
4213 this->key = value.as_fixed32();
4214 return true;
4215 }
4216 case 8: {
4217 this->visual_min_temperature = value.as_float();
4218 return true;
4219 }
4220 case 9: {
4221 this->visual_max_temperature = value.as_float();
4222 return true;
4223 }
4224 case 10: {
4226 return true;
4227 }
4228 case 21: {
4230 return true;
4231 }
4232 case 24: {
4233 this->visual_min_humidity = value.as_float();
4234 return true;
4235 }
4236 case 25: {
4237 this->visual_max_humidity = value.as_float();
4238 return true;
4239 }
4240 default:
4241 return false;
4242 }
4243}
4245 buffer.encode_string(1, this->object_id);
4246 buffer.encode_fixed32(2, this->key);
4247 buffer.encode_string(3, this->name);
4248 buffer.encode_string(4, this->unique_id);
4251 for (auto &it : this->supported_modes) {
4252 buffer.encode_enum<enums::ClimateMode>(7, it, true);
4253 }
4254 buffer.encode_float(8, this->visual_min_temperature);
4255 buffer.encode_float(9, this->visual_max_temperature);
4257 buffer.encode_bool(11, this->legacy_supports_away);
4258 buffer.encode_bool(12, this->supports_action);
4259 for (auto &it : this->supported_fan_modes) {
4260 buffer.encode_enum<enums::ClimateFanMode>(13, it, true);
4261 }
4262 for (auto &it : this->supported_swing_modes) {
4263 buffer.encode_enum<enums::ClimateSwingMode>(14, it, true);
4264 }
4265 for (auto &it : this->supported_custom_fan_modes) {
4266 buffer.encode_string(15, it, true);
4267 }
4268 for (auto &it : this->supported_presets) {
4269 buffer.encode_enum<enums::ClimatePreset>(16, it, true);
4270 }
4271 for (auto &it : this->supported_custom_presets) {
4272 buffer.encode_string(17, it, true);
4273 }
4274 buffer.encode_bool(18, this->disabled_by_default);
4275 buffer.encode_string(19, this->icon);
4278 buffer.encode_bool(22, this->supports_current_humidity);
4279 buffer.encode_bool(23, this->supports_target_humidity);
4280 buffer.encode_float(24, this->visual_min_humidity);
4281 buffer.encode_float(25, this->visual_max_humidity);
4282}
4283void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const {
4284 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
4285 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4286 ProtoSize::add_string_field(total_size, 1, this->name, false);
4287 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
4288 ProtoSize::add_bool_field(total_size, 1, this->supports_current_temperature, false);
4290 if (!this->supported_modes.empty()) {
4291 for (const auto &it : this->supported_modes) {
4292 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(it), true);
4293 }
4294 }
4295 ProtoSize::add_fixed_field<4>(total_size, 1, this->visual_min_temperature != 0.0f, false);
4296 ProtoSize::add_fixed_field<4>(total_size, 1, this->visual_max_temperature != 0.0f, false);
4297 ProtoSize::add_fixed_field<4>(total_size, 1, this->visual_target_temperature_step != 0.0f, false);
4298 ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_away, false);
4299 ProtoSize::add_bool_field(total_size, 1, this->supports_action, false);
4300 if (!this->supported_fan_modes.empty()) {
4301 for (const auto &it : this->supported_fan_modes) {
4302 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(it), true);
4303 }
4304 }
4305 if (!this->supported_swing_modes.empty()) {
4306 for (const auto &it : this->supported_swing_modes) {
4307 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(it), true);
4308 }
4309 }
4310 if (!this->supported_custom_fan_modes.empty()) {
4311 for (const auto &it : this->supported_custom_fan_modes) {
4312 ProtoSize::add_string_field(total_size, 1, it, true);
4313 }
4314 }
4315 if (!this->supported_presets.empty()) {
4316 for (const auto &it : this->supported_presets) {
4317 ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(it), true);
4318 }
4319 }
4320 if (!this->supported_custom_presets.empty()) {
4321 for (const auto &it : this->supported_custom_presets) {
4322 ProtoSize::add_string_field(total_size, 2, it, true);
4323 }
4324 }
4325 ProtoSize::add_bool_field(total_size, 2, this->disabled_by_default, false);
4326 ProtoSize::add_string_field(total_size, 2, this->icon, false);
4327 ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(this->entity_category), false);
4328 ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_current_temperature_step != 0.0f, false);
4329 ProtoSize::add_bool_field(total_size, 2, this->supports_current_humidity, false);
4330 ProtoSize::add_bool_field(total_size, 2, this->supports_target_humidity, false);
4331 ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_min_humidity != 0.0f, false);
4332 ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_max_humidity != 0.0f, false);
4333}
4334#ifdef HAS_PROTO_MESSAGE_DUMP
4335void ListEntitiesClimateResponse::dump_to(std::string &out) const {
4336 __attribute__((unused)) char buffer[64];
4337 out.append("ListEntitiesClimateResponse {\n");
4338 out.append(" object_id: ");
4339 out.append("'").append(this->object_id).append("'");
4340 out.append("\n");
4341
4342 out.append(" key: ");
4343 sprintf(buffer, "%" PRIu32, this->key);
4344 out.append(buffer);
4345 out.append("\n");
4346
4347 out.append(" name: ");
4348 out.append("'").append(this->name).append("'");
4349 out.append("\n");
4350
4351 out.append(" unique_id: ");
4352 out.append("'").append(this->unique_id).append("'");
4353 out.append("\n");
4354
4355 out.append(" supports_current_temperature: ");
4356 out.append(YESNO(this->supports_current_temperature));
4357 out.append("\n");
4358
4359 out.append(" supports_two_point_target_temperature: ");
4360 out.append(YESNO(this->supports_two_point_target_temperature));
4361 out.append("\n");
4362
4363 for (const auto &it : this->supported_modes) {
4364 out.append(" supported_modes: ");
4366 out.append("\n");
4367 }
4368
4369 out.append(" visual_min_temperature: ");
4370 sprintf(buffer, "%g", this->visual_min_temperature);
4371 out.append(buffer);
4372 out.append("\n");
4373
4374 out.append(" visual_max_temperature: ");
4375 sprintf(buffer, "%g", this->visual_max_temperature);
4376 out.append(buffer);
4377 out.append("\n");
4378
4379 out.append(" visual_target_temperature_step: ");
4380 sprintf(buffer, "%g", this->visual_target_temperature_step);
4381 out.append(buffer);
4382 out.append("\n");
4383
4384 out.append(" legacy_supports_away: ");
4385 out.append(YESNO(this->legacy_supports_away));
4386 out.append("\n");
4387
4388 out.append(" supports_action: ");
4389 out.append(YESNO(this->supports_action));
4390 out.append("\n");
4391
4392 for (const auto &it : this->supported_fan_modes) {
4393 out.append(" supported_fan_modes: ");
4395 out.append("\n");
4396 }
4397
4398 for (const auto &it : this->supported_swing_modes) {
4399 out.append(" supported_swing_modes: ");
4401 out.append("\n");
4402 }
4403
4404 for (const auto &it : this->supported_custom_fan_modes) {
4405 out.append(" supported_custom_fan_modes: ");
4406 out.append("'").append(it).append("'");
4407 out.append("\n");
4408 }
4409
4410 for (const auto &it : this->supported_presets) {
4411 out.append(" supported_presets: ");
4413 out.append("\n");
4414 }
4415
4416 for (const auto &it : this->supported_custom_presets) {
4417 out.append(" supported_custom_presets: ");
4418 out.append("'").append(it).append("'");
4419 out.append("\n");
4420 }
4421
4422 out.append(" disabled_by_default: ");
4423 out.append(YESNO(this->disabled_by_default));
4424 out.append("\n");
4425
4426 out.append(" icon: ");
4427 out.append("'").append(this->icon).append("'");
4428 out.append("\n");
4429
4430 out.append(" entity_category: ");
4432 out.append("\n");
4433
4434 out.append(" visual_current_temperature_step: ");
4435 sprintf(buffer, "%g", this->visual_current_temperature_step);
4436 out.append(buffer);
4437 out.append("\n");
4438
4439 out.append(" supports_current_humidity: ");
4440 out.append(YESNO(this->supports_current_humidity));
4441 out.append("\n");
4442
4443 out.append(" supports_target_humidity: ");
4444 out.append(YESNO(this->supports_target_humidity));
4445 out.append("\n");
4446
4447 out.append(" visual_min_humidity: ");
4448 sprintf(buffer, "%g", this->visual_min_humidity);
4449 out.append(buffer);
4450 out.append("\n");
4451
4452 out.append(" visual_max_humidity: ");
4453 sprintf(buffer, "%g", this->visual_max_humidity);
4454 out.append(buffer);
4455 out.append("\n");
4456 out.append("}");
4457}
4458#endif
4459bool ClimateStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
4460 switch (field_id) {
4461 case 2: {
4462 this->mode = value.as_enum<enums::ClimateMode>();
4463 return true;
4464 }
4465 case 7: {
4466 this->unused_legacy_away = value.as_bool();
4467 return true;
4468 }
4469 case 8: {
4470 this->action = value.as_enum<enums::ClimateAction>();
4471 return true;
4472 }
4473 case 9: {
4474 this->fan_mode = value.as_enum<enums::ClimateFanMode>();
4475 return true;
4476 }
4477 case 10: {
4479 return true;
4480 }
4481 case 12: {
4482 this->preset = value.as_enum<enums::ClimatePreset>();
4483 return true;
4484 }
4485 default:
4486 return false;
4487 }
4488}
4490 switch (field_id) {
4491 case 11: {
4492 this->custom_fan_mode = value.as_string();
4493 return true;
4494 }
4495 case 13: {
4496 this->custom_preset = value.as_string();
4497 return true;
4498 }
4499 default:
4500 return false;
4501 }
4502}
4503bool ClimateStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
4504 switch (field_id) {
4505 case 1: {
4506 this->key = value.as_fixed32();
4507 return true;
4508 }
4509 case 3: {
4510 this->current_temperature = value.as_float();
4511 return true;
4512 }
4513 case 4: {
4514 this->target_temperature = value.as_float();
4515 return true;
4516 }
4517 case 5: {
4518 this->target_temperature_low = value.as_float();
4519 return true;
4520 }
4521 case 6: {
4522 this->target_temperature_high = value.as_float();
4523 return true;
4524 }
4525 case 14: {
4526 this->current_humidity = value.as_float();
4527 return true;
4528 }
4529 case 15: {
4530 this->target_humidity = value.as_float();
4531 return true;
4532 }
4533 default:
4534 return false;
4535 }
4536}
4538 buffer.encode_fixed32(1, this->key);
4539 buffer.encode_enum<enums::ClimateMode>(2, this->mode);
4540 buffer.encode_float(3, this->current_temperature);
4541 buffer.encode_float(4, this->target_temperature);
4542 buffer.encode_float(5, this->target_temperature_low);
4543 buffer.encode_float(6, this->target_temperature_high);
4544 buffer.encode_bool(7, this->unused_legacy_away);
4545 buffer.encode_enum<enums::ClimateAction>(8, this->action);
4546 buffer.encode_enum<enums::ClimateFanMode>(9, this->fan_mode);
4548 buffer.encode_string(11, this->custom_fan_mode);
4549 buffer.encode_enum<enums::ClimatePreset>(12, this->preset);
4550 buffer.encode_string(13, this->custom_preset);
4551 buffer.encode_float(14, this->current_humidity);
4552 buffer.encode_float(15, this->target_humidity);
4553}
4554void ClimateStateResponse::calculate_size(uint32_t &total_size) const {
4555 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4556 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
4557 ProtoSize::add_fixed_field<4>(total_size, 1, this->current_temperature != 0.0f, false);
4558 ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature != 0.0f, false);
4559 ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature_low != 0.0f, false);
4560 ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature_high != 0.0f, false);
4561 ProtoSize::add_bool_field(total_size, 1, this->unused_legacy_away, false);
4562 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->action), false);
4563 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->fan_mode), false);
4564 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->swing_mode), false);
4565 ProtoSize::add_string_field(total_size, 1, this->custom_fan_mode, false);
4566 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->preset), false);
4567 ProtoSize::add_string_field(total_size, 1, this->custom_preset, false);
4568 ProtoSize::add_fixed_field<4>(total_size, 1, this->current_humidity != 0.0f, false);
4569 ProtoSize::add_fixed_field<4>(total_size, 1, this->target_humidity != 0.0f, false);
4570}
4571#ifdef HAS_PROTO_MESSAGE_DUMP
4572void ClimateStateResponse::dump_to(std::string &out) const {
4573 __attribute__((unused)) char buffer[64];
4574 out.append("ClimateStateResponse {\n");
4575 out.append(" key: ");
4576 sprintf(buffer, "%" PRIu32, this->key);
4577 out.append(buffer);
4578 out.append("\n");
4579
4580 out.append(" mode: ");
4582 out.append("\n");
4583
4584 out.append(" current_temperature: ");
4585 sprintf(buffer, "%g", this->current_temperature);
4586 out.append(buffer);
4587 out.append("\n");
4588
4589 out.append(" target_temperature: ");
4590 sprintf(buffer, "%g", this->target_temperature);
4591 out.append(buffer);
4592 out.append("\n");
4593
4594 out.append(" target_temperature_low: ");
4595 sprintf(buffer, "%g", this->target_temperature_low);
4596 out.append(buffer);
4597 out.append("\n");
4598
4599 out.append(" target_temperature_high: ");
4600 sprintf(buffer, "%g", this->target_temperature_high);
4601 out.append(buffer);
4602 out.append("\n");
4603
4604 out.append(" unused_legacy_away: ");
4605 out.append(YESNO(this->unused_legacy_away));
4606 out.append("\n");
4607
4608 out.append(" action: ");
4610 out.append("\n");
4611
4612 out.append(" fan_mode: ");
4614 out.append("\n");
4615
4616 out.append(" swing_mode: ");
4618 out.append("\n");
4619
4620 out.append(" custom_fan_mode: ");
4621 out.append("'").append(this->custom_fan_mode).append("'");
4622 out.append("\n");
4623
4624 out.append(" preset: ");
4626 out.append("\n");
4627
4628 out.append(" custom_preset: ");
4629 out.append("'").append(this->custom_preset).append("'");
4630 out.append("\n");
4631
4632 out.append(" current_humidity: ");
4633 sprintf(buffer, "%g", this->current_humidity);
4634 out.append(buffer);
4635 out.append("\n");
4636
4637 out.append(" target_humidity: ");
4638 sprintf(buffer, "%g", this->target_humidity);
4639 out.append(buffer);
4640 out.append("\n");
4641 out.append("}");
4642}
4643#endif
4645 switch (field_id) {
4646 case 2: {
4647 this->has_mode = value.as_bool();
4648 return true;
4649 }
4650 case 3: {
4651 this->mode = value.as_enum<enums::ClimateMode>();
4652 return true;
4653 }
4654 case 4: {
4655 this->has_target_temperature = value.as_bool();
4656 return true;
4657 }
4658 case 6: {
4659 this->has_target_temperature_low = value.as_bool();
4660 return true;
4661 }
4662 case 8: {
4663 this->has_target_temperature_high = value.as_bool();
4664 return true;
4665 }
4666 case 10: {
4667 this->unused_has_legacy_away = value.as_bool();
4668 return true;
4669 }
4670 case 11: {
4671 this->unused_legacy_away = value.as_bool();
4672 return true;
4673 }
4674 case 12: {
4675 this->has_fan_mode = value.as_bool();
4676 return true;
4677 }
4678 case 13: {
4679 this->fan_mode = value.as_enum<enums::ClimateFanMode>();
4680 return true;
4681 }
4682 case 14: {
4683 this->has_swing_mode = value.as_bool();
4684 return true;
4685 }
4686 case 15: {
4688 return true;
4689 }
4690 case 16: {
4691 this->has_custom_fan_mode = value.as_bool();
4692 return true;
4693 }
4694 case 18: {
4695 this->has_preset = value.as_bool();
4696 return true;
4697 }
4698 case 19: {
4699 this->preset = value.as_enum<enums::ClimatePreset>();
4700 return true;
4701 }
4702 case 20: {
4703 this->has_custom_preset = value.as_bool();
4704 return true;
4705 }
4706 case 22: {
4707 this->has_target_humidity = value.as_bool();
4708 return true;
4709 }
4710 default:
4711 return false;
4712 }
4713}
4715 switch (field_id) {
4716 case 17: {
4717 this->custom_fan_mode = value.as_string();
4718 return true;
4719 }
4720 case 21: {
4721 this->custom_preset = value.as_string();
4722 return true;
4723 }
4724 default:
4725 return false;
4726 }
4727}
4728bool ClimateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
4729 switch (field_id) {
4730 case 1: {
4731 this->key = value.as_fixed32();
4732 return true;
4733 }
4734 case 5: {
4735 this->target_temperature = value.as_float();
4736 return true;
4737 }
4738 case 7: {
4739 this->target_temperature_low = value.as_float();
4740 return true;
4741 }
4742 case 9: {
4743 this->target_temperature_high = value.as_float();
4744 return true;
4745 }
4746 case 23: {
4747 this->target_humidity = value.as_float();
4748 return true;
4749 }
4750 default:
4751 return false;
4752 }
4753}
4755 buffer.encode_fixed32(1, this->key);
4756 buffer.encode_bool(2, this->has_mode);
4757 buffer.encode_enum<enums::ClimateMode>(3, this->mode);
4758 buffer.encode_bool(4, this->has_target_temperature);
4759 buffer.encode_float(5, this->target_temperature);
4760 buffer.encode_bool(6, this->has_target_temperature_low);
4761 buffer.encode_float(7, this->target_temperature_low);
4763 buffer.encode_float(9, this->target_temperature_high);
4764 buffer.encode_bool(10, this->unused_has_legacy_away);
4765 buffer.encode_bool(11, this->unused_legacy_away);
4766 buffer.encode_bool(12, this->has_fan_mode);
4767 buffer.encode_enum<enums::ClimateFanMode>(13, this->fan_mode);
4768 buffer.encode_bool(14, this->has_swing_mode);
4770 buffer.encode_bool(16, this->has_custom_fan_mode);
4771 buffer.encode_string(17, this->custom_fan_mode);
4772 buffer.encode_bool(18, this->has_preset);
4773 buffer.encode_enum<enums::ClimatePreset>(19, this->preset);
4774 buffer.encode_bool(20, this->has_custom_preset);
4775 buffer.encode_string(21, this->custom_preset);
4776 buffer.encode_bool(22, this->has_target_humidity);
4777 buffer.encode_float(23, this->target_humidity);
4778}
4779void ClimateCommandRequest::calculate_size(uint32_t &total_size) const {
4780 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4781 ProtoSize::add_bool_field(total_size, 1, this->has_mode, false);
4782 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
4783 ProtoSize::add_bool_field(total_size, 1, this->has_target_temperature, false);
4784 ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature != 0.0f, false);
4785 ProtoSize::add_bool_field(total_size, 1, this->has_target_temperature_low, false);
4786 ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature_low != 0.0f, false);
4787 ProtoSize::add_bool_field(total_size, 1, this->has_target_temperature_high, false);
4788 ProtoSize::add_fixed_field<4>(total_size, 1, this->target_temperature_high != 0.0f, false);
4789 ProtoSize::add_bool_field(total_size, 1, this->unused_has_legacy_away, false);
4790 ProtoSize::add_bool_field(total_size, 1, this->unused_legacy_away, false);
4791 ProtoSize::add_bool_field(total_size, 1, this->has_fan_mode, false);
4792 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->fan_mode), false);
4793 ProtoSize::add_bool_field(total_size, 1, this->has_swing_mode, false);
4794 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->swing_mode), false);
4795 ProtoSize::add_bool_field(total_size, 2, this->has_custom_fan_mode, false);
4796 ProtoSize::add_string_field(total_size, 2, this->custom_fan_mode, false);
4797 ProtoSize::add_bool_field(total_size, 2, this->has_preset, false);
4798 ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(this->preset), false);
4799 ProtoSize::add_bool_field(total_size, 2, this->has_custom_preset, false);
4800 ProtoSize::add_string_field(total_size, 2, this->custom_preset, false);
4801 ProtoSize::add_bool_field(total_size, 2, this->has_target_humidity, false);
4802 ProtoSize::add_fixed_field<4>(total_size, 2, this->target_humidity != 0.0f, false);
4803}
4804#ifdef HAS_PROTO_MESSAGE_DUMP
4805void ClimateCommandRequest::dump_to(std::string &out) const {
4806 __attribute__((unused)) char buffer[64];
4807 out.append("ClimateCommandRequest {\n");
4808 out.append(" key: ");
4809 sprintf(buffer, "%" PRIu32, this->key);
4810 out.append(buffer);
4811 out.append("\n");
4812
4813 out.append(" has_mode: ");
4814 out.append(YESNO(this->has_mode));
4815 out.append("\n");
4816
4817 out.append(" mode: ");
4819 out.append("\n");
4820
4821 out.append(" has_target_temperature: ");
4822 out.append(YESNO(this->has_target_temperature));
4823 out.append("\n");
4824
4825 out.append(" target_temperature: ");
4826 sprintf(buffer, "%g", this->target_temperature);
4827 out.append(buffer);
4828 out.append("\n");
4829
4830 out.append(" has_target_temperature_low: ");
4831 out.append(YESNO(this->has_target_temperature_low));
4832 out.append("\n");
4833
4834 out.append(" target_temperature_low: ");
4835 sprintf(buffer, "%g", this->target_temperature_low);
4836 out.append(buffer);
4837 out.append("\n");
4838
4839 out.append(" has_target_temperature_high: ");
4840 out.append(YESNO(this->has_target_temperature_high));
4841 out.append("\n");
4842
4843 out.append(" target_temperature_high: ");
4844 sprintf(buffer, "%g", this->target_temperature_high);
4845 out.append(buffer);
4846 out.append("\n");
4847
4848 out.append(" unused_has_legacy_away: ");
4849 out.append(YESNO(this->unused_has_legacy_away));
4850 out.append("\n");
4851
4852 out.append(" unused_legacy_away: ");
4853 out.append(YESNO(this->unused_legacy_away));
4854 out.append("\n");
4855
4856 out.append(" has_fan_mode: ");
4857 out.append(YESNO(this->has_fan_mode));
4858 out.append("\n");
4859
4860 out.append(" fan_mode: ");
4862 out.append("\n");
4863
4864 out.append(" has_swing_mode: ");
4865 out.append(YESNO(this->has_swing_mode));
4866 out.append("\n");
4867
4868 out.append(" swing_mode: ");
4870 out.append("\n");
4871
4872 out.append(" has_custom_fan_mode: ");
4873 out.append(YESNO(this->has_custom_fan_mode));
4874 out.append("\n");
4875
4876 out.append(" custom_fan_mode: ");
4877 out.append("'").append(this->custom_fan_mode).append("'");
4878 out.append("\n");
4879
4880 out.append(" has_preset: ");
4881 out.append(YESNO(this->has_preset));
4882 out.append("\n");
4883
4884 out.append(" preset: ");
4886 out.append("\n");
4887
4888 out.append(" has_custom_preset: ");
4889 out.append(YESNO(this->has_custom_preset));
4890 out.append("\n");
4891
4892 out.append(" custom_preset: ");
4893 out.append("'").append(this->custom_preset).append("'");
4894 out.append("\n");
4895
4896 out.append(" has_target_humidity: ");
4897 out.append(YESNO(this->has_target_humidity));
4898 out.append("\n");
4899
4900 out.append(" target_humidity: ");
4901 sprintf(buffer, "%g", this->target_humidity);
4902 out.append(buffer);
4903 out.append("\n");
4904 out.append("}");
4905}
4906#endif
4908 switch (field_id) {
4909 case 9: {
4910 this->disabled_by_default = value.as_bool();
4911 return true;
4912 }
4913 case 10: {
4915 return true;
4916 }
4917 case 12: {
4918 this->mode = value.as_enum<enums::NumberMode>();
4919 return true;
4920 }
4921 default:
4922 return false;
4923 }
4924}
4926 switch (field_id) {
4927 case 1: {
4928 this->object_id = value.as_string();
4929 return true;
4930 }
4931 case 3: {
4932 this->name = value.as_string();
4933 return true;
4934 }
4935 case 4: {
4936 this->unique_id = value.as_string();
4937 return true;
4938 }
4939 case 5: {
4940 this->icon = value.as_string();
4941 return true;
4942 }
4943 case 11: {
4944 this->unit_of_measurement = value.as_string();
4945 return true;
4946 }
4947 case 13: {
4948 this->device_class = value.as_string();
4949 return true;
4950 }
4951 default:
4952 return false;
4953 }
4954}
4956 switch (field_id) {
4957 case 2: {
4958 this->key = value.as_fixed32();
4959 return true;
4960 }
4961 case 6: {
4962 this->min_value = value.as_float();
4963 return true;
4964 }
4965 case 7: {
4966 this->max_value = value.as_float();
4967 return true;
4968 }
4969 case 8: {
4970 this->step = value.as_float();
4971 return true;
4972 }
4973 default:
4974 return false;
4975 }
4976}
4978 buffer.encode_string(1, this->object_id);
4979 buffer.encode_fixed32(2, this->key);
4980 buffer.encode_string(3, this->name);
4981 buffer.encode_string(4, this->unique_id);
4982 buffer.encode_string(5, this->icon);
4983 buffer.encode_float(6, this->min_value);
4984 buffer.encode_float(7, this->max_value);
4985 buffer.encode_float(8, this->step);
4986 buffer.encode_bool(9, this->disabled_by_default);
4988 buffer.encode_string(11, this->unit_of_measurement);
4989 buffer.encode_enum<enums::NumberMode>(12, this->mode);
4990 buffer.encode_string(13, this->device_class);
4991}
4992void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const {
4993 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
4994 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
4995 ProtoSize::add_string_field(total_size, 1, this->name, false);
4996 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
4997 ProtoSize::add_string_field(total_size, 1, this->icon, false);
4998 ProtoSize::add_fixed_field<4>(total_size, 1, this->min_value != 0.0f, false);
4999 ProtoSize::add_fixed_field<4>(total_size, 1, this->max_value != 0.0f, false);
5000 ProtoSize::add_fixed_field<4>(total_size, 1, this->step != 0.0f, false);
5001 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5002 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
5003 ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement, false);
5004 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
5005 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
5006}
5007#ifdef HAS_PROTO_MESSAGE_DUMP
5008void ListEntitiesNumberResponse::dump_to(std::string &out) const {
5009 __attribute__((unused)) char buffer[64];
5010 out.append("ListEntitiesNumberResponse {\n");
5011 out.append(" object_id: ");
5012 out.append("'").append(this->object_id).append("'");
5013 out.append("\n");
5014
5015 out.append(" key: ");
5016 sprintf(buffer, "%" PRIu32, this->key);
5017 out.append(buffer);
5018 out.append("\n");
5019
5020 out.append(" name: ");
5021 out.append("'").append(this->name).append("'");
5022 out.append("\n");
5023
5024 out.append(" unique_id: ");
5025 out.append("'").append(this->unique_id).append("'");
5026 out.append("\n");
5027
5028 out.append(" icon: ");
5029 out.append("'").append(this->icon).append("'");
5030 out.append("\n");
5031
5032 out.append(" min_value: ");
5033 sprintf(buffer, "%g", this->min_value);
5034 out.append(buffer);
5035 out.append("\n");
5036
5037 out.append(" max_value: ");
5038 sprintf(buffer, "%g", this->max_value);
5039 out.append(buffer);
5040 out.append("\n");
5041
5042 out.append(" step: ");
5043 sprintf(buffer, "%g", this->step);
5044 out.append(buffer);
5045 out.append("\n");
5046
5047 out.append(" disabled_by_default: ");
5048 out.append(YESNO(this->disabled_by_default));
5049 out.append("\n");
5050
5051 out.append(" entity_category: ");
5053 out.append("\n");
5054
5055 out.append(" unit_of_measurement: ");
5056 out.append("'").append(this->unit_of_measurement).append("'");
5057 out.append("\n");
5058
5059 out.append(" mode: ");
5061 out.append("\n");
5062
5063 out.append(" device_class: ");
5064 out.append("'").append(this->device_class).append("'");
5065 out.append("\n");
5066 out.append("}");
5067}
5068#endif
5069bool NumberStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
5070 switch (field_id) {
5071 case 3: {
5072 this->missing_state = value.as_bool();
5073 return true;
5074 }
5075 default:
5076 return false;
5077 }
5078}
5079bool NumberStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
5080 switch (field_id) {
5081 case 1: {
5082 this->key = value.as_fixed32();
5083 return true;
5084 }
5085 case 2: {
5086 this->state = value.as_float();
5087 return true;
5088 }
5089 default:
5090 return false;
5091 }
5092}
5094 buffer.encode_fixed32(1, this->key);
5095 buffer.encode_float(2, this->state);
5096 buffer.encode_bool(3, this->missing_state);
5097}
5098void NumberStateResponse::calculate_size(uint32_t &total_size) const {
5099 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5100 ProtoSize::add_fixed_field<4>(total_size, 1, this->state != 0.0f, false);
5101 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
5102}
5103#ifdef HAS_PROTO_MESSAGE_DUMP
5104void NumberStateResponse::dump_to(std::string &out) const {
5105 __attribute__((unused)) char buffer[64];
5106 out.append("NumberStateResponse {\n");
5107 out.append(" key: ");
5108 sprintf(buffer, "%" PRIu32, this->key);
5109 out.append(buffer);
5110 out.append("\n");
5111
5112 out.append(" state: ");
5113 sprintf(buffer, "%g", this->state);
5114 out.append(buffer);
5115 out.append("\n");
5116
5117 out.append(" missing_state: ");
5118 out.append(YESNO(this->missing_state));
5119 out.append("\n");
5120 out.append("}");
5121}
5122#endif
5123bool NumberCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
5124 switch (field_id) {
5125 case 1: {
5126 this->key = value.as_fixed32();
5127 return true;
5128 }
5129 case 2: {
5130 this->state = value.as_float();
5131 return true;
5132 }
5133 default:
5134 return false;
5135 }
5136}
5138 buffer.encode_fixed32(1, this->key);
5139 buffer.encode_float(2, this->state);
5140}
5141void NumberCommandRequest::calculate_size(uint32_t &total_size) const {
5142 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5143 ProtoSize::add_fixed_field<4>(total_size, 1, this->state != 0.0f, false);
5144}
5145#ifdef HAS_PROTO_MESSAGE_DUMP
5146void NumberCommandRequest::dump_to(std::string &out) const {
5147 __attribute__((unused)) char buffer[64];
5148 out.append("NumberCommandRequest {\n");
5149 out.append(" key: ");
5150 sprintf(buffer, "%" PRIu32, this->key);
5151 out.append(buffer);
5152 out.append("\n");
5153
5154 out.append(" state: ");
5155 sprintf(buffer, "%g", this->state);
5156 out.append(buffer);
5157 out.append("\n");
5158 out.append("}");
5159}
5160#endif
5162 switch (field_id) {
5163 case 7: {
5164 this->disabled_by_default = value.as_bool();
5165 return true;
5166 }
5167 case 8: {
5169 return true;
5170 }
5171 default:
5172 return false;
5173 }
5174}
5176 switch (field_id) {
5177 case 1: {
5178 this->object_id = value.as_string();
5179 return true;
5180 }
5181 case 3: {
5182 this->name = value.as_string();
5183 return true;
5184 }
5185 case 4: {
5186 this->unique_id = value.as_string();
5187 return true;
5188 }
5189 case 5: {
5190 this->icon = value.as_string();
5191 return true;
5192 }
5193 case 6: {
5194 this->options.push_back(value.as_string());
5195 return true;
5196 }
5197 default:
5198 return false;
5199 }
5200}
5202 switch (field_id) {
5203 case 2: {
5204 this->key = value.as_fixed32();
5205 return true;
5206 }
5207 default:
5208 return false;
5209 }
5210}
5212 buffer.encode_string(1, this->object_id);
5213 buffer.encode_fixed32(2, this->key);
5214 buffer.encode_string(3, this->name);
5215 buffer.encode_string(4, this->unique_id);
5216 buffer.encode_string(5, this->icon);
5217 for (auto &it : this->options) {
5218 buffer.encode_string(6, it, true);
5219 }
5220 buffer.encode_bool(7, this->disabled_by_default);
5222}
5223void ListEntitiesSelectResponse::calculate_size(uint32_t &total_size) const {
5224 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
5225 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5226 ProtoSize::add_string_field(total_size, 1, this->name, false);
5227 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
5228 ProtoSize::add_string_field(total_size, 1, this->icon, false);
5229 if (!this->options.empty()) {
5230 for (const auto &it : this->options) {
5231 ProtoSize::add_string_field(total_size, 1, it, true);
5232 }
5233 }
5234 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5235 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
5236}
5237#ifdef HAS_PROTO_MESSAGE_DUMP
5238void ListEntitiesSelectResponse::dump_to(std::string &out) const {
5239 __attribute__((unused)) char buffer[64];
5240 out.append("ListEntitiesSelectResponse {\n");
5241 out.append(" object_id: ");
5242 out.append("'").append(this->object_id).append("'");
5243 out.append("\n");
5244
5245 out.append(" key: ");
5246 sprintf(buffer, "%" PRIu32, this->key);
5247 out.append(buffer);
5248 out.append("\n");
5249
5250 out.append(" name: ");
5251 out.append("'").append(this->name).append("'");
5252 out.append("\n");
5253
5254 out.append(" unique_id: ");
5255 out.append("'").append(this->unique_id).append("'");
5256 out.append("\n");
5257
5258 out.append(" icon: ");
5259 out.append("'").append(this->icon).append("'");
5260 out.append("\n");
5261
5262 for (const auto &it : this->options) {
5263 out.append(" options: ");
5264 out.append("'").append(it).append("'");
5265 out.append("\n");
5266 }
5267
5268 out.append(" disabled_by_default: ");
5269 out.append(YESNO(this->disabled_by_default));
5270 out.append("\n");
5271
5272 out.append(" entity_category: ");
5274 out.append("\n");
5275 out.append("}");
5276}
5277#endif
5278bool SelectStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
5279 switch (field_id) {
5280 case 3: {
5281 this->missing_state = value.as_bool();
5282 return true;
5283 }
5284 default:
5285 return false;
5286 }
5287}
5289 switch (field_id) {
5290 case 2: {
5291 this->state = value.as_string();
5292 return true;
5293 }
5294 default:
5295 return false;
5296 }
5297}
5298bool SelectStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
5299 switch (field_id) {
5300 case 1: {
5301 this->key = value.as_fixed32();
5302 return true;
5303 }
5304 default:
5305 return false;
5306 }
5307}
5309 buffer.encode_fixed32(1, this->key);
5310 buffer.encode_string(2, this->state);
5311 buffer.encode_bool(3, this->missing_state);
5312}
5313void SelectStateResponse::calculate_size(uint32_t &total_size) const {
5314 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5315 ProtoSize::add_string_field(total_size, 1, this->state, false);
5316 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
5317}
5318#ifdef HAS_PROTO_MESSAGE_DUMP
5319void SelectStateResponse::dump_to(std::string &out) const {
5320 __attribute__((unused)) char buffer[64];
5321 out.append("SelectStateResponse {\n");
5322 out.append(" key: ");
5323 sprintf(buffer, "%" PRIu32, this->key);
5324 out.append(buffer);
5325 out.append("\n");
5326
5327 out.append(" state: ");
5328 out.append("'").append(this->state).append("'");
5329 out.append("\n");
5330
5331 out.append(" missing_state: ");
5332 out.append(YESNO(this->missing_state));
5333 out.append("\n");
5334 out.append("}");
5335}
5336#endif
5338 switch (field_id) {
5339 case 2: {
5340 this->state = value.as_string();
5341 return true;
5342 }
5343 default:
5344 return false;
5345 }
5346}
5347bool SelectCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
5348 switch (field_id) {
5349 case 1: {
5350 this->key = value.as_fixed32();
5351 return true;
5352 }
5353 default:
5354 return false;
5355 }
5356}
5358 buffer.encode_fixed32(1, this->key);
5359 buffer.encode_string(2, this->state);
5360}
5361void SelectCommandRequest::calculate_size(uint32_t &total_size) const {
5362 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5363 ProtoSize::add_string_field(total_size, 1, this->state, false);
5364}
5365#ifdef HAS_PROTO_MESSAGE_DUMP
5366void SelectCommandRequest::dump_to(std::string &out) const {
5367 __attribute__((unused)) char buffer[64];
5368 out.append("SelectCommandRequest {\n");
5369 out.append(" key: ");
5370 sprintf(buffer, "%" PRIu32, this->key);
5371 out.append(buffer);
5372 out.append("\n");
5373
5374 out.append(" state: ");
5375 out.append("'").append(this->state).append("'");
5376 out.append("\n");
5377 out.append("}");
5378}
5379#endif
5381 switch (field_id) {
5382 case 6: {
5383 this->disabled_by_default = value.as_bool();
5384 return true;
5385 }
5386 case 8: {
5387 this->supports_duration = value.as_bool();
5388 return true;
5389 }
5390 case 9: {
5391 this->supports_volume = value.as_bool();
5392 return true;
5393 }
5394 case 10: {
5396 return true;
5397 }
5398 default:
5399 return false;
5400 }
5401}
5403 switch (field_id) {
5404 case 1: {
5405 this->object_id = value.as_string();
5406 return true;
5407 }
5408 case 3: {
5409 this->name = value.as_string();
5410 return true;
5411 }
5412 case 4: {
5413 this->unique_id = value.as_string();
5414 return true;
5415 }
5416 case 5: {
5417 this->icon = value.as_string();
5418 return true;
5419 }
5420 case 7: {
5421 this->tones.push_back(value.as_string());
5422 return true;
5423 }
5424 default:
5425 return false;
5426 }
5427}
5429 switch (field_id) {
5430 case 2: {
5431 this->key = value.as_fixed32();
5432 return true;
5433 }
5434 default:
5435 return false;
5436 }
5437}
5439 buffer.encode_string(1, this->object_id);
5440 buffer.encode_fixed32(2, this->key);
5441 buffer.encode_string(3, this->name);
5442 buffer.encode_string(4, this->unique_id);
5443 buffer.encode_string(5, this->icon);
5444 buffer.encode_bool(6, this->disabled_by_default);
5445 for (auto &it : this->tones) {
5446 buffer.encode_string(7, it, true);
5447 }
5448 buffer.encode_bool(8, this->supports_duration);
5449 buffer.encode_bool(9, this->supports_volume);
5451}
5452void ListEntitiesSirenResponse::calculate_size(uint32_t &total_size) const {
5453 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
5454 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5455 ProtoSize::add_string_field(total_size, 1, this->name, false);
5456 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
5457 ProtoSize::add_string_field(total_size, 1, this->icon, false);
5458 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5459 if (!this->tones.empty()) {
5460 for (const auto &it : this->tones) {
5461 ProtoSize::add_string_field(total_size, 1, it, true);
5462 }
5463 }
5464 ProtoSize::add_bool_field(total_size, 1, this->supports_duration, false);
5465 ProtoSize::add_bool_field(total_size, 1, this->supports_volume, false);
5466 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
5467}
5468#ifdef HAS_PROTO_MESSAGE_DUMP
5469void ListEntitiesSirenResponse::dump_to(std::string &out) const {
5470 __attribute__((unused)) char buffer[64];
5471 out.append("ListEntitiesSirenResponse {\n");
5472 out.append(" object_id: ");
5473 out.append("'").append(this->object_id).append("'");
5474 out.append("\n");
5475
5476 out.append(" key: ");
5477 sprintf(buffer, "%" PRIu32, this->key);
5478 out.append(buffer);
5479 out.append("\n");
5480
5481 out.append(" name: ");
5482 out.append("'").append(this->name).append("'");
5483 out.append("\n");
5484
5485 out.append(" unique_id: ");
5486 out.append("'").append(this->unique_id).append("'");
5487 out.append("\n");
5488
5489 out.append(" icon: ");
5490 out.append("'").append(this->icon).append("'");
5491 out.append("\n");
5492
5493 out.append(" disabled_by_default: ");
5494 out.append(YESNO(this->disabled_by_default));
5495 out.append("\n");
5496
5497 for (const auto &it : this->tones) {
5498 out.append(" tones: ");
5499 out.append("'").append(it).append("'");
5500 out.append("\n");
5501 }
5502
5503 out.append(" supports_duration: ");
5504 out.append(YESNO(this->supports_duration));
5505 out.append("\n");
5506
5507 out.append(" supports_volume: ");
5508 out.append(YESNO(this->supports_volume));
5509 out.append("\n");
5510
5511 out.append(" entity_category: ");
5513 out.append("\n");
5514 out.append("}");
5515}
5516#endif
5517bool SirenStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
5518 switch (field_id) {
5519 case 2: {
5520 this->state = value.as_bool();
5521 return true;
5522 }
5523 default:
5524 return false;
5525 }
5526}
5527bool SirenStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
5528 switch (field_id) {
5529 case 1: {
5530 this->key = value.as_fixed32();
5531 return true;
5532 }
5533 default:
5534 return false;
5535 }
5536}
5538 buffer.encode_fixed32(1, this->key);
5539 buffer.encode_bool(2, this->state);
5540}
5541void SirenStateResponse::calculate_size(uint32_t &total_size) const {
5542 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5543 ProtoSize::add_bool_field(total_size, 1, this->state, false);
5544}
5545#ifdef HAS_PROTO_MESSAGE_DUMP
5546void SirenStateResponse::dump_to(std::string &out) const {
5547 __attribute__((unused)) char buffer[64];
5548 out.append("SirenStateResponse {\n");
5549 out.append(" key: ");
5550 sprintf(buffer, "%" PRIu32, this->key);
5551 out.append(buffer);
5552 out.append("\n");
5553
5554 out.append(" state: ");
5555 out.append(YESNO(this->state));
5556 out.append("\n");
5557 out.append("}");
5558}
5559#endif
5560bool SirenCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
5561 switch (field_id) {
5562 case 2: {
5563 this->has_state = value.as_bool();
5564 return true;
5565 }
5566 case 3: {
5567 this->state = value.as_bool();
5568 return true;
5569 }
5570 case 4: {
5571 this->has_tone = value.as_bool();
5572 return true;
5573 }
5574 case 6: {
5575 this->has_duration = value.as_bool();
5576 return true;
5577 }
5578 case 7: {
5579 this->duration = value.as_uint32();
5580 return true;
5581 }
5582 case 8: {
5583 this->has_volume = value.as_bool();
5584 return true;
5585 }
5586 default:
5587 return false;
5588 }
5589}
5591 switch (field_id) {
5592 case 5: {
5593 this->tone = value.as_string();
5594 return true;
5595 }
5596 default:
5597 return false;
5598 }
5599}
5600bool SirenCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
5601 switch (field_id) {
5602 case 1: {
5603 this->key = value.as_fixed32();
5604 return true;
5605 }
5606 case 9: {
5607 this->volume = value.as_float();
5608 return true;
5609 }
5610 default:
5611 return false;
5612 }
5613}
5615 buffer.encode_fixed32(1, this->key);
5616 buffer.encode_bool(2, this->has_state);
5617 buffer.encode_bool(3, this->state);
5618 buffer.encode_bool(4, this->has_tone);
5619 buffer.encode_string(5, this->tone);
5620 buffer.encode_bool(6, this->has_duration);
5621 buffer.encode_uint32(7, this->duration);
5622 buffer.encode_bool(8, this->has_volume);
5623 buffer.encode_float(9, this->volume);
5624}
5625void SirenCommandRequest::calculate_size(uint32_t &total_size) const {
5626 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5627 ProtoSize::add_bool_field(total_size, 1, this->has_state, false);
5628 ProtoSize::add_bool_field(total_size, 1, this->state, false);
5629 ProtoSize::add_bool_field(total_size, 1, this->has_tone, false);
5630 ProtoSize::add_string_field(total_size, 1, this->tone, false);
5631 ProtoSize::add_bool_field(total_size, 1, this->has_duration, false);
5632 ProtoSize::add_uint32_field(total_size, 1, this->duration, false);
5633 ProtoSize::add_bool_field(total_size, 1, this->has_volume, false);
5634 ProtoSize::add_fixed_field<4>(total_size, 1, this->volume != 0.0f, false);
5635}
5636#ifdef HAS_PROTO_MESSAGE_DUMP
5637void SirenCommandRequest::dump_to(std::string &out) const {
5638 __attribute__((unused)) char buffer[64];
5639 out.append("SirenCommandRequest {\n");
5640 out.append(" key: ");
5641 sprintf(buffer, "%" PRIu32, this->key);
5642 out.append(buffer);
5643 out.append("\n");
5644
5645 out.append(" has_state: ");
5646 out.append(YESNO(this->has_state));
5647 out.append("\n");
5648
5649 out.append(" state: ");
5650 out.append(YESNO(this->state));
5651 out.append("\n");
5652
5653 out.append(" has_tone: ");
5654 out.append(YESNO(this->has_tone));
5655 out.append("\n");
5656
5657 out.append(" tone: ");
5658 out.append("'").append(this->tone).append("'");
5659 out.append("\n");
5660
5661 out.append(" has_duration: ");
5662 out.append(YESNO(this->has_duration));
5663 out.append("\n");
5664
5665 out.append(" duration: ");
5666 sprintf(buffer, "%" PRIu32, this->duration);
5667 out.append(buffer);
5668 out.append("\n");
5669
5670 out.append(" has_volume: ");
5671 out.append(YESNO(this->has_volume));
5672 out.append("\n");
5673
5674 out.append(" volume: ");
5675 sprintf(buffer, "%g", this->volume);
5676 out.append(buffer);
5677 out.append("\n");
5678 out.append("}");
5679}
5680#endif
5682 switch (field_id) {
5683 case 6: {
5684 this->disabled_by_default = value.as_bool();
5685 return true;
5686 }
5687 case 7: {
5689 return true;
5690 }
5691 case 8: {
5692 this->assumed_state = value.as_bool();
5693 return true;
5694 }
5695 case 9: {
5696 this->supports_open = value.as_bool();
5697 return true;
5698 }
5699 case 10: {
5700 this->requires_code = value.as_bool();
5701 return true;
5702 }
5703 default:
5704 return false;
5705 }
5706}
5708 switch (field_id) {
5709 case 1: {
5710 this->object_id = value.as_string();
5711 return true;
5712 }
5713 case 3: {
5714 this->name = value.as_string();
5715 return true;
5716 }
5717 case 4: {
5718 this->unique_id = value.as_string();
5719 return true;
5720 }
5721 case 5: {
5722 this->icon = value.as_string();
5723 return true;
5724 }
5725 case 11: {
5726 this->code_format = value.as_string();
5727 return true;
5728 }
5729 default:
5730 return false;
5731 }
5732}
5734 switch (field_id) {
5735 case 2: {
5736 this->key = value.as_fixed32();
5737 return true;
5738 }
5739 default:
5740 return false;
5741 }
5742}
5744 buffer.encode_string(1, this->object_id);
5745 buffer.encode_fixed32(2, this->key);
5746 buffer.encode_string(3, this->name);
5747 buffer.encode_string(4, this->unique_id);
5748 buffer.encode_string(5, this->icon);
5749 buffer.encode_bool(6, this->disabled_by_default);
5751 buffer.encode_bool(8, this->assumed_state);
5752 buffer.encode_bool(9, this->supports_open);
5753 buffer.encode_bool(10, this->requires_code);
5754 buffer.encode_string(11, this->code_format);
5755}
5756void ListEntitiesLockResponse::calculate_size(uint32_t &total_size) const {
5757 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
5758 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5759 ProtoSize::add_string_field(total_size, 1, this->name, false);
5760 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
5761 ProtoSize::add_string_field(total_size, 1, this->icon, false);
5762 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5763 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
5764 ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false);
5765 ProtoSize::add_bool_field(total_size, 1, this->supports_open, false);
5766 ProtoSize::add_bool_field(total_size, 1, this->requires_code, false);
5767 ProtoSize::add_string_field(total_size, 1, this->code_format, false);
5768}
5769#ifdef HAS_PROTO_MESSAGE_DUMP
5770void ListEntitiesLockResponse::dump_to(std::string &out) const {
5771 __attribute__((unused)) char buffer[64];
5772 out.append("ListEntitiesLockResponse {\n");
5773 out.append(" object_id: ");
5774 out.append("'").append(this->object_id).append("'");
5775 out.append("\n");
5776
5777 out.append(" key: ");
5778 sprintf(buffer, "%" PRIu32, this->key);
5779 out.append(buffer);
5780 out.append("\n");
5781
5782 out.append(" name: ");
5783 out.append("'").append(this->name).append("'");
5784 out.append("\n");
5785
5786 out.append(" unique_id: ");
5787 out.append("'").append(this->unique_id).append("'");
5788 out.append("\n");
5789
5790 out.append(" icon: ");
5791 out.append("'").append(this->icon).append("'");
5792 out.append("\n");
5793
5794 out.append(" disabled_by_default: ");
5795 out.append(YESNO(this->disabled_by_default));
5796 out.append("\n");
5797
5798 out.append(" entity_category: ");
5800 out.append("\n");
5801
5802 out.append(" assumed_state: ");
5803 out.append(YESNO(this->assumed_state));
5804 out.append("\n");
5805
5806 out.append(" supports_open: ");
5807 out.append(YESNO(this->supports_open));
5808 out.append("\n");
5809
5810 out.append(" requires_code: ");
5811 out.append(YESNO(this->requires_code));
5812 out.append("\n");
5813
5814 out.append(" code_format: ");
5815 out.append("'").append(this->code_format).append("'");
5816 out.append("\n");
5817 out.append("}");
5818}
5819#endif
5820bool LockStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
5821 switch (field_id) {
5822 case 2: {
5823 this->state = value.as_enum<enums::LockState>();
5824 return true;
5825 }
5826 default:
5827 return false;
5828 }
5829}
5830bool LockStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
5831 switch (field_id) {
5832 case 1: {
5833 this->key = value.as_fixed32();
5834 return true;
5835 }
5836 default:
5837 return false;
5838 }
5839}
5841 buffer.encode_fixed32(1, this->key);
5842 buffer.encode_enum<enums::LockState>(2, this->state);
5843}
5844void LockStateResponse::calculate_size(uint32_t &total_size) const {
5845 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5846 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state), false);
5847}
5848#ifdef HAS_PROTO_MESSAGE_DUMP
5849void LockStateResponse::dump_to(std::string &out) const {
5850 __attribute__((unused)) char buffer[64];
5851 out.append("LockStateResponse {\n");
5852 out.append(" key: ");
5853 sprintf(buffer, "%" PRIu32, this->key);
5854 out.append(buffer);
5855 out.append("\n");
5856
5857 out.append(" state: ");
5859 out.append("\n");
5860 out.append("}");
5861}
5862#endif
5863bool LockCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
5864 switch (field_id) {
5865 case 2: {
5866 this->command = value.as_enum<enums::LockCommand>();
5867 return true;
5868 }
5869 case 3: {
5870 this->has_code = value.as_bool();
5871 return true;
5872 }
5873 default:
5874 return false;
5875 }
5876}
5878 switch (field_id) {
5879 case 4: {
5880 this->code = value.as_string();
5881 return true;
5882 }
5883 default:
5884 return false;
5885 }
5886}
5887bool LockCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
5888 switch (field_id) {
5889 case 1: {
5890 this->key = value.as_fixed32();
5891 return true;
5892 }
5893 default:
5894 return false;
5895 }
5896}
5898 buffer.encode_fixed32(1, this->key);
5899 buffer.encode_enum<enums::LockCommand>(2, this->command);
5900 buffer.encode_bool(3, this->has_code);
5901 buffer.encode_string(4, this->code);
5902}
5903void LockCommandRequest::calculate_size(uint32_t &total_size) const {
5904 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5905 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->command), false);
5906 ProtoSize::add_bool_field(total_size, 1, this->has_code, false);
5907 ProtoSize::add_string_field(total_size, 1, this->code, false);
5908}
5909#ifdef HAS_PROTO_MESSAGE_DUMP
5910void LockCommandRequest::dump_to(std::string &out) const {
5911 __attribute__((unused)) char buffer[64];
5912 out.append("LockCommandRequest {\n");
5913 out.append(" key: ");
5914 sprintf(buffer, "%" PRIu32, this->key);
5915 out.append(buffer);
5916 out.append("\n");
5917
5918 out.append(" command: ");
5920 out.append("\n");
5921
5922 out.append(" has_code: ");
5923 out.append(YESNO(this->has_code));
5924 out.append("\n");
5925
5926 out.append(" code: ");
5927 out.append("'").append(this->code).append("'");
5928 out.append("\n");
5929 out.append("}");
5930}
5931#endif
5933 switch (field_id) {
5934 case 6: {
5935 this->disabled_by_default = value.as_bool();
5936 return true;
5937 }
5938 case 7: {
5940 return true;
5941 }
5942 default:
5943 return false;
5944 }
5945}
5947 switch (field_id) {
5948 case 1: {
5949 this->object_id = value.as_string();
5950 return true;
5951 }
5952 case 3: {
5953 this->name = value.as_string();
5954 return true;
5955 }
5956 case 4: {
5957 this->unique_id = value.as_string();
5958 return true;
5959 }
5960 case 5: {
5961 this->icon = value.as_string();
5962 return true;
5963 }
5964 case 8: {
5965 this->device_class = value.as_string();
5966 return true;
5967 }
5968 default:
5969 return false;
5970 }
5971}
5973 switch (field_id) {
5974 case 2: {
5975 this->key = value.as_fixed32();
5976 return true;
5977 }
5978 default:
5979 return false;
5980 }
5981}
5983 buffer.encode_string(1, this->object_id);
5984 buffer.encode_fixed32(2, this->key);
5985 buffer.encode_string(3, this->name);
5986 buffer.encode_string(4, this->unique_id);
5987 buffer.encode_string(5, this->icon);
5988 buffer.encode_bool(6, this->disabled_by_default);
5990 buffer.encode_string(8, this->device_class);
5991}
5992void ListEntitiesButtonResponse::calculate_size(uint32_t &total_size) const {
5993 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
5994 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
5995 ProtoSize::add_string_field(total_size, 1, this->name, false);
5996 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
5997 ProtoSize::add_string_field(total_size, 1, this->icon, false);
5998 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
5999 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
6000 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
6001}
6002#ifdef HAS_PROTO_MESSAGE_DUMP
6003void ListEntitiesButtonResponse::dump_to(std::string &out) const {
6004 __attribute__((unused)) char buffer[64];
6005 out.append("ListEntitiesButtonResponse {\n");
6006 out.append(" object_id: ");
6007 out.append("'").append(this->object_id).append("'");
6008 out.append("\n");
6009
6010 out.append(" key: ");
6011 sprintf(buffer, "%" PRIu32, this->key);
6012 out.append(buffer);
6013 out.append("\n");
6014
6015 out.append(" name: ");
6016 out.append("'").append(this->name).append("'");
6017 out.append("\n");
6018
6019 out.append(" unique_id: ");
6020 out.append("'").append(this->unique_id).append("'");
6021 out.append("\n");
6022
6023 out.append(" icon: ");
6024 out.append("'").append(this->icon).append("'");
6025 out.append("\n");
6026
6027 out.append(" disabled_by_default: ");
6028 out.append(YESNO(this->disabled_by_default));
6029 out.append("\n");
6030
6031 out.append(" entity_category: ");
6033 out.append("\n");
6034
6035 out.append(" device_class: ");
6036 out.append("'").append(this->device_class).append("'");
6037 out.append("\n");
6038 out.append("}");
6039}
6040#endif
6041bool ButtonCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
6042 switch (field_id) {
6043 case 1: {
6044 this->key = value.as_fixed32();
6045 return true;
6046 }
6047 default:
6048 return false;
6049 }
6050}
6051void ButtonCommandRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->key); }
6052void ButtonCommandRequest::calculate_size(uint32_t &total_size) const {
6053 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
6054}
6055#ifdef HAS_PROTO_MESSAGE_DUMP
6056void ButtonCommandRequest::dump_to(std::string &out) const {
6057 __attribute__((unused)) char buffer[64];
6058 out.append("ButtonCommandRequest {\n");
6059 out.append(" key: ");
6060 sprintf(buffer, "%" PRIu32, this->key);
6061 out.append(buffer);
6062 out.append("\n");
6063 out.append("}");
6064}
6065#endif
6067 switch (field_id) {
6068 case 2: {
6069 this->sample_rate = value.as_uint32();
6070 return true;
6071 }
6072 case 3: {
6073 this->num_channels = value.as_uint32();
6074 return true;
6075 }
6076 case 4: {
6078 return true;
6079 }
6080 case 5: {
6081 this->sample_bytes = value.as_uint32();
6082 return true;
6083 }
6084 default:
6085 return false;
6086 }
6087}
6089 switch (field_id) {
6090 case 1: {
6091 this->format = value.as_string();
6092 return true;
6093 }
6094 default:
6095 return false;
6096 }
6097}
6099 buffer.encode_string(1, this->format);
6100 buffer.encode_uint32(2, this->sample_rate);
6101 buffer.encode_uint32(3, this->num_channels);
6103 buffer.encode_uint32(5, this->sample_bytes);
6104}
6105void MediaPlayerSupportedFormat::calculate_size(uint32_t &total_size) const {
6106 ProtoSize::add_string_field(total_size, 1, this->format, false);
6107 ProtoSize::add_uint32_field(total_size, 1, this->sample_rate, false);
6108 ProtoSize::add_uint32_field(total_size, 1, this->num_channels, false);
6109 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->purpose), false);
6110 ProtoSize::add_uint32_field(total_size, 1, this->sample_bytes, false);
6111}
6112#ifdef HAS_PROTO_MESSAGE_DUMP
6113void MediaPlayerSupportedFormat::dump_to(std::string &out) const {
6114 __attribute__((unused)) char buffer[64];
6115 out.append("MediaPlayerSupportedFormat {\n");
6116 out.append(" format: ");
6117 out.append("'").append(this->format).append("'");
6118 out.append("\n");
6119
6120 out.append(" sample_rate: ");
6121 sprintf(buffer, "%" PRIu32, this->sample_rate);
6122 out.append(buffer);
6123 out.append("\n");
6124
6125 out.append(" num_channels: ");
6126 sprintf(buffer, "%" PRIu32, this->num_channels);
6127 out.append(buffer);
6128 out.append("\n");
6129
6130 out.append(" purpose: ");
6132 out.append("\n");
6133
6134 out.append(" sample_bytes: ");
6135 sprintf(buffer, "%" PRIu32, this->sample_bytes);
6136 out.append(buffer);
6137 out.append("\n");
6138 out.append("}");
6139}
6140#endif
6142 switch (field_id) {
6143 case 6: {
6144 this->disabled_by_default = value.as_bool();
6145 return true;
6146 }
6147 case 7: {
6149 return true;
6150 }
6151 case 8: {
6152 this->supports_pause = value.as_bool();
6153 return true;
6154 }
6155 default:
6156 return false;
6157 }
6158}
6160 switch (field_id) {
6161 case 1: {
6162 this->object_id = value.as_string();
6163 return true;
6164 }
6165 case 3: {
6166 this->name = value.as_string();
6167 return true;
6168 }
6169 case 4: {
6170 this->unique_id = value.as_string();
6171 return true;
6172 }
6173 case 5: {
6174 this->icon = value.as_string();
6175 return true;
6176 }
6177 case 9: {
6179 return true;
6180 }
6181 default:
6182 return false;
6183 }
6184}
6186 switch (field_id) {
6187 case 2: {
6188 this->key = value.as_fixed32();
6189 return true;
6190 }
6191 default:
6192 return false;
6193 }
6194}
6196 buffer.encode_string(1, this->object_id);
6197 buffer.encode_fixed32(2, this->key);
6198 buffer.encode_string(3, this->name);
6199 buffer.encode_string(4, this->unique_id);
6200 buffer.encode_string(5, this->icon);
6201 buffer.encode_bool(6, this->disabled_by_default);
6203 buffer.encode_bool(8, this->supports_pause);
6204 for (auto &it : this->supported_formats) {
6205 buffer.encode_message<MediaPlayerSupportedFormat>(9, it, true);
6206 }
6207}
6208void ListEntitiesMediaPlayerResponse::calculate_size(uint32_t &total_size) const {
6209 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
6210 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
6211 ProtoSize::add_string_field(total_size, 1, this->name, false);
6212 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
6213 ProtoSize::add_string_field(total_size, 1, this->icon, false);
6214 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
6215 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
6216 ProtoSize::add_bool_field(total_size, 1, this->supports_pause, false);
6218}
6219#ifdef HAS_PROTO_MESSAGE_DUMP
6220void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const {
6221 __attribute__((unused)) char buffer[64];
6222 out.append("ListEntitiesMediaPlayerResponse {\n");
6223 out.append(" object_id: ");
6224 out.append("'").append(this->object_id).append("'");
6225 out.append("\n");
6226
6227 out.append(" key: ");
6228 sprintf(buffer, "%" PRIu32, this->key);
6229 out.append(buffer);
6230 out.append("\n");
6231
6232 out.append(" name: ");
6233 out.append("'").append(this->name).append("'");
6234 out.append("\n");
6235
6236 out.append(" unique_id: ");
6237 out.append("'").append(this->unique_id).append("'");
6238 out.append("\n");
6239
6240 out.append(" icon: ");
6241 out.append("'").append(this->icon).append("'");
6242 out.append("\n");
6243
6244 out.append(" disabled_by_default: ");
6245 out.append(YESNO(this->disabled_by_default));
6246 out.append("\n");
6247
6248 out.append(" entity_category: ");
6250 out.append("\n");
6251
6252 out.append(" supports_pause: ");
6253 out.append(YESNO(this->supports_pause));
6254 out.append("\n");
6255
6256 for (const auto &it : this->supported_formats) {
6257 out.append(" supported_formats: ");
6258 it.dump_to(out);
6259 out.append("\n");
6260 }
6261 out.append("}");
6262}
6263#endif
6265 switch (field_id) {
6266 case 2: {
6267 this->state = value.as_enum<enums::MediaPlayerState>();
6268 return true;
6269 }
6270 case 4: {
6271 this->muted = value.as_bool();
6272 return true;
6273 }
6274 default:
6275 return false;
6276 }
6277}
6279 switch (field_id) {
6280 case 1: {
6281 this->key = value.as_fixed32();
6282 return true;
6283 }
6284 case 3: {
6285 this->volume = value.as_float();
6286 return true;
6287 }
6288 default:
6289 return false;
6290 }
6291}
6293 buffer.encode_fixed32(1, this->key);
6294 buffer.encode_enum<enums::MediaPlayerState>(2, this->state);
6295 buffer.encode_float(3, this->volume);
6296 buffer.encode_bool(4, this->muted);
6297}
6298void MediaPlayerStateResponse::calculate_size(uint32_t &total_size) const {
6299 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
6300 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state), false);
6301 ProtoSize::add_fixed_field<4>(total_size, 1, this->volume != 0.0f, false);
6302 ProtoSize::add_bool_field(total_size, 1, this->muted, false);
6303}
6304#ifdef HAS_PROTO_MESSAGE_DUMP
6305void MediaPlayerStateResponse::dump_to(std::string &out) const {
6306 __attribute__((unused)) char buffer[64];
6307 out.append("MediaPlayerStateResponse {\n");
6308 out.append(" key: ");
6309 sprintf(buffer, "%" PRIu32, this->key);
6310 out.append(buffer);
6311 out.append("\n");
6312
6313 out.append(" state: ");
6315 out.append("\n");
6316
6317 out.append(" volume: ");
6318 sprintf(buffer, "%g", this->volume);
6319 out.append(buffer);
6320 out.append("\n");
6321
6322 out.append(" muted: ");
6323 out.append(YESNO(this->muted));
6324 out.append("\n");
6325 out.append("}");
6326}
6327#endif
6329 switch (field_id) {
6330 case 2: {
6331 this->has_command = value.as_bool();
6332 return true;
6333 }
6334 case 3: {
6335 this->command = value.as_enum<enums::MediaPlayerCommand>();
6336 return true;
6337 }
6338 case 4: {
6339 this->has_volume = value.as_bool();
6340 return true;
6341 }
6342 case 6: {
6343 this->has_media_url = value.as_bool();
6344 return true;
6345 }
6346 case 8: {
6347 this->has_announcement = value.as_bool();
6348 return true;
6349 }
6350 case 9: {
6351 this->announcement = value.as_bool();
6352 return true;
6353 }
6354 default:
6355 return false;
6356 }
6357}
6359 switch (field_id) {
6360 case 7: {
6361 this->media_url = value.as_string();
6362 return true;
6363 }
6364 default:
6365 return false;
6366 }
6367}
6369 switch (field_id) {
6370 case 1: {
6371 this->key = value.as_fixed32();
6372 return true;
6373 }
6374 case 5: {
6375 this->volume = value.as_float();
6376 return true;
6377 }
6378 default:
6379 return false;
6380 }
6381}
6383 buffer.encode_fixed32(1, this->key);
6384 buffer.encode_bool(2, this->has_command);
6386 buffer.encode_bool(4, this->has_volume);
6387 buffer.encode_float(5, this->volume);
6388 buffer.encode_bool(6, this->has_media_url);
6389 buffer.encode_string(7, this->media_url);
6390 buffer.encode_bool(8, this->has_announcement);
6391 buffer.encode_bool(9, this->announcement);
6392}
6393void MediaPlayerCommandRequest::calculate_size(uint32_t &total_size) const {
6394 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
6395 ProtoSize::add_bool_field(total_size, 1, this->has_command, false);
6396 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->command), false);
6397 ProtoSize::add_bool_field(total_size, 1, this->has_volume, false);
6398 ProtoSize::add_fixed_field<4>(total_size, 1, this->volume != 0.0f, false);
6399 ProtoSize::add_bool_field(total_size, 1, this->has_media_url, false);
6400 ProtoSize::add_string_field(total_size, 1, this->media_url, false);
6401 ProtoSize::add_bool_field(total_size, 1, this->has_announcement, false);
6402 ProtoSize::add_bool_field(total_size, 1, this->announcement, false);
6403}
6404#ifdef HAS_PROTO_MESSAGE_DUMP
6405void MediaPlayerCommandRequest::dump_to(std::string &out) const {
6406 __attribute__((unused)) char buffer[64];
6407 out.append("MediaPlayerCommandRequest {\n");
6408 out.append(" key: ");
6409 sprintf(buffer, "%" PRIu32, this->key);
6410 out.append(buffer);
6411 out.append("\n");
6412
6413 out.append(" has_command: ");
6414 out.append(YESNO(this->has_command));
6415 out.append("\n");
6416
6417 out.append(" command: ");
6419 out.append("\n");
6420
6421 out.append(" has_volume: ");
6422 out.append(YESNO(this->has_volume));
6423 out.append("\n");
6424
6425 out.append(" volume: ");
6426 sprintf(buffer, "%g", this->volume);
6427 out.append(buffer);
6428 out.append("\n");
6429
6430 out.append(" has_media_url: ");
6431 out.append(YESNO(this->has_media_url));
6432 out.append("\n");
6433
6434 out.append(" media_url: ");
6435 out.append("'").append(this->media_url).append("'");
6436 out.append("\n");
6437
6438 out.append(" has_announcement: ");
6439 out.append(YESNO(this->has_announcement));
6440 out.append("\n");
6441
6442 out.append(" announcement: ");
6443 out.append(YESNO(this->announcement));
6444 out.append("\n");
6445 out.append("}");
6446}
6447#endif
6449 switch (field_id) {
6450 case 1: {
6451 this->flags = value.as_uint32();
6452 return true;
6453 }
6454 default:
6455 return false;
6456 }
6457}
6462 ProtoSize::add_uint32_field(total_size, 1, this->flags, false);
6463}
6464#ifdef HAS_PROTO_MESSAGE_DUMP
6466 __attribute__((unused)) char buffer[64];
6467 out.append("SubscribeBluetoothLEAdvertisementsRequest {\n");
6468 out.append(" flags: ");
6469 sprintf(buffer, "%" PRIu32, this->flags);
6470 out.append(buffer);
6471 out.append("\n");
6472 out.append("}");
6473}
6474#endif
6475bool BluetoothServiceData::decode_varint(uint32_t field_id, ProtoVarInt value) {
6476 switch (field_id) {
6477 case 2: {
6478 this->legacy_data.push_back(value.as_uint32());
6479 return true;
6480 }
6481 default:
6482 return false;
6483 }
6484}
6486 switch (field_id) {
6487 case 1: {
6488 this->uuid = value.as_string();
6489 return true;
6490 }
6491 case 3: {
6492 this->data = value.as_string();
6493 return true;
6494 }
6495 default:
6496 return false;
6497 }
6498}
6500 buffer.encode_string(1, this->uuid);
6501 for (auto &it : this->legacy_data) {
6502 buffer.encode_uint32(2, it, true);
6503 }
6504 buffer.encode_string(3, this->data);
6505}
6506void BluetoothServiceData::calculate_size(uint32_t &total_size) const {
6507 ProtoSize::add_string_field(total_size, 1, this->uuid, false);
6508 if (!this->legacy_data.empty()) {
6509 for (const auto &it : this->legacy_data) {
6510 ProtoSize::add_uint32_field(total_size, 1, it, true);
6511 }
6512 }
6513 ProtoSize::add_string_field(total_size, 1, this->data, false);
6514}
6515#ifdef HAS_PROTO_MESSAGE_DUMP
6516void BluetoothServiceData::dump_to(std::string &out) const {
6517 __attribute__((unused)) char buffer[64];
6518 out.append("BluetoothServiceData {\n");
6519 out.append(" uuid: ");
6520 out.append("'").append(this->uuid).append("'");
6521 out.append("\n");
6522
6523 for (const auto &it : this->legacy_data) {
6524 out.append(" legacy_data: ");
6525 sprintf(buffer, "%" PRIu32, it);
6526 out.append(buffer);
6527 out.append("\n");
6528 }
6529
6530 out.append(" data: ");
6531 out.append("'").append(this->data).append("'");
6532 out.append("\n");
6533 out.append("}");
6534}
6535#endif
6537 switch (field_id) {
6538 case 1: {
6539 this->address = value.as_uint64();
6540 return true;
6541 }
6542 case 3: {
6543 this->rssi = value.as_sint32();
6544 return true;
6545 }
6546 case 7: {
6547 this->address_type = value.as_uint32();
6548 return true;
6549 }
6550 default:
6551 return false;
6552 }
6553}
6555 switch (field_id) {
6556 case 2: {
6557 this->name = value.as_string();
6558 return true;
6559 }
6560 case 4: {
6561 this->service_uuids.push_back(value.as_string());
6562 return true;
6563 }
6564 case 5: {
6565 this->service_data.push_back(value.as_message<BluetoothServiceData>());
6566 return true;
6567 }
6568 case 6: {
6569 this->manufacturer_data.push_back(value.as_message<BluetoothServiceData>());
6570 return true;
6571 }
6572 default:
6573 return false;
6574 }
6575}
6577 buffer.encode_uint64(1, this->address);
6578 buffer.encode_string(2, this->name);
6579 buffer.encode_sint32(3, this->rssi);
6580 for (auto &it : this->service_uuids) {
6581 buffer.encode_string(4, it, true);
6582 }
6583 for (auto &it : this->service_data) {
6584 buffer.encode_message<BluetoothServiceData>(5, it, true);
6585 }
6586 for (auto &it : this->manufacturer_data) {
6587 buffer.encode_message<BluetoothServiceData>(6, it, true);
6588 }
6589 buffer.encode_uint32(7, this->address_type);
6590}
6592 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6593 ProtoSize::add_string_field(total_size, 1, this->name, false);
6594 ProtoSize::add_sint32_field(total_size, 1, this->rssi, false);
6595 if (!this->service_uuids.empty()) {
6596 for (const auto &it : this->service_uuids) {
6597 ProtoSize::add_string_field(total_size, 1, it, true);
6598 }
6599 }
6600 ProtoSize::add_repeated_message(total_size, 1, this->service_data);
6602 ProtoSize::add_uint32_field(total_size, 1, this->address_type, false);
6603}
6604#ifdef HAS_PROTO_MESSAGE_DUMP
6605void BluetoothLEAdvertisementResponse::dump_to(std::string &out) const {
6606 __attribute__((unused)) char buffer[64];
6607 out.append("BluetoothLEAdvertisementResponse {\n");
6608 out.append(" address: ");
6609 sprintf(buffer, "%llu", this->address);
6610 out.append(buffer);
6611 out.append("\n");
6612
6613 out.append(" name: ");
6614 out.append("'").append(this->name).append("'");
6615 out.append("\n");
6616
6617 out.append(" rssi: ");
6618 sprintf(buffer, "%" PRId32, this->rssi);
6619 out.append(buffer);
6620 out.append("\n");
6621
6622 for (const auto &it : this->service_uuids) {
6623 out.append(" service_uuids: ");
6624 out.append("'").append(it).append("'");
6625 out.append("\n");
6626 }
6627
6628 for (const auto &it : this->service_data) {
6629 out.append(" service_data: ");
6630 it.dump_to(out);
6631 out.append("\n");
6632 }
6633
6634 for (const auto &it : this->manufacturer_data) {
6635 out.append(" manufacturer_data: ");
6636 it.dump_to(out);
6637 out.append("\n");
6638 }
6639
6640 out.append(" address_type: ");
6641 sprintf(buffer, "%" PRIu32, this->address_type);
6642 out.append(buffer);
6643 out.append("\n");
6644 out.append("}");
6645}
6646#endif
6648 switch (field_id) {
6649 case 1: {
6650 this->address = value.as_uint64();
6651 return true;
6652 }
6653 case 2: {
6654 this->rssi = value.as_sint32();
6655 return true;
6656 }
6657 case 3: {
6658 this->address_type = value.as_uint32();
6659 return true;
6660 }
6661 default:
6662 return false;
6663 }
6664}
6666 switch (field_id) {
6667 case 4: {
6668 this->data = value.as_string();
6669 return true;
6670 }
6671 default:
6672 return false;
6673 }
6674}
6676 buffer.encode_uint64(1, this->address);
6677 buffer.encode_sint32(2, this->rssi);
6678 buffer.encode_uint32(3, this->address_type);
6679 buffer.encode_string(4, this->data);
6680}
6681void BluetoothLERawAdvertisement::calculate_size(uint32_t &total_size) const {
6682 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6683 ProtoSize::add_sint32_field(total_size, 1, this->rssi, false);
6684 ProtoSize::add_uint32_field(total_size, 1, this->address_type, false);
6685 ProtoSize::add_string_field(total_size, 1, this->data, false);
6686}
6687#ifdef HAS_PROTO_MESSAGE_DUMP
6688void BluetoothLERawAdvertisement::dump_to(std::string &out) const {
6689 __attribute__((unused)) char buffer[64];
6690 out.append("BluetoothLERawAdvertisement {\n");
6691 out.append(" address: ");
6692 sprintf(buffer, "%llu", this->address);
6693 out.append(buffer);
6694 out.append("\n");
6695
6696 out.append(" rssi: ");
6697 sprintf(buffer, "%" PRId32, this->rssi);
6698 out.append(buffer);
6699 out.append("\n");
6700
6701 out.append(" address_type: ");
6702 sprintf(buffer, "%" PRIu32, this->address_type);
6703 out.append(buffer);
6704 out.append("\n");
6705
6706 out.append(" data: ");
6707 out.append("'").append(this->data).append("'");
6708 out.append("\n");
6709 out.append("}");
6710}
6711#endif
6713 switch (field_id) {
6714 case 1: {
6715 this->advertisements.push_back(value.as_message<BluetoothLERawAdvertisement>());
6716 return true;
6717 }
6718 default:
6719 return false;
6720 }
6721}
6723 for (auto &it : this->advertisements) {
6724 buffer.encode_message<BluetoothLERawAdvertisement>(1, it, true);
6725 }
6726}
6728 ProtoSize::add_repeated_message(total_size, 1, this->advertisements);
6729}
6730#ifdef HAS_PROTO_MESSAGE_DUMP
6732 __attribute__((unused)) char buffer[64];
6733 out.append("BluetoothLERawAdvertisementsResponse {\n");
6734 for (const auto &it : this->advertisements) {
6735 out.append(" advertisements: ");
6736 it.dump_to(out);
6737 out.append("\n");
6738 }
6739 out.append("}");
6740}
6741#endif
6743 switch (field_id) {
6744 case 1: {
6745 this->address = value.as_uint64();
6746 return true;
6747 }
6748 case 2: {
6750 return true;
6751 }
6752 case 3: {
6753 this->has_address_type = value.as_bool();
6754 return true;
6755 }
6756 case 4: {
6757 this->address_type = value.as_uint32();
6758 return true;
6759 }
6760 default:
6761 return false;
6762 }
6763}
6765 buffer.encode_uint64(1, this->address);
6767 buffer.encode_bool(3, this->has_address_type);
6768 buffer.encode_uint32(4, this->address_type);
6769}
6770void BluetoothDeviceRequest::calculate_size(uint32_t &total_size) const {
6771 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6772 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->request_type), false);
6773 ProtoSize::add_bool_field(total_size, 1, this->has_address_type, false);
6774 ProtoSize::add_uint32_field(total_size, 1, this->address_type, false);
6775}
6776#ifdef HAS_PROTO_MESSAGE_DUMP
6777void BluetoothDeviceRequest::dump_to(std::string &out) const {
6778 __attribute__((unused)) char buffer[64];
6779 out.append("BluetoothDeviceRequest {\n");
6780 out.append(" address: ");
6781 sprintf(buffer, "%llu", this->address);
6782 out.append(buffer);
6783 out.append("\n");
6784
6785 out.append(" request_type: ");
6787 out.append("\n");
6788
6789 out.append(" has_address_type: ");
6790 out.append(YESNO(this->has_address_type));
6791 out.append("\n");
6792
6793 out.append(" address_type: ");
6794 sprintf(buffer, "%" PRIu32, this->address_type);
6795 out.append(buffer);
6796 out.append("\n");
6797 out.append("}");
6798}
6799#endif
6801 switch (field_id) {
6802 case 1: {
6803 this->address = value.as_uint64();
6804 return true;
6805 }
6806 case 2: {
6807 this->connected = value.as_bool();
6808 return true;
6809 }
6810 case 3: {
6811 this->mtu = value.as_uint32();
6812 return true;
6813 }
6814 case 4: {
6815 this->error = value.as_int32();
6816 return true;
6817 }
6818 default:
6819 return false;
6820 }
6821}
6823 buffer.encode_uint64(1, this->address);
6824 buffer.encode_bool(2, this->connected);
6825 buffer.encode_uint32(3, this->mtu);
6826 buffer.encode_int32(4, this->error);
6827}
6829 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6830 ProtoSize::add_bool_field(total_size, 1, this->connected, false);
6831 ProtoSize::add_uint32_field(total_size, 1, this->mtu, false);
6832 ProtoSize::add_int32_field(total_size, 1, this->error, false);
6833}
6834#ifdef HAS_PROTO_MESSAGE_DUMP
6836 __attribute__((unused)) char buffer[64];
6837 out.append("BluetoothDeviceConnectionResponse {\n");
6838 out.append(" address: ");
6839 sprintf(buffer, "%llu", this->address);
6840 out.append(buffer);
6841 out.append("\n");
6842
6843 out.append(" connected: ");
6844 out.append(YESNO(this->connected));
6845 out.append("\n");
6846
6847 out.append(" mtu: ");
6848 sprintf(buffer, "%" PRIu32, this->mtu);
6849 out.append(buffer);
6850 out.append("\n");
6851
6852 out.append(" error: ");
6853 sprintf(buffer, "%" PRId32, this->error);
6854 out.append(buffer);
6855 out.append("\n");
6856 out.append("}");
6857}
6858#endif
6860 switch (field_id) {
6861 case 1: {
6862 this->address = value.as_uint64();
6863 return true;
6864 }
6865 default:
6866 return false;
6867 }
6868}
6870void BluetoothGATTGetServicesRequest::calculate_size(uint32_t &total_size) const {
6871 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
6872}
6873#ifdef HAS_PROTO_MESSAGE_DUMP
6874void BluetoothGATTGetServicesRequest::dump_to(std::string &out) const {
6875 __attribute__((unused)) char buffer[64];
6876 out.append("BluetoothGATTGetServicesRequest {\n");
6877 out.append(" address: ");
6878 sprintf(buffer, "%llu", this->address);
6879 out.append(buffer);
6880 out.append("\n");
6881 out.append("}");
6882}
6883#endif
6885 switch (field_id) {
6886 case 1: {
6887 this->uuid.push_back(value.as_uint64());
6888 return true;
6889 }
6890 case 2: {
6891 this->handle = value.as_uint32();
6892 return true;
6893 }
6894 default:
6895 return false;
6896 }
6897}
6899 for (auto &it : this->uuid) {
6900 buffer.encode_uint64(1, it, true);
6901 }
6902 buffer.encode_uint32(2, this->handle);
6903}
6904void BluetoothGATTDescriptor::calculate_size(uint32_t &total_size) const {
6905 if (!this->uuid.empty()) {
6906 for (const auto &it : this->uuid) {
6907 ProtoSize::add_uint64_field(total_size, 1, it, true);
6908 }
6909 }
6910 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
6911}
6912#ifdef HAS_PROTO_MESSAGE_DUMP
6913void BluetoothGATTDescriptor::dump_to(std::string &out) const {
6914 __attribute__((unused)) char buffer[64];
6915 out.append("BluetoothGATTDescriptor {\n");
6916 for (const auto &it : this->uuid) {
6917 out.append(" uuid: ");
6918 sprintf(buffer, "%llu", it);
6919 out.append(buffer);
6920 out.append("\n");
6921 }
6922
6923 out.append(" handle: ");
6924 sprintf(buffer, "%" PRIu32, this->handle);
6925 out.append(buffer);
6926 out.append("\n");
6927 out.append("}");
6928}
6929#endif
6931 switch (field_id) {
6932 case 1: {
6933 this->uuid.push_back(value.as_uint64());
6934 return true;
6935 }
6936 case 2: {
6937 this->handle = value.as_uint32();
6938 return true;
6939 }
6940 case 3: {
6941 this->properties = value.as_uint32();
6942 return true;
6943 }
6944 default:
6945 return false;
6946 }
6947}
6949 switch (field_id) {
6950 case 4: {
6951 this->descriptors.push_back(value.as_message<BluetoothGATTDescriptor>());
6952 return true;
6953 }
6954 default:
6955 return false;
6956 }
6957}
6959 for (auto &it : this->uuid) {
6960 buffer.encode_uint64(1, it, true);
6961 }
6962 buffer.encode_uint32(2, this->handle);
6963 buffer.encode_uint32(3, this->properties);
6964 for (auto &it : this->descriptors) {
6965 buffer.encode_message<BluetoothGATTDescriptor>(4, it, true);
6966 }
6967}
6968void BluetoothGATTCharacteristic::calculate_size(uint32_t &total_size) const {
6969 if (!this->uuid.empty()) {
6970 for (const auto &it : this->uuid) {
6971 ProtoSize::add_uint64_field(total_size, 1, it, true);
6972 }
6973 }
6974 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
6975 ProtoSize::add_uint32_field(total_size, 1, this->properties, false);
6976 ProtoSize::add_repeated_message(total_size, 1, this->descriptors);
6977}
6978#ifdef HAS_PROTO_MESSAGE_DUMP
6979void BluetoothGATTCharacteristic::dump_to(std::string &out) const {
6980 __attribute__((unused)) char buffer[64];
6981 out.append("BluetoothGATTCharacteristic {\n");
6982 for (const auto &it : this->uuid) {
6983 out.append(" uuid: ");
6984 sprintf(buffer, "%llu", it);
6985 out.append(buffer);
6986 out.append("\n");
6987 }
6988
6989 out.append(" handle: ");
6990 sprintf(buffer, "%" PRIu32, this->handle);
6991 out.append(buffer);
6992 out.append("\n");
6993
6994 out.append(" properties: ");
6995 sprintf(buffer, "%" PRIu32, this->properties);
6996 out.append(buffer);
6997 out.append("\n");
6998
6999 for (const auto &it : this->descriptors) {
7000 out.append(" descriptors: ");
7001 it.dump_to(out);
7002 out.append("\n");
7003 }
7004 out.append("}");
7005}
7006#endif
7007bool BluetoothGATTService::decode_varint(uint32_t field_id, ProtoVarInt value) {
7008 switch (field_id) {
7009 case 1: {
7010 this->uuid.push_back(value.as_uint64());
7011 return true;
7012 }
7013 case 2: {
7014 this->handle = value.as_uint32();
7015 return true;
7016 }
7017 default:
7018 return false;
7019 }
7020}
7022 switch (field_id) {
7023 case 3: {
7024 this->characteristics.push_back(value.as_message<BluetoothGATTCharacteristic>());
7025 return true;
7026 }
7027 default:
7028 return false;
7029 }
7030}
7032 for (auto &it : this->uuid) {
7033 buffer.encode_uint64(1, it, true);
7034 }
7035 buffer.encode_uint32(2, this->handle);
7036 for (auto &it : this->characteristics) {
7037 buffer.encode_message<BluetoothGATTCharacteristic>(3, it, true);
7038 }
7039}
7040void BluetoothGATTService::calculate_size(uint32_t &total_size) const {
7041 if (!this->uuid.empty()) {
7042 for (const auto &it : this->uuid) {
7043 ProtoSize::add_uint64_field(total_size, 1, it, true);
7044 }
7045 }
7046 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7048}
7049#ifdef HAS_PROTO_MESSAGE_DUMP
7050void BluetoothGATTService::dump_to(std::string &out) const {
7051 __attribute__((unused)) char buffer[64];
7052 out.append("BluetoothGATTService {\n");
7053 for (const auto &it : this->uuid) {
7054 out.append(" uuid: ");
7055 sprintf(buffer, "%llu", it);
7056 out.append(buffer);
7057 out.append("\n");
7058 }
7059
7060 out.append(" handle: ");
7061 sprintf(buffer, "%" PRIu32, this->handle);
7062 out.append(buffer);
7063 out.append("\n");
7064
7065 for (const auto &it : this->characteristics) {
7066 out.append(" characteristics: ");
7067 it.dump_to(out);
7068 out.append("\n");
7069 }
7070 out.append("}");
7071}
7072#endif
7074 switch (field_id) {
7075 case 1: {
7076 this->address = value.as_uint64();
7077 return true;
7078 }
7079 default:
7080 return false;
7081 }
7082}
7084 switch (field_id) {
7085 case 2: {
7086 this->services.push_back(value.as_message<BluetoothGATTService>());
7087 return true;
7088 }
7089 default:
7090 return false;
7091 }
7092}
7094 buffer.encode_uint64(1, this->address);
7095 for (auto &it : this->services) {
7096 buffer.encode_message<BluetoothGATTService>(2, it, true);
7097 }
7098}
7100 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7101 ProtoSize::add_repeated_message(total_size, 1, this->services);
7102}
7103#ifdef HAS_PROTO_MESSAGE_DUMP
7104void BluetoothGATTGetServicesResponse::dump_to(std::string &out) const {
7105 __attribute__((unused)) char buffer[64];
7106 out.append("BluetoothGATTGetServicesResponse {\n");
7107 out.append(" address: ");
7108 sprintf(buffer, "%llu", this->address);
7109 out.append(buffer);
7110 out.append("\n");
7111
7112 for (const auto &it : this->services) {
7113 out.append(" services: ");
7114 it.dump_to(out);
7115 out.append("\n");
7116 }
7117 out.append("}");
7118}
7119#endif
7121 switch (field_id) {
7122 case 1: {
7123 this->address = value.as_uint64();
7124 return true;
7125 }
7126 default:
7127 return false;
7128 }
7129}
7134 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7135}
7136#ifdef HAS_PROTO_MESSAGE_DUMP
7138 __attribute__((unused)) char buffer[64];
7139 out.append("BluetoothGATTGetServicesDoneResponse {\n");
7140 out.append(" address: ");
7141 sprintf(buffer, "%llu", this->address);
7142 out.append(buffer);
7143 out.append("\n");
7144 out.append("}");
7145}
7146#endif
7148 switch (field_id) {
7149 case 1: {
7150 this->address = value.as_uint64();
7151 return true;
7152 }
7153 case 2: {
7154 this->handle = value.as_uint32();
7155 return true;
7156 }
7157 default:
7158 return false;
7159 }
7160}
7162 buffer.encode_uint64(1, this->address);
7163 buffer.encode_uint32(2, this->handle);
7164}
7165void BluetoothGATTReadRequest::calculate_size(uint32_t &total_size) const {
7166 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7167 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7168}
7169#ifdef HAS_PROTO_MESSAGE_DUMP
7170void BluetoothGATTReadRequest::dump_to(std::string &out) const {
7171 __attribute__((unused)) char buffer[64];
7172 out.append("BluetoothGATTReadRequest {\n");
7173 out.append(" address: ");
7174 sprintf(buffer, "%llu", this->address);
7175 out.append(buffer);
7176 out.append("\n");
7177
7178 out.append(" handle: ");
7179 sprintf(buffer, "%" PRIu32, this->handle);
7180 out.append(buffer);
7181 out.append("\n");
7182 out.append("}");
7183}
7184#endif
7186 switch (field_id) {
7187 case 1: {
7188 this->address = value.as_uint64();
7189 return true;
7190 }
7191 case 2: {
7192 this->handle = value.as_uint32();
7193 return true;
7194 }
7195 default:
7196 return false;
7197 }
7198}
7200 switch (field_id) {
7201 case 3: {
7202 this->data = value.as_string();
7203 return true;
7204 }
7205 default:
7206 return false;
7207 }
7208}
7210 buffer.encode_uint64(1, this->address);
7211 buffer.encode_uint32(2, this->handle);
7212 buffer.encode_string(3, this->data);
7213}
7214void BluetoothGATTReadResponse::calculate_size(uint32_t &total_size) const {
7215 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7216 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7217 ProtoSize::add_string_field(total_size, 1, this->data, false);
7218}
7219#ifdef HAS_PROTO_MESSAGE_DUMP
7220void BluetoothGATTReadResponse::dump_to(std::string &out) const {
7221 __attribute__((unused)) char buffer[64];
7222 out.append("BluetoothGATTReadResponse {\n");
7223 out.append(" address: ");
7224 sprintf(buffer, "%llu", this->address);
7225 out.append(buffer);
7226 out.append("\n");
7227
7228 out.append(" handle: ");
7229 sprintf(buffer, "%" PRIu32, this->handle);
7230 out.append(buffer);
7231 out.append("\n");
7232
7233 out.append(" data: ");
7234 out.append("'").append(this->data).append("'");
7235 out.append("\n");
7236 out.append("}");
7237}
7238#endif
7240 switch (field_id) {
7241 case 1: {
7242 this->address = value.as_uint64();
7243 return true;
7244 }
7245 case 2: {
7246 this->handle = value.as_uint32();
7247 return true;
7248 }
7249 case 3: {
7250 this->response = value.as_bool();
7251 return true;
7252 }
7253 default:
7254 return false;
7255 }
7256}
7258 switch (field_id) {
7259 case 4: {
7260 this->data = value.as_string();
7261 return true;
7262 }
7263 default:
7264 return false;
7265 }
7266}
7268 buffer.encode_uint64(1, this->address);
7269 buffer.encode_uint32(2, this->handle);
7270 buffer.encode_bool(3, this->response);
7271 buffer.encode_string(4, this->data);
7272}
7273void BluetoothGATTWriteRequest::calculate_size(uint32_t &total_size) const {
7274 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7275 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7276 ProtoSize::add_bool_field(total_size, 1, this->response, false);
7277 ProtoSize::add_string_field(total_size, 1, this->data, false);
7278}
7279#ifdef HAS_PROTO_MESSAGE_DUMP
7280void BluetoothGATTWriteRequest::dump_to(std::string &out) const {
7281 __attribute__((unused)) char buffer[64];
7282 out.append("BluetoothGATTWriteRequest {\n");
7283 out.append(" address: ");
7284 sprintf(buffer, "%llu", this->address);
7285 out.append(buffer);
7286 out.append("\n");
7287
7288 out.append(" handle: ");
7289 sprintf(buffer, "%" PRIu32, this->handle);
7290 out.append(buffer);
7291 out.append("\n");
7292
7293 out.append(" response: ");
7294 out.append(YESNO(this->response));
7295 out.append("\n");
7296
7297 out.append(" data: ");
7298 out.append("'").append(this->data).append("'");
7299 out.append("\n");
7300 out.append("}");
7301}
7302#endif
7304 switch (field_id) {
7305 case 1: {
7306 this->address = value.as_uint64();
7307 return true;
7308 }
7309 case 2: {
7310 this->handle = value.as_uint32();
7311 return true;
7312 }
7313 default:
7314 return false;
7315 }
7316}
7318 buffer.encode_uint64(1, this->address);
7319 buffer.encode_uint32(2, this->handle);
7320}
7322 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7323 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7324}
7325#ifdef HAS_PROTO_MESSAGE_DUMP
7327 __attribute__((unused)) char buffer[64];
7328 out.append("BluetoothGATTReadDescriptorRequest {\n");
7329 out.append(" address: ");
7330 sprintf(buffer, "%llu", this->address);
7331 out.append(buffer);
7332 out.append("\n");
7333
7334 out.append(" handle: ");
7335 sprintf(buffer, "%" PRIu32, this->handle);
7336 out.append(buffer);
7337 out.append("\n");
7338 out.append("}");
7339}
7340#endif
7342 switch (field_id) {
7343 case 1: {
7344 this->address = value.as_uint64();
7345 return true;
7346 }
7347 case 2: {
7348 this->handle = value.as_uint32();
7349 return true;
7350 }
7351 default:
7352 return false;
7353 }
7354}
7356 switch (field_id) {
7357 case 3: {
7358 this->data = value.as_string();
7359 return true;
7360 }
7361 default:
7362 return false;
7363 }
7364}
7366 buffer.encode_uint64(1, this->address);
7367 buffer.encode_uint32(2, this->handle);
7368 buffer.encode_string(3, this->data);
7369}
7371 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7372 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7373 ProtoSize::add_string_field(total_size, 1, this->data, false);
7374}
7375#ifdef HAS_PROTO_MESSAGE_DUMP
7377 __attribute__((unused)) char buffer[64];
7378 out.append("BluetoothGATTWriteDescriptorRequest {\n");
7379 out.append(" address: ");
7380 sprintf(buffer, "%llu", this->address);
7381 out.append(buffer);
7382 out.append("\n");
7383
7384 out.append(" handle: ");
7385 sprintf(buffer, "%" PRIu32, this->handle);
7386 out.append(buffer);
7387 out.append("\n");
7388
7389 out.append(" data: ");
7390 out.append("'").append(this->data).append("'");
7391 out.append("\n");
7392 out.append("}");
7393}
7394#endif
7396 switch (field_id) {
7397 case 1: {
7398 this->address = value.as_uint64();
7399 return true;
7400 }
7401 case 2: {
7402 this->handle = value.as_uint32();
7403 return true;
7404 }
7405 case 3: {
7406 this->enable = value.as_bool();
7407 return true;
7408 }
7409 default:
7410 return false;
7411 }
7412}
7414 buffer.encode_uint64(1, this->address);
7415 buffer.encode_uint32(2, this->handle);
7416 buffer.encode_bool(3, this->enable);
7417}
7418void BluetoothGATTNotifyRequest::calculate_size(uint32_t &total_size) const {
7419 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7420 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7421 ProtoSize::add_bool_field(total_size, 1, this->enable, false);
7422}
7423#ifdef HAS_PROTO_MESSAGE_DUMP
7424void BluetoothGATTNotifyRequest::dump_to(std::string &out) const {
7425 __attribute__((unused)) char buffer[64];
7426 out.append("BluetoothGATTNotifyRequest {\n");
7427 out.append(" address: ");
7428 sprintf(buffer, "%llu", this->address);
7429 out.append(buffer);
7430 out.append("\n");
7431
7432 out.append(" handle: ");
7433 sprintf(buffer, "%" PRIu32, this->handle);
7434 out.append(buffer);
7435 out.append("\n");
7436
7437 out.append(" enable: ");
7438 out.append(YESNO(this->enable));
7439 out.append("\n");
7440 out.append("}");
7441}
7442#endif
7444 switch (field_id) {
7445 case 1: {
7446 this->address = value.as_uint64();
7447 return true;
7448 }
7449 case 2: {
7450 this->handle = value.as_uint32();
7451 return true;
7452 }
7453 default:
7454 return false;
7455 }
7456}
7458 switch (field_id) {
7459 case 3: {
7460 this->data = value.as_string();
7461 return true;
7462 }
7463 default:
7464 return false;
7465 }
7466}
7468 buffer.encode_uint64(1, this->address);
7469 buffer.encode_uint32(2, this->handle);
7470 buffer.encode_string(3, this->data);
7471}
7472void BluetoothGATTNotifyDataResponse::calculate_size(uint32_t &total_size) const {
7473 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7474 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7475 ProtoSize::add_string_field(total_size, 1, this->data, false);
7476}
7477#ifdef HAS_PROTO_MESSAGE_DUMP
7478void BluetoothGATTNotifyDataResponse::dump_to(std::string &out) const {
7479 __attribute__((unused)) char buffer[64];
7480 out.append("BluetoothGATTNotifyDataResponse {\n");
7481 out.append(" address: ");
7482 sprintf(buffer, "%llu", this->address);
7483 out.append(buffer);
7484 out.append("\n");
7485
7486 out.append(" handle: ");
7487 sprintf(buffer, "%" PRIu32, this->handle);
7488 out.append(buffer);
7489 out.append("\n");
7490
7491 out.append(" data: ");
7492 out.append("'").append(this->data).append("'");
7493 out.append("\n");
7494 out.append("}");
7495}
7496#endif
7499#ifdef HAS_PROTO_MESSAGE_DUMP
7501 out.append("SubscribeBluetoothConnectionsFreeRequest {}");
7502}
7503#endif
7505 switch (field_id) {
7506 case 1: {
7507 this->free = value.as_uint32();
7508 return true;
7509 }
7510 case 2: {
7511 this->limit = value.as_uint32();
7512 return true;
7513 }
7514 case 3: {
7515 this->allocated.push_back(value.as_uint64());
7516 return true;
7517 }
7518 default:
7519 return false;
7520 }
7521}
7523 buffer.encode_uint32(1, this->free);
7524 buffer.encode_uint32(2, this->limit);
7525 for (auto &it : this->allocated) {
7526 buffer.encode_uint64(3, it, true);
7527 }
7528}
7530 ProtoSize::add_uint32_field(total_size, 1, this->free, false);
7531 ProtoSize::add_uint32_field(total_size, 1, this->limit, false);
7532 if (!this->allocated.empty()) {
7533 for (const auto &it : this->allocated) {
7534 ProtoSize::add_uint64_field(total_size, 1, it, true);
7535 }
7536 }
7537}
7538#ifdef HAS_PROTO_MESSAGE_DUMP
7539void BluetoothConnectionsFreeResponse::dump_to(std::string &out) const {
7540 __attribute__((unused)) char buffer[64];
7541 out.append("BluetoothConnectionsFreeResponse {\n");
7542 out.append(" free: ");
7543 sprintf(buffer, "%" PRIu32, this->free);
7544 out.append(buffer);
7545 out.append("\n");
7546
7547 out.append(" limit: ");
7548 sprintf(buffer, "%" PRIu32, this->limit);
7549 out.append(buffer);
7550 out.append("\n");
7551
7552 for (const auto &it : this->allocated) {
7553 out.append(" allocated: ");
7554 sprintf(buffer, "%llu", it);
7555 out.append(buffer);
7556 out.append("\n");
7557 }
7558 out.append("}");
7559}
7560#endif
7562 switch (field_id) {
7563 case 1: {
7564 this->address = value.as_uint64();
7565 return true;
7566 }
7567 case 2: {
7568 this->handle = value.as_uint32();
7569 return true;
7570 }
7571 case 3: {
7572 this->error = value.as_int32();
7573 return true;
7574 }
7575 default:
7576 return false;
7577 }
7578}
7580 buffer.encode_uint64(1, this->address);
7581 buffer.encode_uint32(2, this->handle);
7582 buffer.encode_int32(3, this->error);
7583}
7584void BluetoothGATTErrorResponse::calculate_size(uint32_t &total_size) const {
7585 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7586 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7587 ProtoSize::add_int32_field(total_size, 1, this->error, false);
7588}
7589#ifdef HAS_PROTO_MESSAGE_DUMP
7590void BluetoothGATTErrorResponse::dump_to(std::string &out) const {
7591 __attribute__((unused)) char buffer[64];
7592 out.append("BluetoothGATTErrorResponse {\n");
7593 out.append(" address: ");
7594 sprintf(buffer, "%llu", this->address);
7595 out.append(buffer);
7596 out.append("\n");
7597
7598 out.append(" handle: ");
7599 sprintf(buffer, "%" PRIu32, this->handle);
7600 out.append(buffer);
7601 out.append("\n");
7602
7603 out.append(" error: ");
7604 sprintf(buffer, "%" PRId32, this->error);
7605 out.append(buffer);
7606 out.append("\n");
7607 out.append("}");
7608}
7609#endif
7611 switch (field_id) {
7612 case 1: {
7613 this->address = value.as_uint64();
7614 return true;
7615 }
7616 case 2: {
7617 this->handle = value.as_uint32();
7618 return true;
7619 }
7620 default:
7621 return false;
7622 }
7623}
7625 buffer.encode_uint64(1, this->address);
7626 buffer.encode_uint32(2, this->handle);
7627}
7628void BluetoothGATTWriteResponse::calculate_size(uint32_t &total_size) const {
7629 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7630 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7631}
7632#ifdef HAS_PROTO_MESSAGE_DUMP
7633void BluetoothGATTWriteResponse::dump_to(std::string &out) const {
7634 __attribute__((unused)) char buffer[64];
7635 out.append("BluetoothGATTWriteResponse {\n");
7636 out.append(" address: ");
7637 sprintf(buffer, "%llu", this->address);
7638 out.append(buffer);
7639 out.append("\n");
7640
7641 out.append(" handle: ");
7642 sprintf(buffer, "%" PRIu32, this->handle);
7643 out.append(buffer);
7644 out.append("\n");
7645 out.append("}");
7646}
7647#endif
7649 switch (field_id) {
7650 case 1: {
7651 this->address = value.as_uint64();
7652 return true;
7653 }
7654 case 2: {
7655 this->handle = value.as_uint32();
7656 return true;
7657 }
7658 default:
7659 return false;
7660 }
7661}
7663 buffer.encode_uint64(1, this->address);
7664 buffer.encode_uint32(2, this->handle);
7665}
7666void BluetoothGATTNotifyResponse::calculate_size(uint32_t &total_size) const {
7667 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7668 ProtoSize::add_uint32_field(total_size, 1, this->handle, false);
7669}
7670#ifdef HAS_PROTO_MESSAGE_DUMP
7671void BluetoothGATTNotifyResponse::dump_to(std::string &out) const {
7672 __attribute__((unused)) char buffer[64];
7673 out.append("BluetoothGATTNotifyResponse {\n");
7674 out.append(" address: ");
7675 sprintf(buffer, "%llu", this->address);
7676 out.append(buffer);
7677 out.append("\n");
7678
7679 out.append(" handle: ");
7680 sprintf(buffer, "%" PRIu32, this->handle);
7681 out.append(buffer);
7682 out.append("\n");
7683 out.append("}");
7684}
7685#endif
7687 switch (field_id) {
7688 case 1: {
7689 this->address = value.as_uint64();
7690 return true;
7691 }
7692 case 2: {
7693 this->paired = value.as_bool();
7694 return true;
7695 }
7696 case 3: {
7697 this->error = value.as_int32();
7698 return true;
7699 }
7700 default:
7701 return false;
7702 }
7703}
7705 buffer.encode_uint64(1, this->address);
7706 buffer.encode_bool(2, this->paired);
7707 buffer.encode_int32(3, this->error);
7708}
7709void BluetoothDevicePairingResponse::calculate_size(uint32_t &total_size) const {
7710 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7711 ProtoSize::add_bool_field(total_size, 1, this->paired, false);
7712 ProtoSize::add_int32_field(total_size, 1, this->error, false);
7713}
7714#ifdef HAS_PROTO_MESSAGE_DUMP
7715void BluetoothDevicePairingResponse::dump_to(std::string &out) const {
7716 __attribute__((unused)) char buffer[64];
7717 out.append("BluetoothDevicePairingResponse {\n");
7718 out.append(" address: ");
7719 sprintf(buffer, "%llu", this->address);
7720 out.append(buffer);
7721 out.append("\n");
7722
7723 out.append(" paired: ");
7724 out.append(YESNO(this->paired));
7725 out.append("\n");
7726
7727 out.append(" error: ");
7728 sprintf(buffer, "%" PRId32, this->error);
7729 out.append(buffer);
7730 out.append("\n");
7731 out.append("}");
7732}
7733#endif
7735 switch (field_id) {
7736 case 1: {
7737 this->address = value.as_uint64();
7738 return true;
7739 }
7740 case 2: {
7741 this->success = value.as_bool();
7742 return true;
7743 }
7744 case 3: {
7745 this->error = value.as_int32();
7746 return true;
7747 }
7748 default:
7749 return false;
7750 }
7751}
7753 buffer.encode_uint64(1, this->address);
7754 buffer.encode_bool(2, this->success);
7755 buffer.encode_int32(3, this->error);
7756}
7758 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7759 ProtoSize::add_bool_field(total_size, 1, this->success, false);
7760 ProtoSize::add_int32_field(total_size, 1, this->error, false);
7761}
7762#ifdef HAS_PROTO_MESSAGE_DUMP
7763void BluetoothDeviceUnpairingResponse::dump_to(std::string &out) const {
7764 __attribute__((unused)) char buffer[64];
7765 out.append("BluetoothDeviceUnpairingResponse {\n");
7766 out.append(" address: ");
7767 sprintf(buffer, "%llu", this->address);
7768 out.append(buffer);
7769 out.append("\n");
7770
7771 out.append(" success: ");
7772 out.append(YESNO(this->success));
7773 out.append("\n");
7774
7775 out.append(" error: ");
7776 sprintf(buffer, "%" PRId32, this->error);
7777 out.append(buffer);
7778 out.append("\n");
7779 out.append("}");
7780}
7781#endif
7784#ifdef HAS_PROTO_MESSAGE_DUMP
7786 out.append("UnsubscribeBluetoothLEAdvertisementsRequest {}");
7787}
7788#endif
7790 switch (field_id) {
7791 case 1: {
7792 this->address = value.as_uint64();
7793 return true;
7794 }
7795 case 2: {
7796 this->success = value.as_bool();
7797 return true;
7798 }
7799 case 3: {
7800 this->error = value.as_int32();
7801 return true;
7802 }
7803 default:
7804 return false;
7805 }
7806}
7808 buffer.encode_uint64(1, this->address);
7809 buffer.encode_bool(2, this->success);
7810 buffer.encode_int32(3, this->error);
7811}
7813 ProtoSize::add_uint64_field(total_size, 1, this->address, false);
7814 ProtoSize::add_bool_field(total_size, 1, this->success, false);
7815 ProtoSize::add_int32_field(total_size, 1, this->error, false);
7816}
7817#ifdef HAS_PROTO_MESSAGE_DUMP
7819 __attribute__((unused)) char buffer[64];
7820 out.append("BluetoothDeviceClearCacheResponse {\n");
7821 out.append(" address: ");
7822 sprintf(buffer, "%llu", this->address);
7823 out.append(buffer);
7824 out.append("\n");
7825
7826 out.append(" success: ");
7827 out.append(YESNO(this->success));
7828 out.append("\n");
7829
7830 out.append(" error: ");
7831 sprintf(buffer, "%" PRId32, this->error);
7832 out.append(buffer);
7833 out.append("\n");
7834 out.append("}");
7835}
7836#endif
7838 switch (field_id) {
7839 case 1: {
7841 return true;
7842 }
7843 case 2: {
7844 this->mode = value.as_enum<enums::BluetoothScannerMode>();
7845 return true;
7846 }
7847 default:
7848 return false;
7849 }
7850}
7855void BluetoothScannerStateResponse::calculate_size(uint32_t &total_size) const {
7856 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state), false);
7857 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
7858}
7859#ifdef HAS_PROTO_MESSAGE_DUMP
7860void BluetoothScannerStateResponse::dump_to(std::string &out) const {
7861 __attribute__((unused)) char buffer[64];
7862 out.append("BluetoothScannerStateResponse {\n");
7863 out.append(" state: ");
7865 out.append("\n");
7866
7867 out.append(" mode: ");
7869 out.append("\n");
7870 out.append("}");
7871}
7872#endif
7874 switch (field_id) {
7875 case 1: {
7876 this->mode = value.as_enum<enums::BluetoothScannerMode>();
7877 return true;
7878 }
7879 default:
7880 return false;
7881 }
7882}
7886void BluetoothScannerSetModeRequest::calculate_size(uint32_t &total_size) const {
7887 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
7888}
7889#ifdef HAS_PROTO_MESSAGE_DUMP
7890void BluetoothScannerSetModeRequest::dump_to(std::string &out) const {
7891 __attribute__((unused)) char buffer[64];
7892 out.append("BluetoothScannerSetModeRequest {\n");
7893 out.append(" mode: ");
7895 out.append("\n");
7896 out.append("}");
7897}
7898#endif
7900 switch (field_id) {
7901 case 1: {
7902 this->subscribe = value.as_bool();
7903 return true;
7904 }
7905 case 2: {
7906 this->flags = value.as_uint32();
7907 return true;
7908 }
7909 default:
7910 return false;
7911 }
7912}
7914 buffer.encode_bool(1, this->subscribe);
7915 buffer.encode_uint32(2, this->flags);
7916}
7917void SubscribeVoiceAssistantRequest::calculate_size(uint32_t &total_size) const {
7918 ProtoSize::add_bool_field(total_size, 1, this->subscribe, false);
7919 ProtoSize::add_uint32_field(total_size, 1, this->flags, false);
7920}
7921#ifdef HAS_PROTO_MESSAGE_DUMP
7922void SubscribeVoiceAssistantRequest::dump_to(std::string &out) const {
7923 __attribute__((unused)) char buffer[64];
7924 out.append("SubscribeVoiceAssistantRequest {\n");
7925 out.append(" subscribe: ");
7926 out.append(YESNO(this->subscribe));
7927 out.append("\n");
7928
7929 out.append(" flags: ");
7930 sprintf(buffer, "%" PRIu32, this->flags);
7931 out.append(buffer);
7932 out.append("\n");
7933 out.append("}");
7934}
7935#endif
7937 switch (field_id) {
7938 case 1: {
7939 this->noise_suppression_level = value.as_uint32();
7940 return true;
7941 }
7942 case 2: {
7943 this->auto_gain = value.as_uint32();
7944 return true;
7945 }
7946 default:
7947 return false;
7948 }
7949}
7951 switch (field_id) {
7952 case 3: {
7953 this->volume_multiplier = value.as_float();
7954 return true;
7955 }
7956 default:
7957 return false;
7958 }
7959}
7961 buffer.encode_uint32(1, this->noise_suppression_level);
7962 buffer.encode_uint32(2, this->auto_gain);
7963 buffer.encode_float(3, this->volume_multiplier);
7964}
7965void VoiceAssistantAudioSettings::calculate_size(uint32_t &total_size) const {
7966 ProtoSize::add_uint32_field(total_size, 1, this->noise_suppression_level, false);
7967 ProtoSize::add_uint32_field(total_size, 1, this->auto_gain, false);
7968 ProtoSize::add_fixed_field<4>(total_size, 1, this->volume_multiplier != 0.0f, false);
7969}
7970#ifdef HAS_PROTO_MESSAGE_DUMP
7971void VoiceAssistantAudioSettings::dump_to(std::string &out) const {
7972 __attribute__((unused)) char buffer[64];
7973 out.append("VoiceAssistantAudioSettings {\n");
7974 out.append(" noise_suppression_level: ");
7975 sprintf(buffer, "%" PRIu32, this->noise_suppression_level);
7976 out.append(buffer);
7977 out.append("\n");
7978
7979 out.append(" auto_gain: ");
7980 sprintf(buffer, "%" PRIu32, this->auto_gain);
7981 out.append(buffer);
7982 out.append("\n");
7983
7984 out.append(" volume_multiplier: ");
7985 sprintf(buffer, "%g", this->volume_multiplier);
7986 out.append(buffer);
7987 out.append("\n");
7988 out.append("}");
7989}
7990#endif
7992 switch (field_id) {
7993 case 1: {
7994 this->start = value.as_bool();
7995 return true;
7996 }
7997 case 3: {
7998 this->flags = value.as_uint32();
7999 return true;
8000 }
8001 default:
8002 return false;
8003 }
8004}
8006 switch (field_id) {
8007 case 2: {
8008 this->conversation_id = value.as_string();
8009 return true;
8010 }
8011 case 4: {
8013 return true;
8014 }
8015 case 5: {
8016 this->wake_word_phrase = value.as_string();
8017 return true;
8018 }
8019 default:
8020 return false;
8021 }
8022}
8024 buffer.encode_bool(1, this->start);
8025 buffer.encode_string(2, this->conversation_id);
8026 buffer.encode_uint32(3, this->flags);
8028 buffer.encode_string(5, this->wake_word_phrase);
8029}
8030void VoiceAssistantRequest::calculate_size(uint32_t &total_size) const {
8031 ProtoSize::add_bool_field(total_size, 1, this->start, false);
8032 ProtoSize::add_string_field(total_size, 1, this->conversation_id, false);
8033 ProtoSize::add_uint32_field(total_size, 1, this->flags, false);
8034 ProtoSize::add_message_object(total_size, 1, this->audio_settings, false);
8035 ProtoSize::add_string_field(total_size, 1, this->wake_word_phrase, false);
8036}
8037#ifdef HAS_PROTO_MESSAGE_DUMP
8038void VoiceAssistantRequest::dump_to(std::string &out) const {
8039 __attribute__((unused)) char buffer[64];
8040 out.append("VoiceAssistantRequest {\n");
8041 out.append(" start: ");
8042 out.append(YESNO(this->start));
8043 out.append("\n");
8044
8045 out.append(" conversation_id: ");
8046 out.append("'").append(this->conversation_id).append("'");
8047 out.append("\n");
8048
8049 out.append(" flags: ");
8050 sprintf(buffer, "%" PRIu32, this->flags);
8051 out.append(buffer);
8052 out.append("\n");
8053
8054 out.append(" audio_settings: ");
8055 this->audio_settings.dump_to(out);
8056 out.append("\n");
8057
8058 out.append(" wake_word_phrase: ");
8059 out.append("'").append(this->wake_word_phrase).append("'");
8060 out.append("\n");
8061 out.append("}");
8062}
8063#endif
8065 switch (field_id) {
8066 case 1: {
8067 this->port = value.as_uint32();
8068 return true;
8069 }
8070 case 2: {
8071 this->error = value.as_bool();
8072 return true;
8073 }
8074 default:
8075 return false;
8076 }
8077}
8079 buffer.encode_uint32(1, this->port);
8080 buffer.encode_bool(2, this->error);
8081}
8082void VoiceAssistantResponse::calculate_size(uint32_t &total_size) const {
8083 ProtoSize::add_uint32_field(total_size, 1, this->port, false);
8084 ProtoSize::add_bool_field(total_size, 1, this->error, false);
8085}
8086#ifdef HAS_PROTO_MESSAGE_DUMP
8087void VoiceAssistantResponse::dump_to(std::string &out) const {
8088 __attribute__((unused)) char buffer[64];
8089 out.append("VoiceAssistantResponse {\n");
8090 out.append(" port: ");
8091 sprintf(buffer, "%" PRIu32, this->port);
8092 out.append(buffer);
8093 out.append("\n");
8094
8095 out.append(" error: ");
8096 out.append(YESNO(this->error));
8097 out.append("\n");
8098 out.append("}");
8099}
8100#endif
8102 switch (field_id) {
8103 case 1: {
8104 this->name = value.as_string();
8105 return true;
8106 }
8107 case 2: {
8108 this->value = value.as_string();
8109 return true;
8110 }
8111 default:
8112 return false;
8113 }
8114}
8116 buffer.encode_string(1, this->name);
8117 buffer.encode_string(2, this->value);
8118}
8119void VoiceAssistantEventData::calculate_size(uint32_t &total_size) const {
8120 ProtoSize::add_string_field(total_size, 1, this->name, false);
8121 ProtoSize::add_string_field(total_size, 1, this->value, false);
8122}
8123#ifdef HAS_PROTO_MESSAGE_DUMP
8124void VoiceAssistantEventData::dump_to(std::string &out) const {
8125 __attribute__((unused)) char buffer[64];
8126 out.append("VoiceAssistantEventData {\n");
8127 out.append(" name: ");
8128 out.append("'").append(this->name).append("'");
8129 out.append("\n");
8130
8131 out.append(" value: ");
8132 out.append("'").append(this->value).append("'");
8133 out.append("\n");
8134 out.append("}");
8135}
8136#endif
8138 switch (field_id) {
8139 case 1: {
8141 return true;
8142 }
8143 default:
8144 return false;
8145 }
8146}
8148 switch (field_id) {
8149 case 2: {
8150 this->data.push_back(value.as_message<VoiceAssistantEventData>());
8151 return true;
8152 }
8153 default:
8154 return false;
8155 }
8156}
8159 for (auto &it : this->data) {
8160 buffer.encode_message<VoiceAssistantEventData>(2, it, true);
8161 }
8162}
8163void VoiceAssistantEventResponse::calculate_size(uint32_t &total_size) const {
8164 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->event_type), false);
8165 ProtoSize::add_repeated_message(total_size, 1, this->data);
8166}
8167#ifdef HAS_PROTO_MESSAGE_DUMP
8168void VoiceAssistantEventResponse::dump_to(std::string &out) const {
8169 __attribute__((unused)) char buffer[64];
8170 out.append("VoiceAssistantEventResponse {\n");
8171 out.append(" event_type: ");
8173 out.append("\n");
8174
8175 for (const auto &it : this->data) {
8176 out.append(" data: ");
8177 it.dump_to(out);
8178 out.append("\n");
8179 }
8180 out.append("}");
8181}
8182#endif
8183bool VoiceAssistantAudio::decode_varint(uint32_t field_id, ProtoVarInt value) {
8184 switch (field_id) {
8185 case 2: {
8186 this->end = value.as_bool();
8187 return true;
8188 }
8189 default:
8190 return false;
8191 }
8192}
8194 switch (field_id) {
8195 case 1: {
8196 this->data = value.as_string();
8197 return true;
8198 }
8199 default:
8200 return false;
8201 }
8202}
8204 buffer.encode_string(1, this->data);
8205 buffer.encode_bool(2, this->end);
8206}
8207void VoiceAssistantAudio::calculate_size(uint32_t &total_size) const {
8208 ProtoSize::add_string_field(total_size, 1, this->data, false);
8209 ProtoSize::add_bool_field(total_size, 1, this->end, false);
8210}
8211#ifdef HAS_PROTO_MESSAGE_DUMP
8212void VoiceAssistantAudio::dump_to(std::string &out) const {
8213 __attribute__((unused)) char buffer[64];
8214 out.append("VoiceAssistantAudio {\n");
8215 out.append(" data: ");
8216 out.append("'").append(this->data).append("'");
8217 out.append("\n");
8218
8219 out.append(" end: ");
8220 out.append(YESNO(this->end));
8221 out.append("\n");
8222 out.append("}");
8223}
8224#endif
8226 switch (field_id) {
8227 case 1: {
8229 return true;
8230 }
8231 case 4: {
8232 this->total_seconds = value.as_uint32();
8233 return true;
8234 }
8235 case 5: {
8236 this->seconds_left = value.as_uint32();
8237 return true;
8238 }
8239 case 6: {
8240 this->is_active = value.as_bool();
8241 return true;
8242 }
8243 default:
8244 return false;
8245 }
8246}
8248 switch (field_id) {
8249 case 2: {
8250 this->timer_id = value.as_string();
8251 return true;
8252 }
8253 case 3: {
8254 this->name = value.as_string();
8255 return true;
8256 }
8257 default:
8258 return false;
8259 }
8260}
8263 buffer.encode_string(2, this->timer_id);
8264 buffer.encode_string(3, this->name);
8265 buffer.encode_uint32(4, this->total_seconds);
8266 buffer.encode_uint32(5, this->seconds_left);
8267 buffer.encode_bool(6, this->is_active);
8268}
8270 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->event_type), false);
8271 ProtoSize::add_string_field(total_size, 1, this->timer_id, false);
8272 ProtoSize::add_string_field(total_size, 1, this->name, false);
8273 ProtoSize::add_uint32_field(total_size, 1, this->total_seconds, false);
8274 ProtoSize::add_uint32_field(total_size, 1, this->seconds_left, false);
8275 ProtoSize::add_bool_field(total_size, 1, this->is_active, false);
8276}
8277#ifdef HAS_PROTO_MESSAGE_DUMP
8278void VoiceAssistantTimerEventResponse::dump_to(std::string &out) const {
8279 __attribute__((unused)) char buffer[64];
8280 out.append("VoiceAssistantTimerEventResponse {\n");
8281 out.append(" event_type: ");
8283 out.append("\n");
8284
8285 out.append(" timer_id: ");
8286 out.append("'").append(this->timer_id).append("'");
8287 out.append("\n");
8288
8289 out.append(" name: ");
8290 out.append("'").append(this->name).append("'");
8291 out.append("\n");
8292
8293 out.append(" total_seconds: ");
8294 sprintf(buffer, "%" PRIu32, this->total_seconds);
8295 out.append(buffer);
8296 out.append("\n");
8297
8298 out.append(" seconds_left: ");
8299 sprintf(buffer, "%" PRIu32, this->seconds_left);
8300 out.append(buffer);
8301 out.append("\n");
8302
8303 out.append(" is_active: ");
8304 out.append(YESNO(this->is_active));
8305 out.append("\n");
8306 out.append("}");
8307}
8308#endif
8310 switch (field_id) {
8311 case 4: {
8312 this->start_conversation = value.as_bool();
8313 return true;
8314 }
8315 default:
8316 return false;
8317 }
8318}
8320 switch (field_id) {
8321 case 1: {
8322 this->media_id = value.as_string();
8323 return true;
8324 }
8325 case 2: {
8326 this->text = value.as_string();
8327 return true;
8328 }
8329 case 3: {
8330 this->preannounce_media_id = value.as_string();
8331 return true;
8332 }
8333 default:
8334 return false;
8335 }
8336}
8338 buffer.encode_string(1, this->media_id);
8339 buffer.encode_string(2, this->text);
8340 buffer.encode_string(3, this->preannounce_media_id);
8341 buffer.encode_bool(4, this->start_conversation);
8342}
8343void VoiceAssistantAnnounceRequest::calculate_size(uint32_t &total_size) const {
8344 ProtoSize::add_string_field(total_size, 1, this->media_id, false);
8345 ProtoSize::add_string_field(total_size, 1, this->text, false);
8346 ProtoSize::add_string_field(total_size, 1, this->preannounce_media_id, false);
8347 ProtoSize::add_bool_field(total_size, 1, this->start_conversation, false);
8348}
8349#ifdef HAS_PROTO_MESSAGE_DUMP
8350void VoiceAssistantAnnounceRequest::dump_to(std::string &out) const {
8351 __attribute__((unused)) char buffer[64];
8352 out.append("VoiceAssistantAnnounceRequest {\n");
8353 out.append(" media_id: ");
8354 out.append("'").append(this->media_id).append("'");
8355 out.append("\n");
8356
8357 out.append(" text: ");
8358 out.append("'").append(this->text).append("'");
8359 out.append("\n");
8360
8361 out.append(" preannounce_media_id: ");
8362 out.append("'").append(this->preannounce_media_id).append("'");
8363 out.append("\n");
8364
8365 out.append(" start_conversation: ");
8366 out.append(YESNO(this->start_conversation));
8367 out.append("\n");
8368 out.append("}");
8369}
8370#endif
8372 switch (field_id) {
8373 case 1: {
8374 this->success = value.as_bool();
8375 return true;
8376 }
8377 default:
8378 return false;
8379 }
8380}
8382void VoiceAssistantAnnounceFinished::calculate_size(uint32_t &total_size) const {
8383 ProtoSize::add_bool_field(total_size, 1, this->success, false);
8384}
8385#ifdef HAS_PROTO_MESSAGE_DUMP
8386void VoiceAssistantAnnounceFinished::dump_to(std::string &out) const {
8387 __attribute__((unused)) char buffer[64];
8388 out.append("VoiceAssistantAnnounceFinished {\n");
8389 out.append(" success: ");
8390 out.append(YESNO(this->success));
8391 out.append("\n");
8392 out.append("}");
8393}
8394#endif
8396 switch (field_id) {
8397 case 1: {
8398 this->id = value.as_string();
8399 return true;
8400 }
8401 case 2: {
8402 this->wake_word = value.as_string();
8403 return true;
8404 }
8405 case 3: {
8406 this->trained_languages.push_back(value.as_string());
8407 return true;
8408 }
8409 default:
8410 return false;
8411 }
8412}
8414 buffer.encode_string(1, this->id);
8415 buffer.encode_string(2, this->wake_word);
8416 for (auto &it : this->trained_languages) {
8417 buffer.encode_string(3, it, true);
8418 }
8419}
8420void VoiceAssistantWakeWord::calculate_size(uint32_t &total_size) const {
8421 ProtoSize::add_string_field(total_size, 1, this->id, false);
8422 ProtoSize::add_string_field(total_size, 1, this->wake_word, false);
8423 if (!this->trained_languages.empty()) {
8424 for (const auto &it : this->trained_languages) {
8425 ProtoSize::add_string_field(total_size, 1, it, true);
8426 }
8427 }
8428}
8429#ifdef HAS_PROTO_MESSAGE_DUMP
8430void VoiceAssistantWakeWord::dump_to(std::string &out) const {
8431 __attribute__((unused)) char buffer[64];
8432 out.append("VoiceAssistantWakeWord {\n");
8433 out.append(" id: ");
8434 out.append("'").append(this->id).append("'");
8435 out.append("\n");
8436
8437 out.append(" wake_word: ");
8438 out.append("'").append(this->wake_word).append("'");
8439 out.append("\n");
8440
8441 for (const auto &it : this->trained_languages) {
8442 out.append(" trained_languages: ");
8443 out.append("'").append(it).append("'");
8444 out.append("\n");
8445 }
8446 out.append("}");
8447}
8448#endif
8451#ifdef HAS_PROTO_MESSAGE_DUMP
8453 out.append("VoiceAssistantConfigurationRequest {}");
8454}
8455#endif
8457 switch (field_id) {
8458 case 3: {
8459 this->max_active_wake_words = value.as_uint32();
8460 return true;
8461 }
8462 default:
8463 return false;
8464 }
8465}
8467 switch (field_id) {
8468 case 1: {
8469 this->available_wake_words.push_back(value.as_message<VoiceAssistantWakeWord>());
8470 return true;
8471 }
8472 case 2: {
8473 this->active_wake_words.push_back(value.as_string());
8474 return true;
8475 }
8476 default:
8477 return false;
8478 }
8479}
8481 for (auto &it : this->available_wake_words) {
8482 buffer.encode_message<VoiceAssistantWakeWord>(1, it, true);
8483 }
8484 for (auto &it : this->active_wake_words) {
8485 buffer.encode_string(2, it, true);
8486 }
8487 buffer.encode_uint32(3, this->max_active_wake_words);
8488}
8491 if (!this->active_wake_words.empty()) {
8492 for (const auto &it : this->active_wake_words) {
8493 ProtoSize::add_string_field(total_size, 1, it, true);
8494 }
8495 }
8496 ProtoSize::add_uint32_field(total_size, 1, this->max_active_wake_words, false);
8497}
8498#ifdef HAS_PROTO_MESSAGE_DUMP
8500 __attribute__((unused)) char buffer[64];
8501 out.append("VoiceAssistantConfigurationResponse {\n");
8502 for (const auto &it : this->available_wake_words) {
8503 out.append(" available_wake_words: ");
8504 it.dump_to(out);
8505 out.append("\n");
8506 }
8507
8508 for (const auto &it : this->active_wake_words) {
8509 out.append(" active_wake_words: ");
8510 out.append("'").append(it).append("'");
8511 out.append("\n");
8512 }
8513
8514 out.append(" max_active_wake_words: ");
8515 sprintf(buffer, "%" PRIu32, this->max_active_wake_words);
8516 out.append(buffer);
8517 out.append("\n");
8518 out.append("}");
8519}
8520#endif
8522 switch (field_id) {
8523 case 1: {
8524 this->active_wake_words.push_back(value.as_string());
8525 return true;
8526 }
8527 default:
8528 return false;
8529 }
8530}
8532 for (auto &it : this->active_wake_words) {
8533 buffer.encode_string(1, it, true);
8534 }
8535}
8536void VoiceAssistantSetConfiguration::calculate_size(uint32_t &total_size) const {
8537 if (!this->active_wake_words.empty()) {
8538 for (const auto &it : this->active_wake_words) {
8539 ProtoSize::add_string_field(total_size, 1, it, true);
8540 }
8541 }
8542}
8543#ifdef HAS_PROTO_MESSAGE_DUMP
8544void VoiceAssistantSetConfiguration::dump_to(std::string &out) const {
8545 __attribute__((unused)) char buffer[64];
8546 out.append("VoiceAssistantSetConfiguration {\n");
8547 for (const auto &it : this->active_wake_words) {
8548 out.append(" active_wake_words: ");
8549 out.append("'").append(it).append("'");
8550 out.append("\n");
8551 }
8552 out.append("}");
8553}
8554#endif
8556 switch (field_id) {
8557 case 6: {
8558 this->disabled_by_default = value.as_bool();
8559 return true;
8560 }
8561 case 7: {
8563 return true;
8564 }
8565 case 8: {
8566 this->supported_features = value.as_uint32();
8567 return true;
8568 }
8569 case 9: {
8570 this->requires_code = value.as_bool();
8571 return true;
8572 }
8573 case 10: {
8574 this->requires_code_to_arm = value.as_bool();
8575 return true;
8576 }
8577 default:
8578 return false;
8579 }
8580}
8582 switch (field_id) {
8583 case 1: {
8584 this->object_id = value.as_string();
8585 return true;
8586 }
8587 case 3: {
8588 this->name = value.as_string();
8589 return true;
8590 }
8591 case 4: {
8592 this->unique_id = value.as_string();
8593 return true;
8594 }
8595 case 5: {
8596 this->icon = value.as_string();
8597 return true;
8598 }
8599 default:
8600 return false;
8601 }
8602}
8604 switch (field_id) {
8605 case 2: {
8606 this->key = value.as_fixed32();
8607 return true;
8608 }
8609 default:
8610 return false;
8611 }
8612}
8614 buffer.encode_string(1, this->object_id);
8615 buffer.encode_fixed32(2, this->key);
8616 buffer.encode_string(3, this->name);
8617 buffer.encode_string(4, this->unique_id);
8618 buffer.encode_string(5, this->icon);
8619 buffer.encode_bool(6, this->disabled_by_default);
8621 buffer.encode_uint32(8, this->supported_features);
8622 buffer.encode_bool(9, this->requires_code);
8623 buffer.encode_bool(10, this->requires_code_to_arm);
8624}
8626 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
8627 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8628 ProtoSize::add_string_field(total_size, 1, this->name, false);
8629 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
8630 ProtoSize::add_string_field(total_size, 1, this->icon, false);
8631 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
8632 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
8633 ProtoSize::add_uint32_field(total_size, 1, this->supported_features, false);
8634 ProtoSize::add_bool_field(total_size, 1, this->requires_code, false);
8635 ProtoSize::add_bool_field(total_size, 1, this->requires_code_to_arm, false);
8636}
8637#ifdef HAS_PROTO_MESSAGE_DUMP
8639 __attribute__((unused)) char buffer[64];
8640 out.append("ListEntitiesAlarmControlPanelResponse {\n");
8641 out.append(" object_id: ");
8642 out.append("'").append(this->object_id).append("'");
8643 out.append("\n");
8644
8645 out.append(" key: ");
8646 sprintf(buffer, "%" PRIu32, this->key);
8647 out.append(buffer);
8648 out.append("\n");
8649
8650 out.append(" name: ");
8651 out.append("'").append(this->name).append("'");
8652 out.append("\n");
8653
8654 out.append(" unique_id: ");
8655 out.append("'").append(this->unique_id).append("'");
8656 out.append("\n");
8657
8658 out.append(" icon: ");
8659 out.append("'").append(this->icon).append("'");
8660 out.append("\n");
8661
8662 out.append(" disabled_by_default: ");
8663 out.append(YESNO(this->disabled_by_default));
8664 out.append("\n");
8665
8666 out.append(" entity_category: ");
8668 out.append("\n");
8669
8670 out.append(" supported_features: ");
8671 sprintf(buffer, "%" PRIu32, this->supported_features);
8672 out.append(buffer);
8673 out.append("\n");
8674
8675 out.append(" requires_code: ");
8676 out.append(YESNO(this->requires_code));
8677 out.append("\n");
8678
8679 out.append(" requires_code_to_arm: ");
8680 out.append(YESNO(this->requires_code_to_arm));
8681 out.append("\n");
8682 out.append("}");
8683}
8684#endif
8686 switch (field_id) {
8687 case 2: {
8689 return true;
8690 }
8691 default:
8692 return false;
8693 }
8694}
8696 switch (field_id) {
8697 case 1: {
8698 this->key = value.as_fixed32();
8699 return true;
8700 }
8701 default:
8702 return false;
8703 }
8704}
8706 buffer.encode_fixed32(1, this->key);
8708}
8709void AlarmControlPanelStateResponse::calculate_size(uint32_t &total_size) const {
8710 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8711 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state), false);
8712}
8713#ifdef HAS_PROTO_MESSAGE_DUMP
8714void AlarmControlPanelStateResponse::dump_to(std::string &out) const {
8715 __attribute__((unused)) char buffer[64];
8716 out.append("AlarmControlPanelStateResponse {\n");
8717 out.append(" key: ");
8718 sprintf(buffer, "%" PRIu32, this->key);
8719 out.append(buffer);
8720 out.append("\n");
8721
8722 out.append(" state: ");
8724 out.append("\n");
8725 out.append("}");
8726}
8727#endif
8729 switch (field_id) {
8730 case 2: {
8732 return true;
8733 }
8734 default:
8735 return false;
8736 }
8737}
8739 switch (field_id) {
8740 case 3: {
8741 this->code = value.as_string();
8742 return true;
8743 }
8744 default:
8745 return false;
8746 }
8747}
8749 switch (field_id) {
8750 case 1: {
8751 this->key = value.as_fixed32();
8752 return true;
8753 }
8754 default:
8755 return false;
8756 }
8757}
8759 buffer.encode_fixed32(1, this->key);
8761 buffer.encode_string(3, this->code);
8762}
8763void AlarmControlPanelCommandRequest::calculate_size(uint32_t &total_size) const {
8764 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8765 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->command), false);
8766 ProtoSize::add_string_field(total_size, 1, this->code, false);
8767}
8768#ifdef HAS_PROTO_MESSAGE_DUMP
8769void AlarmControlPanelCommandRequest::dump_to(std::string &out) const {
8770 __attribute__((unused)) char buffer[64];
8771 out.append("AlarmControlPanelCommandRequest {\n");
8772 out.append(" key: ");
8773 sprintf(buffer, "%" PRIu32, this->key);
8774 out.append(buffer);
8775 out.append("\n");
8776
8777 out.append(" command: ");
8779 out.append("\n");
8780
8781 out.append(" code: ");
8782 out.append("'").append(this->code).append("'");
8783 out.append("\n");
8784 out.append("}");
8785}
8786#endif
8788 switch (field_id) {
8789 case 6: {
8790 this->disabled_by_default = value.as_bool();
8791 return true;
8792 }
8793 case 7: {
8795 return true;
8796 }
8797 case 8: {
8798 this->min_length = value.as_uint32();
8799 return true;
8800 }
8801 case 9: {
8802 this->max_length = value.as_uint32();
8803 return true;
8804 }
8805 case 11: {
8806 this->mode = value.as_enum<enums::TextMode>();
8807 return true;
8808 }
8809 default:
8810 return false;
8811 }
8812}
8814 switch (field_id) {
8815 case 1: {
8816 this->object_id = value.as_string();
8817 return true;
8818 }
8819 case 3: {
8820 this->name = value.as_string();
8821 return true;
8822 }
8823 case 4: {
8824 this->unique_id = value.as_string();
8825 return true;
8826 }
8827 case 5: {
8828 this->icon = value.as_string();
8829 return true;
8830 }
8831 case 10: {
8832 this->pattern = value.as_string();
8833 return true;
8834 }
8835 default:
8836 return false;
8837 }
8838}
8840 switch (field_id) {
8841 case 2: {
8842 this->key = value.as_fixed32();
8843 return true;
8844 }
8845 default:
8846 return false;
8847 }
8848}
8850 buffer.encode_string(1, this->object_id);
8851 buffer.encode_fixed32(2, this->key);
8852 buffer.encode_string(3, this->name);
8853 buffer.encode_string(4, this->unique_id);
8854 buffer.encode_string(5, this->icon);
8855 buffer.encode_bool(6, this->disabled_by_default);
8857 buffer.encode_uint32(8, this->min_length);
8858 buffer.encode_uint32(9, this->max_length);
8859 buffer.encode_string(10, this->pattern);
8860 buffer.encode_enum<enums::TextMode>(11, this->mode);
8861}
8862void ListEntitiesTextResponse::calculate_size(uint32_t &total_size) const {
8863 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
8864 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8865 ProtoSize::add_string_field(total_size, 1, this->name, false);
8866 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
8867 ProtoSize::add_string_field(total_size, 1, this->icon, false);
8868 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
8869 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
8870 ProtoSize::add_uint32_field(total_size, 1, this->min_length, false);
8871 ProtoSize::add_uint32_field(total_size, 1, this->max_length, false);
8872 ProtoSize::add_string_field(total_size, 1, this->pattern, false);
8873 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode), false);
8874}
8875#ifdef HAS_PROTO_MESSAGE_DUMP
8876void ListEntitiesTextResponse::dump_to(std::string &out) const {
8877 __attribute__((unused)) char buffer[64];
8878 out.append("ListEntitiesTextResponse {\n");
8879 out.append(" object_id: ");
8880 out.append("'").append(this->object_id).append("'");
8881 out.append("\n");
8882
8883 out.append(" key: ");
8884 sprintf(buffer, "%" PRIu32, this->key);
8885 out.append(buffer);
8886 out.append("\n");
8887
8888 out.append(" name: ");
8889 out.append("'").append(this->name).append("'");
8890 out.append("\n");
8891
8892 out.append(" unique_id: ");
8893 out.append("'").append(this->unique_id).append("'");
8894 out.append("\n");
8895
8896 out.append(" icon: ");
8897 out.append("'").append(this->icon).append("'");
8898 out.append("\n");
8899
8900 out.append(" disabled_by_default: ");
8901 out.append(YESNO(this->disabled_by_default));
8902 out.append("\n");
8903
8904 out.append(" entity_category: ");
8906 out.append("\n");
8907
8908 out.append(" min_length: ");
8909 sprintf(buffer, "%" PRIu32, this->min_length);
8910 out.append(buffer);
8911 out.append("\n");
8912
8913 out.append(" max_length: ");
8914 sprintf(buffer, "%" PRIu32, this->max_length);
8915 out.append(buffer);
8916 out.append("\n");
8917
8918 out.append(" pattern: ");
8919 out.append("'").append(this->pattern).append("'");
8920 out.append("\n");
8921
8922 out.append(" mode: ");
8924 out.append("\n");
8925 out.append("}");
8926}
8927#endif
8928bool TextStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
8929 switch (field_id) {
8930 case 3: {
8931 this->missing_state = value.as_bool();
8932 return true;
8933 }
8934 default:
8935 return false;
8936 }
8937}
8939 switch (field_id) {
8940 case 2: {
8941 this->state = value.as_string();
8942 return true;
8943 }
8944 default:
8945 return false;
8946 }
8947}
8948bool TextStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
8949 switch (field_id) {
8950 case 1: {
8951 this->key = value.as_fixed32();
8952 return true;
8953 }
8954 default:
8955 return false;
8956 }
8957}
8959 buffer.encode_fixed32(1, this->key);
8960 buffer.encode_string(2, this->state);
8961 buffer.encode_bool(3, this->missing_state);
8962}
8963void TextStateResponse::calculate_size(uint32_t &total_size) const {
8964 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
8965 ProtoSize::add_string_field(total_size, 1, this->state, false);
8966 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
8967}
8968#ifdef HAS_PROTO_MESSAGE_DUMP
8969void TextStateResponse::dump_to(std::string &out) const {
8970 __attribute__((unused)) char buffer[64];
8971 out.append("TextStateResponse {\n");
8972 out.append(" key: ");
8973 sprintf(buffer, "%" PRIu32, this->key);
8974 out.append(buffer);
8975 out.append("\n");
8976
8977 out.append(" state: ");
8978 out.append("'").append(this->state).append("'");
8979 out.append("\n");
8980
8981 out.append(" missing_state: ");
8982 out.append(YESNO(this->missing_state));
8983 out.append("\n");
8984 out.append("}");
8985}
8986#endif
8988 switch (field_id) {
8989 case 2: {
8990 this->state = value.as_string();
8991 return true;
8992 }
8993 default:
8994 return false;
8995 }
8996}
8997bool TextCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
8998 switch (field_id) {
8999 case 1: {
9000 this->key = value.as_fixed32();
9001 return true;
9002 }
9003 default:
9004 return false;
9005 }
9006}
9008 buffer.encode_fixed32(1, this->key);
9009 buffer.encode_string(2, this->state);
9010}
9011void TextCommandRequest::calculate_size(uint32_t &total_size) const {
9012 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9013 ProtoSize::add_string_field(total_size, 1, this->state, false);
9014}
9015#ifdef HAS_PROTO_MESSAGE_DUMP
9016void TextCommandRequest::dump_to(std::string &out) const {
9017 __attribute__((unused)) char buffer[64];
9018 out.append("TextCommandRequest {\n");
9019 out.append(" key: ");
9020 sprintf(buffer, "%" PRIu32, this->key);
9021 out.append(buffer);
9022 out.append("\n");
9023
9024 out.append(" state: ");
9025 out.append("'").append(this->state).append("'");
9026 out.append("\n");
9027 out.append("}");
9028}
9029#endif
9031 switch (field_id) {
9032 case 6: {
9033 this->disabled_by_default = value.as_bool();
9034 return true;
9035 }
9036 case 7: {
9038 return true;
9039 }
9040 default:
9041 return false;
9042 }
9043}
9045 switch (field_id) {
9046 case 1: {
9047 this->object_id = value.as_string();
9048 return true;
9049 }
9050 case 3: {
9051 this->name = value.as_string();
9052 return true;
9053 }
9054 case 4: {
9055 this->unique_id = value.as_string();
9056 return true;
9057 }
9058 case 5: {
9059 this->icon = value.as_string();
9060 return true;
9061 }
9062 default:
9063 return false;
9064 }
9065}
9067 switch (field_id) {
9068 case 2: {
9069 this->key = value.as_fixed32();
9070 return true;
9071 }
9072 default:
9073 return false;
9074 }
9075}
9077 buffer.encode_string(1, this->object_id);
9078 buffer.encode_fixed32(2, this->key);
9079 buffer.encode_string(3, this->name);
9080 buffer.encode_string(4, this->unique_id);
9081 buffer.encode_string(5, this->icon);
9082 buffer.encode_bool(6, this->disabled_by_default);
9084}
9085void ListEntitiesDateResponse::calculate_size(uint32_t &total_size) const {
9086 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9087 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9088 ProtoSize::add_string_field(total_size, 1, this->name, false);
9089 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9090 ProtoSize::add_string_field(total_size, 1, this->icon, false);
9091 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
9092 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
9093}
9094#ifdef HAS_PROTO_MESSAGE_DUMP
9095void ListEntitiesDateResponse::dump_to(std::string &out) const {
9096 __attribute__((unused)) char buffer[64];
9097 out.append("ListEntitiesDateResponse {\n");
9098 out.append(" object_id: ");
9099 out.append("'").append(this->object_id).append("'");
9100 out.append("\n");
9101
9102 out.append(" key: ");
9103 sprintf(buffer, "%" PRIu32, this->key);
9104 out.append(buffer);
9105 out.append("\n");
9106
9107 out.append(" name: ");
9108 out.append("'").append(this->name).append("'");
9109 out.append("\n");
9110
9111 out.append(" unique_id: ");
9112 out.append("'").append(this->unique_id).append("'");
9113 out.append("\n");
9114
9115 out.append(" icon: ");
9116 out.append("'").append(this->icon).append("'");
9117 out.append("\n");
9118
9119 out.append(" disabled_by_default: ");
9120 out.append(YESNO(this->disabled_by_default));
9121 out.append("\n");
9122
9123 out.append(" entity_category: ");
9125 out.append("\n");
9126 out.append("}");
9127}
9128#endif
9129bool DateStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
9130 switch (field_id) {
9131 case 2: {
9132 this->missing_state = value.as_bool();
9133 return true;
9134 }
9135 case 3: {
9136 this->year = value.as_uint32();
9137 return true;
9138 }
9139 case 4: {
9140 this->month = value.as_uint32();
9141 return true;
9142 }
9143 case 5: {
9144 this->day = value.as_uint32();
9145 return true;
9146 }
9147 default:
9148 return false;
9149 }
9150}
9151bool DateStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
9152 switch (field_id) {
9153 case 1: {
9154 this->key = value.as_fixed32();
9155 return true;
9156 }
9157 default:
9158 return false;
9159 }
9160}
9162 buffer.encode_fixed32(1, this->key);
9163 buffer.encode_bool(2, this->missing_state);
9164 buffer.encode_uint32(3, this->year);
9165 buffer.encode_uint32(4, this->month);
9166 buffer.encode_uint32(5, this->day);
9167}
9168void DateStateResponse::calculate_size(uint32_t &total_size) const {
9169 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9170 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
9171 ProtoSize::add_uint32_field(total_size, 1, this->year, false);
9172 ProtoSize::add_uint32_field(total_size, 1, this->month, false);
9173 ProtoSize::add_uint32_field(total_size, 1, this->day, false);
9174}
9175#ifdef HAS_PROTO_MESSAGE_DUMP
9176void DateStateResponse::dump_to(std::string &out) const {
9177 __attribute__((unused)) char buffer[64];
9178 out.append("DateStateResponse {\n");
9179 out.append(" key: ");
9180 sprintf(buffer, "%" PRIu32, this->key);
9181 out.append(buffer);
9182 out.append("\n");
9183
9184 out.append(" missing_state: ");
9185 out.append(YESNO(this->missing_state));
9186 out.append("\n");
9187
9188 out.append(" year: ");
9189 sprintf(buffer, "%" PRIu32, this->year);
9190 out.append(buffer);
9191 out.append("\n");
9192
9193 out.append(" month: ");
9194 sprintf(buffer, "%" PRIu32, this->month);
9195 out.append(buffer);
9196 out.append("\n");
9197
9198 out.append(" day: ");
9199 sprintf(buffer, "%" PRIu32, this->day);
9200 out.append(buffer);
9201 out.append("\n");
9202 out.append("}");
9203}
9204#endif
9205bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
9206 switch (field_id) {
9207 case 2: {
9208 this->year = value.as_uint32();
9209 return true;
9210 }
9211 case 3: {
9212 this->month = value.as_uint32();
9213 return true;
9214 }
9215 case 4: {
9216 this->day = value.as_uint32();
9217 return true;
9218 }
9219 default:
9220 return false;
9221 }
9222}
9223bool DateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
9224 switch (field_id) {
9225 case 1: {
9226 this->key = value.as_fixed32();
9227 return true;
9228 }
9229 default:
9230 return false;
9231 }
9232}
9234 buffer.encode_fixed32(1, this->key);
9235 buffer.encode_uint32(2, this->year);
9236 buffer.encode_uint32(3, this->month);
9237 buffer.encode_uint32(4, this->day);
9238}
9239void DateCommandRequest::calculate_size(uint32_t &total_size) const {
9240 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9241 ProtoSize::add_uint32_field(total_size, 1, this->year, false);
9242 ProtoSize::add_uint32_field(total_size, 1, this->month, false);
9243 ProtoSize::add_uint32_field(total_size, 1, this->day, false);
9244}
9245#ifdef HAS_PROTO_MESSAGE_DUMP
9246void DateCommandRequest::dump_to(std::string &out) const {
9247 __attribute__((unused)) char buffer[64];
9248 out.append("DateCommandRequest {\n");
9249 out.append(" key: ");
9250 sprintf(buffer, "%" PRIu32, this->key);
9251 out.append(buffer);
9252 out.append("\n");
9253
9254 out.append(" year: ");
9255 sprintf(buffer, "%" PRIu32, this->year);
9256 out.append(buffer);
9257 out.append("\n");
9258
9259 out.append(" month: ");
9260 sprintf(buffer, "%" PRIu32, this->month);
9261 out.append(buffer);
9262 out.append("\n");
9263
9264 out.append(" day: ");
9265 sprintf(buffer, "%" PRIu32, this->day);
9266 out.append(buffer);
9267 out.append("\n");
9268 out.append("}");
9269}
9270#endif
9272 switch (field_id) {
9273 case 6: {
9274 this->disabled_by_default = value.as_bool();
9275 return true;
9276 }
9277 case 7: {
9279 return true;
9280 }
9281 default:
9282 return false;
9283 }
9284}
9286 switch (field_id) {
9287 case 1: {
9288 this->object_id = value.as_string();
9289 return true;
9290 }
9291 case 3: {
9292 this->name = value.as_string();
9293 return true;
9294 }
9295 case 4: {
9296 this->unique_id = value.as_string();
9297 return true;
9298 }
9299 case 5: {
9300 this->icon = value.as_string();
9301 return true;
9302 }
9303 default:
9304 return false;
9305 }
9306}
9308 switch (field_id) {
9309 case 2: {
9310 this->key = value.as_fixed32();
9311 return true;
9312 }
9313 default:
9314 return false;
9315 }
9316}
9318 buffer.encode_string(1, this->object_id);
9319 buffer.encode_fixed32(2, this->key);
9320 buffer.encode_string(3, this->name);
9321 buffer.encode_string(4, this->unique_id);
9322 buffer.encode_string(5, this->icon);
9323 buffer.encode_bool(6, this->disabled_by_default);
9325}
9326void ListEntitiesTimeResponse::calculate_size(uint32_t &total_size) const {
9327 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9328 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9329 ProtoSize::add_string_field(total_size, 1, this->name, false);
9330 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9331 ProtoSize::add_string_field(total_size, 1, this->icon, false);
9332 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
9333 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
9334}
9335#ifdef HAS_PROTO_MESSAGE_DUMP
9336void ListEntitiesTimeResponse::dump_to(std::string &out) const {
9337 __attribute__((unused)) char buffer[64];
9338 out.append("ListEntitiesTimeResponse {\n");
9339 out.append(" object_id: ");
9340 out.append("'").append(this->object_id).append("'");
9341 out.append("\n");
9342
9343 out.append(" key: ");
9344 sprintf(buffer, "%" PRIu32, this->key);
9345 out.append(buffer);
9346 out.append("\n");
9347
9348 out.append(" name: ");
9349 out.append("'").append(this->name).append("'");
9350 out.append("\n");
9351
9352 out.append(" unique_id: ");
9353 out.append("'").append(this->unique_id).append("'");
9354 out.append("\n");
9355
9356 out.append(" icon: ");
9357 out.append("'").append(this->icon).append("'");
9358 out.append("\n");
9359
9360 out.append(" disabled_by_default: ");
9361 out.append(YESNO(this->disabled_by_default));
9362 out.append("\n");
9363
9364 out.append(" entity_category: ");
9366 out.append("\n");
9367 out.append("}");
9368}
9369#endif
9370bool TimeStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
9371 switch (field_id) {
9372 case 2: {
9373 this->missing_state = value.as_bool();
9374 return true;
9375 }
9376 case 3: {
9377 this->hour = value.as_uint32();
9378 return true;
9379 }
9380 case 4: {
9381 this->minute = value.as_uint32();
9382 return true;
9383 }
9384 case 5: {
9385 this->second = value.as_uint32();
9386 return true;
9387 }
9388 default:
9389 return false;
9390 }
9391}
9392bool TimeStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
9393 switch (field_id) {
9394 case 1: {
9395 this->key = value.as_fixed32();
9396 return true;
9397 }
9398 default:
9399 return false;
9400 }
9401}
9403 buffer.encode_fixed32(1, this->key);
9404 buffer.encode_bool(2, this->missing_state);
9405 buffer.encode_uint32(3, this->hour);
9406 buffer.encode_uint32(4, this->minute);
9407 buffer.encode_uint32(5, this->second);
9408}
9409void TimeStateResponse::calculate_size(uint32_t &total_size) const {
9410 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9411 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
9412 ProtoSize::add_uint32_field(total_size, 1, this->hour, false);
9413 ProtoSize::add_uint32_field(total_size, 1, this->minute, false);
9414 ProtoSize::add_uint32_field(total_size, 1, this->second, false);
9415}
9416#ifdef HAS_PROTO_MESSAGE_DUMP
9417void TimeStateResponse::dump_to(std::string &out) const {
9418 __attribute__((unused)) char buffer[64];
9419 out.append("TimeStateResponse {\n");
9420 out.append(" key: ");
9421 sprintf(buffer, "%" PRIu32, this->key);
9422 out.append(buffer);
9423 out.append("\n");
9424
9425 out.append(" missing_state: ");
9426 out.append(YESNO(this->missing_state));
9427 out.append("\n");
9428
9429 out.append(" hour: ");
9430 sprintf(buffer, "%" PRIu32, this->hour);
9431 out.append(buffer);
9432 out.append("\n");
9433
9434 out.append(" minute: ");
9435 sprintf(buffer, "%" PRIu32, this->minute);
9436 out.append(buffer);
9437 out.append("\n");
9438
9439 out.append(" second: ");
9440 sprintf(buffer, "%" PRIu32, this->second);
9441 out.append(buffer);
9442 out.append("\n");
9443 out.append("}");
9444}
9445#endif
9446bool TimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
9447 switch (field_id) {
9448 case 2: {
9449 this->hour = value.as_uint32();
9450 return true;
9451 }
9452 case 3: {
9453 this->minute = value.as_uint32();
9454 return true;
9455 }
9456 case 4: {
9457 this->second = value.as_uint32();
9458 return true;
9459 }
9460 default:
9461 return false;
9462 }
9463}
9464bool TimeCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
9465 switch (field_id) {
9466 case 1: {
9467 this->key = value.as_fixed32();
9468 return true;
9469 }
9470 default:
9471 return false;
9472 }
9473}
9475 buffer.encode_fixed32(1, this->key);
9476 buffer.encode_uint32(2, this->hour);
9477 buffer.encode_uint32(3, this->minute);
9478 buffer.encode_uint32(4, this->second);
9479}
9480void TimeCommandRequest::calculate_size(uint32_t &total_size) const {
9481 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9482 ProtoSize::add_uint32_field(total_size, 1, this->hour, false);
9483 ProtoSize::add_uint32_field(total_size, 1, this->minute, false);
9484 ProtoSize::add_uint32_field(total_size, 1, this->second, false);
9485}
9486#ifdef HAS_PROTO_MESSAGE_DUMP
9487void TimeCommandRequest::dump_to(std::string &out) const {
9488 __attribute__((unused)) char buffer[64];
9489 out.append("TimeCommandRequest {\n");
9490 out.append(" key: ");
9491 sprintf(buffer, "%" PRIu32, this->key);
9492 out.append(buffer);
9493 out.append("\n");
9494
9495 out.append(" hour: ");
9496 sprintf(buffer, "%" PRIu32, this->hour);
9497 out.append(buffer);
9498 out.append("\n");
9499
9500 out.append(" minute: ");
9501 sprintf(buffer, "%" PRIu32, this->minute);
9502 out.append(buffer);
9503 out.append("\n");
9504
9505 out.append(" second: ");
9506 sprintf(buffer, "%" PRIu32, this->second);
9507 out.append(buffer);
9508 out.append("\n");
9509 out.append("}");
9510}
9511#endif
9513 switch (field_id) {
9514 case 6: {
9515 this->disabled_by_default = value.as_bool();
9516 return true;
9517 }
9518 case 7: {
9520 return true;
9521 }
9522 default:
9523 return false;
9524 }
9525}
9527 switch (field_id) {
9528 case 1: {
9529 this->object_id = value.as_string();
9530 return true;
9531 }
9532 case 3: {
9533 this->name = value.as_string();
9534 return true;
9535 }
9536 case 4: {
9537 this->unique_id = value.as_string();
9538 return true;
9539 }
9540 case 5: {
9541 this->icon = value.as_string();
9542 return true;
9543 }
9544 case 8: {
9545 this->device_class = value.as_string();
9546 return true;
9547 }
9548 case 9: {
9549 this->event_types.push_back(value.as_string());
9550 return true;
9551 }
9552 default:
9553 return false;
9554 }
9555}
9557 switch (field_id) {
9558 case 2: {
9559 this->key = value.as_fixed32();
9560 return true;
9561 }
9562 default:
9563 return false;
9564 }
9565}
9567 buffer.encode_string(1, this->object_id);
9568 buffer.encode_fixed32(2, this->key);
9569 buffer.encode_string(3, this->name);
9570 buffer.encode_string(4, this->unique_id);
9571 buffer.encode_string(5, this->icon);
9572 buffer.encode_bool(6, this->disabled_by_default);
9574 buffer.encode_string(8, this->device_class);
9575 for (auto &it : this->event_types) {
9576 buffer.encode_string(9, it, true);
9577 }
9578}
9579void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const {
9580 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9581 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9582 ProtoSize::add_string_field(total_size, 1, this->name, false);
9583 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9584 ProtoSize::add_string_field(total_size, 1, this->icon, false);
9585 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
9586 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
9587 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
9588 if (!this->event_types.empty()) {
9589 for (const auto &it : this->event_types) {
9590 ProtoSize::add_string_field(total_size, 1, it, true);
9591 }
9592 }
9593}
9594#ifdef HAS_PROTO_MESSAGE_DUMP
9595void ListEntitiesEventResponse::dump_to(std::string &out) const {
9596 __attribute__((unused)) char buffer[64];
9597 out.append("ListEntitiesEventResponse {\n");
9598 out.append(" object_id: ");
9599 out.append("'").append(this->object_id).append("'");
9600 out.append("\n");
9601
9602 out.append(" key: ");
9603 sprintf(buffer, "%" PRIu32, this->key);
9604 out.append(buffer);
9605 out.append("\n");
9606
9607 out.append(" name: ");
9608 out.append("'").append(this->name).append("'");
9609 out.append("\n");
9610
9611 out.append(" unique_id: ");
9612 out.append("'").append(this->unique_id).append("'");
9613 out.append("\n");
9614
9615 out.append(" icon: ");
9616 out.append("'").append(this->icon).append("'");
9617 out.append("\n");
9618
9619 out.append(" disabled_by_default: ");
9620 out.append(YESNO(this->disabled_by_default));
9621 out.append("\n");
9622
9623 out.append(" entity_category: ");
9625 out.append("\n");
9626
9627 out.append(" device_class: ");
9628 out.append("'").append(this->device_class).append("'");
9629 out.append("\n");
9630
9631 for (const auto &it : this->event_types) {
9632 out.append(" event_types: ");
9633 out.append("'").append(it).append("'");
9634 out.append("\n");
9635 }
9636 out.append("}");
9637}
9638#endif
9640 switch (field_id) {
9641 case 2: {
9642 this->event_type = value.as_string();
9643 return true;
9644 }
9645 default:
9646 return false;
9647 }
9648}
9649bool EventResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
9650 switch (field_id) {
9651 case 1: {
9652 this->key = value.as_fixed32();
9653 return true;
9654 }
9655 default:
9656 return false;
9657 }
9658}
9660 buffer.encode_fixed32(1, this->key);
9661 buffer.encode_string(2, this->event_type);
9662}
9663void EventResponse::calculate_size(uint32_t &total_size) const {
9664 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9665 ProtoSize::add_string_field(total_size, 1, this->event_type, false);
9666}
9667#ifdef HAS_PROTO_MESSAGE_DUMP
9668void EventResponse::dump_to(std::string &out) const {
9669 __attribute__((unused)) char buffer[64];
9670 out.append("EventResponse {\n");
9671 out.append(" key: ");
9672 sprintf(buffer, "%" PRIu32, this->key);
9673 out.append(buffer);
9674 out.append("\n");
9675
9676 out.append(" event_type: ");
9677 out.append("'").append(this->event_type).append("'");
9678 out.append("\n");
9679 out.append("}");
9680}
9681#endif
9683 switch (field_id) {
9684 case 6: {
9685 this->disabled_by_default = value.as_bool();
9686 return true;
9687 }
9688 case 7: {
9690 return true;
9691 }
9692 case 9: {
9693 this->assumed_state = value.as_bool();
9694 return true;
9695 }
9696 case 10: {
9697 this->supports_position = value.as_bool();
9698 return true;
9699 }
9700 case 11: {
9701 this->supports_stop = value.as_bool();
9702 return true;
9703 }
9704 default:
9705 return false;
9706 }
9707}
9709 switch (field_id) {
9710 case 1: {
9711 this->object_id = value.as_string();
9712 return true;
9713 }
9714 case 3: {
9715 this->name = value.as_string();
9716 return true;
9717 }
9718 case 4: {
9719 this->unique_id = value.as_string();
9720 return true;
9721 }
9722 case 5: {
9723 this->icon = value.as_string();
9724 return true;
9725 }
9726 case 8: {
9727 this->device_class = value.as_string();
9728 return true;
9729 }
9730 default:
9731 return false;
9732 }
9733}
9735 switch (field_id) {
9736 case 2: {
9737 this->key = value.as_fixed32();
9738 return true;
9739 }
9740 default:
9741 return false;
9742 }
9743}
9745 buffer.encode_string(1, this->object_id);
9746 buffer.encode_fixed32(2, this->key);
9747 buffer.encode_string(3, this->name);
9748 buffer.encode_string(4, this->unique_id);
9749 buffer.encode_string(5, this->icon);
9750 buffer.encode_bool(6, this->disabled_by_default);
9752 buffer.encode_string(8, this->device_class);
9753 buffer.encode_bool(9, this->assumed_state);
9754 buffer.encode_bool(10, this->supports_position);
9755 buffer.encode_bool(11, this->supports_stop);
9756}
9757void ListEntitiesValveResponse::calculate_size(uint32_t &total_size) const {
9758 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9759 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9760 ProtoSize::add_string_field(total_size, 1, this->name, false);
9761 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9762 ProtoSize::add_string_field(total_size, 1, this->icon, false);
9763 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
9764 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
9765 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
9766 ProtoSize::add_bool_field(total_size, 1, this->assumed_state, false);
9767 ProtoSize::add_bool_field(total_size, 1, this->supports_position, false);
9768 ProtoSize::add_bool_field(total_size, 1, this->supports_stop, false);
9769}
9770#ifdef HAS_PROTO_MESSAGE_DUMP
9771void ListEntitiesValveResponse::dump_to(std::string &out) const {
9772 __attribute__((unused)) char buffer[64];
9773 out.append("ListEntitiesValveResponse {\n");
9774 out.append(" object_id: ");
9775 out.append("'").append(this->object_id).append("'");
9776 out.append("\n");
9777
9778 out.append(" key: ");
9779 sprintf(buffer, "%" PRIu32, this->key);
9780 out.append(buffer);
9781 out.append("\n");
9782
9783 out.append(" name: ");
9784 out.append("'").append(this->name).append("'");
9785 out.append("\n");
9786
9787 out.append(" unique_id: ");
9788 out.append("'").append(this->unique_id).append("'");
9789 out.append("\n");
9790
9791 out.append(" icon: ");
9792 out.append("'").append(this->icon).append("'");
9793 out.append("\n");
9794
9795 out.append(" disabled_by_default: ");
9796 out.append(YESNO(this->disabled_by_default));
9797 out.append("\n");
9798
9799 out.append(" entity_category: ");
9801 out.append("\n");
9802
9803 out.append(" device_class: ");
9804 out.append("'").append(this->device_class).append("'");
9805 out.append("\n");
9806
9807 out.append(" assumed_state: ");
9808 out.append(YESNO(this->assumed_state));
9809 out.append("\n");
9810
9811 out.append(" supports_position: ");
9812 out.append(YESNO(this->supports_position));
9813 out.append("\n");
9814
9815 out.append(" supports_stop: ");
9816 out.append(YESNO(this->supports_stop));
9817 out.append("\n");
9818 out.append("}");
9819}
9820#endif
9821bool ValveStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
9822 switch (field_id) {
9823 case 3: {
9825 return true;
9826 }
9827 default:
9828 return false;
9829 }
9830}
9831bool ValveStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
9832 switch (field_id) {
9833 case 1: {
9834 this->key = value.as_fixed32();
9835 return true;
9836 }
9837 case 2: {
9838 this->position = value.as_float();
9839 return true;
9840 }
9841 default:
9842 return false;
9843 }
9844}
9846 buffer.encode_fixed32(1, this->key);
9847 buffer.encode_float(2, this->position);
9849}
9850void ValveStateResponse::calculate_size(uint32_t &total_size) const {
9851 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9852 ProtoSize::add_fixed_field<4>(total_size, 1, this->position != 0.0f, false);
9853 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation), false);
9854}
9855#ifdef HAS_PROTO_MESSAGE_DUMP
9856void ValveStateResponse::dump_to(std::string &out) const {
9857 __attribute__((unused)) char buffer[64];
9858 out.append("ValveStateResponse {\n");
9859 out.append(" key: ");
9860 sprintf(buffer, "%" PRIu32, this->key);
9861 out.append(buffer);
9862 out.append("\n");
9863
9864 out.append(" position: ");
9865 sprintf(buffer, "%g", this->position);
9866 out.append(buffer);
9867 out.append("\n");
9868
9869 out.append(" current_operation: ");
9871 out.append("\n");
9872 out.append("}");
9873}
9874#endif
9875bool ValveCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
9876 switch (field_id) {
9877 case 2: {
9878 this->has_position = value.as_bool();
9879 return true;
9880 }
9881 case 4: {
9882 this->stop = value.as_bool();
9883 return true;
9884 }
9885 default:
9886 return false;
9887 }
9888}
9889bool ValveCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
9890 switch (field_id) {
9891 case 1: {
9892 this->key = value.as_fixed32();
9893 return true;
9894 }
9895 case 3: {
9896 this->position = value.as_float();
9897 return true;
9898 }
9899 default:
9900 return false;
9901 }
9902}
9904 buffer.encode_fixed32(1, this->key);
9905 buffer.encode_bool(2, this->has_position);
9906 buffer.encode_float(3, this->position);
9907 buffer.encode_bool(4, this->stop);
9908}
9909void ValveCommandRequest::calculate_size(uint32_t &total_size) const {
9910 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9911 ProtoSize::add_bool_field(total_size, 1, this->has_position, false);
9912 ProtoSize::add_fixed_field<4>(total_size, 1, this->position != 0.0f, false);
9913 ProtoSize::add_bool_field(total_size, 1, this->stop, false);
9914}
9915#ifdef HAS_PROTO_MESSAGE_DUMP
9916void ValveCommandRequest::dump_to(std::string &out) const {
9917 __attribute__((unused)) char buffer[64];
9918 out.append("ValveCommandRequest {\n");
9919 out.append(" key: ");
9920 sprintf(buffer, "%" PRIu32, this->key);
9921 out.append(buffer);
9922 out.append("\n");
9923
9924 out.append(" has_position: ");
9925 out.append(YESNO(this->has_position));
9926 out.append("\n");
9927
9928 out.append(" position: ");
9929 sprintf(buffer, "%g", this->position);
9930 out.append(buffer);
9931 out.append("\n");
9932
9933 out.append(" stop: ");
9934 out.append(YESNO(this->stop));
9935 out.append("\n");
9936 out.append("}");
9937}
9938#endif
9940 switch (field_id) {
9941 case 6: {
9942 this->disabled_by_default = value.as_bool();
9943 return true;
9944 }
9945 case 7: {
9947 return true;
9948 }
9949 default:
9950 return false;
9951 }
9952}
9954 switch (field_id) {
9955 case 1: {
9956 this->object_id = value.as_string();
9957 return true;
9958 }
9959 case 3: {
9960 this->name = value.as_string();
9961 return true;
9962 }
9963 case 4: {
9964 this->unique_id = value.as_string();
9965 return true;
9966 }
9967 case 5: {
9968 this->icon = value.as_string();
9969 return true;
9970 }
9971 default:
9972 return false;
9973 }
9974}
9976 switch (field_id) {
9977 case 2: {
9978 this->key = value.as_fixed32();
9979 return true;
9980 }
9981 default:
9982 return false;
9983 }
9984}
9986 buffer.encode_string(1, this->object_id);
9987 buffer.encode_fixed32(2, this->key);
9988 buffer.encode_string(3, this->name);
9989 buffer.encode_string(4, this->unique_id);
9990 buffer.encode_string(5, this->icon);
9991 buffer.encode_bool(6, this->disabled_by_default);
9993}
9994void ListEntitiesDateTimeResponse::calculate_size(uint32_t &total_size) const {
9995 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
9996 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
9997 ProtoSize::add_string_field(total_size, 1, this->name, false);
9998 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
9999 ProtoSize::add_string_field(total_size, 1, this->icon, false);
10000 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
10001 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
10002}
10003#ifdef HAS_PROTO_MESSAGE_DUMP
10004void ListEntitiesDateTimeResponse::dump_to(std::string &out) const {
10005 __attribute__((unused)) char buffer[64];
10006 out.append("ListEntitiesDateTimeResponse {\n");
10007 out.append(" object_id: ");
10008 out.append("'").append(this->object_id).append("'");
10009 out.append("\n");
10010
10011 out.append(" key: ");
10012 sprintf(buffer, "%" PRIu32, this->key);
10013 out.append(buffer);
10014 out.append("\n");
10015
10016 out.append(" name: ");
10017 out.append("'").append(this->name).append("'");
10018 out.append("\n");
10019
10020 out.append(" unique_id: ");
10021 out.append("'").append(this->unique_id).append("'");
10022 out.append("\n");
10023
10024 out.append(" icon: ");
10025 out.append("'").append(this->icon).append("'");
10026 out.append("\n");
10027
10028 out.append(" disabled_by_default: ");
10029 out.append(YESNO(this->disabled_by_default));
10030 out.append("\n");
10031
10032 out.append(" entity_category: ");
10034 out.append("\n");
10035 out.append("}");
10036}
10037#endif
10039 switch (field_id) {
10040 case 2: {
10041 this->missing_state = value.as_bool();
10042 return true;
10043 }
10044 default:
10045 return false;
10046 }
10047}
10048bool DateTimeStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
10049 switch (field_id) {
10050 case 1: {
10051 this->key = value.as_fixed32();
10052 return true;
10053 }
10054 case 3: {
10055 this->epoch_seconds = value.as_fixed32();
10056 return true;
10057 }
10058 default:
10059 return false;
10060 }
10061}
10063 buffer.encode_fixed32(1, this->key);
10064 buffer.encode_bool(2, this->missing_state);
10065 buffer.encode_fixed32(3, this->epoch_seconds);
10066}
10067void DateTimeStateResponse::calculate_size(uint32_t &total_size) const {
10068 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10069 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
10070 ProtoSize::add_fixed_field<4>(total_size, 1, this->epoch_seconds != 0, false);
10071}
10072#ifdef HAS_PROTO_MESSAGE_DUMP
10073void DateTimeStateResponse::dump_to(std::string &out) const {
10074 __attribute__((unused)) char buffer[64];
10075 out.append("DateTimeStateResponse {\n");
10076 out.append(" key: ");
10077 sprintf(buffer, "%" PRIu32, this->key);
10078 out.append(buffer);
10079 out.append("\n");
10080
10081 out.append(" missing_state: ");
10082 out.append(YESNO(this->missing_state));
10083 out.append("\n");
10084
10085 out.append(" epoch_seconds: ");
10086 sprintf(buffer, "%" PRIu32, this->epoch_seconds);
10087 out.append(buffer);
10088 out.append("\n");
10089 out.append("}");
10090}
10091#endif
10092bool DateTimeCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
10093 switch (field_id) {
10094 case 1: {
10095 this->key = value.as_fixed32();
10096 return true;
10097 }
10098 case 2: {
10099 this->epoch_seconds = value.as_fixed32();
10100 return true;
10101 }
10102 default:
10103 return false;
10104 }
10105}
10107 buffer.encode_fixed32(1, this->key);
10108 buffer.encode_fixed32(2, this->epoch_seconds);
10109}
10110void DateTimeCommandRequest::calculate_size(uint32_t &total_size) const {
10111 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10112 ProtoSize::add_fixed_field<4>(total_size, 1, this->epoch_seconds != 0, false);
10113}
10114#ifdef HAS_PROTO_MESSAGE_DUMP
10115void DateTimeCommandRequest::dump_to(std::string &out) const {
10116 __attribute__((unused)) char buffer[64];
10117 out.append("DateTimeCommandRequest {\n");
10118 out.append(" key: ");
10119 sprintf(buffer, "%" PRIu32, this->key);
10120 out.append(buffer);
10121 out.append("\n");
10122
10123 out.append(" epoch_seconds: ");
10124 sprintf(buffer, "%" PRIu32, this->epoch_seconds);
10125 out.append(buffer);
10126 out.append("\n");
10127 out.append("}");
10128}
10129#endif
10131 switch (field_id) {
10132 case 6: {
10133 this->disabled_by_default = value.as_bool();
10134 return true;
10135 }
10136 case 7: {
10138 return true;
10139 }
10140 default:
10141 return false;
10142 }
10143}
10145 switch (field_id) {
10146 case 1: {
10147 this->object_id = value.as_string();
10148 return true;
10149 }
10150 case 3: {
10151 this->name = value.as_string();
10152 return true;
10153 }
10154 case 4: {
10155 this->unique_id = value.as_string();
10156 return true;
10157 }
10158 case 5: {
10159 this->icon = value.as_string();
10160 return true;
10161 }
10162 case 8: {
10163 this->device_class = value.as_string();
10164 return true;
10165 }
10166 default:
10167 return false;
10168 }
10169}
10171 switch (field_id) {
10172 case 2: {
10173 this->key = value.as_fixed32();
10174 return true;
10175 }
10176 default:
10177 return false;
10178 }
10179}
10181 buffer.encode_string(1, this->object_id);
10182 buffer.encode_fixed32(2, this->key);
10183 buffer.encode_string(3, this->name);
10184 buffer.encode_string(4, this->unique_id);
10185 buffer.encode_string(5, this->icon);
10186 buffer.encode_bool(6, this->disabled_by_default);
10188 buffer.encode_string(8, this->device_class);
10189}
10190void ListEntitiesUpdateResponse::calculate_size(uint32_t &total_size) const {
10191 ProtoSize::add_string_field(total_size, 1, this->object_id, false);
10192 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10193 ProtoSize::add_string_field(total_size, 1, this->name, false);
10194 ProtoSize::add_string_field(total_size, 1, this->unique_id, false);
10195 ProtoSize::add_string_field(total_size, 1, this->icon, false);
10196 ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default, false);
10197 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category), false);
10198 ProtoSize::add_string_field(total_size, 1, this->device_class, false);
10199}
10200#ifdef HAS_PROTO_MESSAGE_DUMP
10201void ListEntitiesUpdateResponse::dump_to(std::string &out) const {
10202 __attribute__((unused)) char buffer[64];
10203 out.append("ListEntitiesUpdateResponse {\n");
10204 out.append(" object_id: ");
10205 out.append("'").append(this->object_id).append("'");
10206 out.append("\n");
10207
10208 out.append(" key: ");
10209 sprintf(buffer, "%" PRIu32, this->key);
10210 out.append(buffer);
10211 out.append("\n");
10212
10213 out.append(" name: ");
10214 out.append("'").append(this->name).append("'");
10215 out.append("\n");
10216
10217 out.append(" unique_id: ");
10218 out.append("'").append(this->unique_id).append("'");
10219 out.append("\n");
10220
10221 out.append(" icon: ");
10222 out.append("'").append(this->icon).append("'");
10223 out.append("\n");
10224
10225 out.append(" disabled_by_default: ");
10226 out.append(YESNO(this->disabled_by_default));
10227 out.append("\n");
10228
10229 out.append(" entity_category: ");
10231 out.append("\n");
10232
10233 out.append(" device_class: ");
10234 out.append("'").append(this->device_class).append("'");
10235 out.append("\n");
10236 out.append("}");
10237}
10238#endif
10239bool UpdateStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
10240 switch (field_id) {
10241 case 2: {
10242 this->missing_state = value.as_bool();
10243 return true;
10244 }
10245 case 3: {
10246 this->in_progress = value.as_bool();
10247 return true;
10248 }
10249 case 4: {
10250 this->has_progress = value.as_bool();
10251 return true;
10252 }
10253 default:
10254 return false;
10255 }
10256}
10258 switch (field_id) {
10259 case 6: {
10260 this->current_version = value.as_string();
10261 return true;
10262 }
10263 case 7: {
10264 this->latest_version = value.as_string();
10265 return true;
10266 }
10267 case 8: {
10268 this->title = value.as_string();
10269 return true;
10270 }
10271 case 9: {
10272 this->release_summary = value.as_string();
10273 return true;
10274 }
10275 case 10: {
10276 this->release_url = value.as_string();
10277 return true;
10278 }
10279 default:
10280 return false;
10281 }
10282}
10283bool UpdateStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
10284 switch (field_id) {
10285 case 1: {
10286 this->key = value.as_fixed32();
10287 return true;
10288 }
10289 case 5: {
10290 this->progress = value.as_float();
10291 return true;
10292 }
10293 default:
10294 return false;
10295 }
10296}
10298 buffer.encode_fixed32(1, this->key);
10299 buffer.encode_bool(2, this->missing_state);
10300 buffer.encode_bool(3, this->in_progress);
10301 buffer.encode_bool(4, this->has_progress);
10302 buffer.encode_float(5, this->progress);
10303 buffer.encode_string(6, this->current_version);
10304 buffer.encode_string(7, this->latest_version);
10305 buffer.encode_string(8, this->title);
10306 buffer.encode_string(9, this->release_summary);
10307 buffer.encode_string(10, this->release_url);
10308}
10309void UpdateStateResponse::calculate_size(uint32_t &total_size) const {
10310 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10311 ProtoSize::add_bool_field(total_size, 1, this->missing_state, false);
10312 ProtoSize::add_bool_field(total_size, 1, this->in_progress, false);
10313 ProtoSize::add_bool_field(total_size, 1, this->has_progress, false);
10314 ProtoSize::add_fixed_field<4>(total_size, 1, this->progress != 0.0f, false);
10315 ProtoSize::add_string_field(total_size, 1, this->current_version, false);
10316 ProtoSize::add_string_field(total_size, 1, this->latest_version, false);
10317 ProtoSize::add_string_field(total_size, 1, this->title, false);
10318 ProtoSize::add_string_field(total_size, 1, this->release_summary, false);
10319 ProtoSize::add_string_field(total_size, 1, this->release_url, false);
10320}
10321#ifdef HAS_PROTO_MESSAGE_DUMP
10322void UpdateStateResponse::dump_to(std::string &out) const {
10323 __attribute__((unused)) char buffer[64];
10324 out.append("UpdateStateResponse {\n");
10325 out.append(" key: ");
10326 sprintf(buffer, "%" PRIu32, this->key);
10327 out.append(buffer);
10328 out.append("\n");
10329
10330 out.append(" missing_state: ");
10331 out.append(YESNO(this->missing_state));
10332 out.append("\n");
10333
10334 out.append(" in_progress: ");
10335 out.append(YESNO(this->in_progress));
10336 out.append("\n");
10337
10338 out.append(" has_progress: ");
10339 out.append(YESNO(this->has_progress));
10340 out.append("\n");
10341
10342 out.append(" progress: ");
10343 sprintf(buffer, "%g", this->progress);
10344 out.append(buffer);
10345 out.append("\n");
10346
10347 out.append(" current_version: ");
10348 out.append("'").append(this->current_version).append("'");
10349 out.append("\n");
10350
10351 out.append(" latest_version: ");
10352 out.append("'").append(this->latest_version).append("'");
10353 out.append("\n");
10354
10355 out.append(" title: ");
10356 out.append("'").append(this->title).append("'");
10357 out.append("\n");
10358
10359 out.append(" release_summary: ");
10360 out.append("'").append(this->release_summary).append("'");
10361 out.append("\n");
10362
10363 out.append(" release_url: ");
10364 out.append("'").append(this->release_url).append("'");
10365 out.append("\n");
10366 out.append("}");
10367}
10368#endif
10369bool UpdateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
10370 switch (field_id) {
10371 case 2: {
10372 this->command = value.as_enum<enums::UpdateCommand>();
10373 return true;
10374 }
10375 default:
10376 return false;
10377 }
10378}
10379bool UpdateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
10380 switch (field_id) {
10381 case 1: {
10382 this->key = value.as_fixed32();
10383 return true;
10384 }
10385 default:
10386 return false;
10387 }
10388}
10390 buffer.encode_fixed32(1, this->key);
10391 buffer.encode_enum<enums::UpdateCommand>(2, this->command);
10392}
10393void UpdateCommandRequest::calculate_size(uint32_t &total_size) const {
10394 ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0, false);
10395 ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->command), false);
10396}
10397#ifdef HAS_PROTO_MESSAGE_DUMP
10398void UpdateCommandRequest::dump_to(std::string &out) const {
10399 __attribute__((unused)) char buffer[64];
10400 out.append("UpdateCommandRequest {\n");
10401 out.append(" key: ");
10402 sprintf(buffer, "%" PRIu32, this->key);
10403 out.append(buffer);
10404 out.append("\n");
10405
10406 out.append(" command: ");
10408 out.append("\n");
10409 out.append("}");
10410}
10411#endif
10412
10413} // namespace api
10414} // namespace esphome
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:8748
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8728
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8763
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8769
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8758
enums::AlarmControlPanelStateCommand command
Definition api_pb2.h:2175
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8738
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8685
enums::AlarmControlPanelState state
Definition api_pb2.h:2161
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8714
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8709
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:8695
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8705
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1195
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1200
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1206
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1171
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1185
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7529
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7522
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7539
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7504
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7818
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7789
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7812
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7807
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6800
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6822
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6835
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6828
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7715
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7686
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7709
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7704
enums::BluetoothDeviceRequestType request_type
Definition api_pb2.h:1588
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6777
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6770
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6764
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6742
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7757
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7752
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7734
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7763
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6958
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:6948
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6968
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6930
std::vector< BluetoothGATTDescriptor > descriptors
Definition api_pb2.h:1645
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6979
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6904
std::vector< uint64_t > uuid
Definition api_pb2.h:1629
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6884
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6913
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6898
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7579
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7590
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7584
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7561
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7133
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7130
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7137
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7120
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6874
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6859
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6870
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6869
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7104
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7093
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:7083
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7099
std::vector< BluetoothGATTService > services
Definition api_pb2.h:1674
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7073
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7478
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7443
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:7457
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7467
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7472
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7418
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7395
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7413
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7424
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7671
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7648
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7666
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7662
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7326
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7317
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7303
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7321
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7165
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7170
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7147
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7161
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:7199
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7209
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7220
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7214
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7185
std::vector< uint64_t > uuid
Definition api_pb2.h:1658
std::vector< BluetoothGATTCharacteristic > characteristics
Definition api_pb2.h:1660
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7007
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7050
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7031
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7040
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:7021
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7365
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7370
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:7355
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7376
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7341
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:7257
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7280
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7273
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7267
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7239
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7633
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7624
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7610
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7628
std::vector< BluetoothServiceData > service_data
Definition api_pb2.h:1544
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6605
std::vector< std::string > service_uuids
Definition api_pb2.h:1543
std::vector< BluetoothServiceData > manufacturer_data
Definition api_pb2.h:1545
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6536
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6591
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:6554
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6576
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6688
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6647
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:6665
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6675
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6681
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6727
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6731
std::vector< BluetoothLERawAdvertisement > advertisements
Definition api_pb2.h:1575
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6722
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:6712
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7886
enums::BluetoothScannerMode mode
Definition api_pb2.h:1929
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7890
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7873
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7883
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7851
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7837
enums::BluetoothScannerMode mode
Definition api_pb2.h:1917
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7860
enums::BluetoothScannerState state
Definition api_pb2.h:1916
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7855
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6516
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:6485
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6499
std::vector< uint32_t > legacy_data
Definition api_pb2.h:1526
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6506
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6475
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6051
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6056
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:6041
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6052
void dump_to(std::string &out) const override
Definition api_pb2.cpp:4113
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:4104
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:4108
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:4090
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:4066
void dump_to(std::string &out) const override
Definition api_pb2.cpp:4072
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:4041
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:4031
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:4061
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:4051
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:4728
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:4754
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1162
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1160
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:4644
enums::ClimatePreset preset
Definition api_pb2.h:1166
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:4779
void dump_to(std::string &out) const override
Definition api_pb2.cpp:4805
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:4714
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1128
void dump_to(std::string &out) const override
Definition api_pb2.cpp:4572
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1129
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:4459
enums::ClimateAction action
Definition api_pb2.h:1127
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:4537
enums::ClimatePreset preset
Definition api_pb2.h:1131
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:4489
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:4503
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:4554
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:758
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:757
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:747
void dump_to(std::string &out) const override
Definition api_pb2.cpp:762
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:771
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:782
void dump_to(std::string &out) const override
Definition api_pb2.cpp:786
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:781
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1474
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1513
enums::LegacyCoverCommand legacy_command
Definition api_pb2.h:504
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1448
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1502
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1492
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1420
enums::LegacyCoverState legacy_state
Definition api_pb2.h:486
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1405
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1387
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1412
enums::CoverOperation current_operation
Definition api_pb2.h:489
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1373
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9223
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9239
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9233
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9205
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9246
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9161
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9168
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9176
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9151
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9129
void calculate_size(uint32_t &total_size) const override
void encode(ProtoWriteBuffer buffer) const override
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
void dump_to(std::string &out) const override
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
void encode(ProtoWriteBuffer buffer) const override
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
void dump_to(std::string &out) const override
void calculate_size(uint32_t &total_size) const override
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:815
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:816
void dump_to(std::string &out) const override
Definition api_pb2.cpp:818
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:908
void dump_to(std::string &out) const override
Definition api_pb2.cpp:951
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:858
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:929
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:820
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:796
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:795
void dump_to(std::string &out) const override
Definition api_pb2.cpp:798
void dump_to(std::string &out) const override
Definition api_pb2.cpp:803
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:800
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:801
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9663
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9659
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:9639
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9668
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9649
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3803
std::vector< int32_t > int_array
Definition api_pb2.h:1003
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3831
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3756
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3730
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3784
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3770
std::vector< std::string > string_array
Definition api_pb2.h:1005
std::vector< float > float_array
Definition api_pb2.h:1004
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3905
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3916
std::vector< ExecuteServiceArgument > args
Definition api_pb2.h:1020
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3911
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3895
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3885
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1881
enums::FanDirection direction
Definition api_pb2.h:575
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1896
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1811
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1861
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1912
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1871
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1776
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1766
enums::FanDirection direction
Definition api_pb2.h:551
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1747
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1757
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1737
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1711
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3604
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3601
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3602
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3606
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3616
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3617
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3621
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:629
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:658
void dump_to(std::string &out) const override
Definition api_pb2.cpp:664
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:653
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:643
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:683
void dump_to(std::string &out) const override
Definition api_pb2.cpp:724
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:697
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:711
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:717
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3573
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3555
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3578
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3584
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3390
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3399
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3394
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3376
std::vector< HomeassistantServiceMap > data_template
Definition api_pb2.h:892
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3444
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3465
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3457
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3412
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3422
std::vector< HomeassistantServiceMap > data
Definition api_pb2.h:891
std::vector< HomeassistantServiceMap > variables
Definition api_pb2.h:893
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2406
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2416
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2462
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:2491
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2336
void dump_to(std::string &out) const override
Definition api_pb2.cpp:2521
void dump_to(std::string &out) const override
Definition api_pb2.cpp:2269
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2182
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2238
enums::ColorMode color_mode
Definition api_pb2.h:624
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2168
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:2253
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2192
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8638
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8581
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8625
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8613
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:8603
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8555
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1129
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1096
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1052
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1106
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1117
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1070
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5992
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5982
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:5946
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5972
enums::EntityCategory entity_category
Definition api_pb2.h:1409
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5932
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6003
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3968
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3987
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3932
enums::EntityCategory entity_category
Definition api_pb2.h:1039
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3997
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3978
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3946
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:4126
std::vector< enums::ClimatePreset > supported_presets
Definition api_pb2.h:1097
void dump_to(std::string &out) const override
Definition api_pb2.cpp:4335
std::vector< enums::ClimateSwingMode > supported_swing_modes
Definition api_pb2.h:1095
std::vector< enums::ClimateFanMode > supported_fan_modes
Definition api_pb2.h:1094
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:4210
std::vector< enums::ClimateMode > supported_modes
Definition api_pb2.h:1088
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:4180
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:4283
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:4244
enums::EntityCategory entity_category
Definition api_pb2.h:1101
std::vector< std::string > supported_custom_presets
Definition api_pb2.h:1098
std::vector< std::string > supported_custom_fan_modes
Definition api_pb2.h:1096
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1224
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1319
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1254
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1280
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1304
enums::EntityCategory entity_category
Definition api_pb2.h:470
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1290
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9085
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9066
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9076
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9095
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:9044
enums::EntityCategory entity_category
Definition api_pb2.h:2250
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9030
void dump_to(std::string &out) const override
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9985
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9994
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9939
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:9953
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9975
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1042
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1045
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1043
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9579
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9595
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9512
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:9526
enums::EntityCategory entity_category
Definition api_pb2.h:2356
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9556
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9566
std::vector< std::string > event_types
Definition api_pb2.h:2358
std::vector< std::string > supported_preset_modes
Definition api_pb2.h:533
enums::EntityCategory entity_category
Definition api_pb2.h:532
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1609
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1654
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1583
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1619
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1553
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1635
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:2070
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2005
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2031
void dump_to(std::string &out) const override
Definition api_pb2.cpp:2096
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:1971
enums::EntityCategory entity_category
Definition api_pb2.h:607
std::vector< std::string > effects
Definition api_pb2.h:604
std::vector< enums::ColorMode > supported_color_modes
Definition api_pb2.h:597
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2049
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5743
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5733
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5681
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5770
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:5707
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5756
enums::EntityCategory entity_category
Definition api_pb2.h:1354
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:6185
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6195
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6208
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6141
std::vector< MediaPlayerSupportedFormat > supported_formats
Definition api_pb2.h:1461
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:6159
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6220
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:4955
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:4907
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:4925
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:4992
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5008
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:4977
enums::EntityCategory entity_category
Definition api_pb2.h:1193
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1038
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1037
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1040
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5161
enums::EntityCategory entity_category
Definition api_pb2.h:1245
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:5175
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5238
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5211
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5223
std::vector< std::string > options
Definition api_pb2.h:1243
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5201
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:2731
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2716
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2706
void dump_to(std::string &out) const override
Definition api_pb2.cpp:2747
enums::SensorLastResetType legacy_last_reset_type
Definition api_pb2.h:697
enums::EntityCategory entity_category
Definition api_pb2.h:699
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2676
enums::SensorStateClass state_class
Definition api_pb2.h:696
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2646
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3655
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3651
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3660
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3631
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3641
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3673
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3710
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3697
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3687
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3704
std::vector< ListEntitiesServicesArgument > args
Definition api_pb2.h:984
enums::EntityCategory entity_category
Definition api_pb2.h:1298
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5438
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5452
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5380
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5469
std::vector< std::string > tones
Definition api_pb2.h:1295
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5428
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:5402
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2914
enums::EntityCategory entity_category
Definition api_pb2.h:735
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2878
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2904
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:2925
void dump_to(std::string &out) const override
Definition api_pb2.cpp:2937
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2860
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8876
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8862
enums::EntityCategory entity_category
Definition api_pb2.h:2196
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8813
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:8839
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8787
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8849
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3105
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3115
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3079
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3136
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3125
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3065
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9317
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9307
enums::EntityCategory entity_category
Definition api_pb2.h:2303
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:9285
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9271
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9326
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9336
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
void dump_to(std::string &out) const override
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
enums::EntityCategory entity_category
Definition api_pb2.h:2495
void calculate_size(uint32_t &total_size) const override
void encode(ProtoWriteBuffer buffer) const override
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9682
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:9708
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9734
enums::EntityCategory entity_category
Definition api_pb2.h:2392
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9757
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9771
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9744
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5903
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5897
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5863
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5887
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5910
enums::LockCommand command
Definition api_pb2.h:1387
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:5877
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5844
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5820
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5840
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5849
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5830
enums::MediaPlayerCommand command
Definition api_pb2.h:1493
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:6368
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6328
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:6358
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6382
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6393
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6405
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6298
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6305
enums::MediaPlayerState state
Definition api_pb2.h:1476
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6292
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6264
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:6278
enums::MediaPlayerFormatPurpose purpose
Definition api_pb2.h:1439
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6066
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:6088
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6105
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6098
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6113
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3332
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3331
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3336
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3321
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3356
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3360
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3355
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3345
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5141
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5123
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5146
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5137
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5093
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5079
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5104
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5098
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5069
void dump_to(std::string &out) const override
Definition api_pb2.cpp:808
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:805
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:806
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:810
void dump_to(std::string &out) const override
Definition api_pb2.cpp:813
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:811
uint32_t as_fixed32() const
Definition proto.h:153
float as_float() const
Definition proto.h:155
std::string as_string() const
Definition proto.h:138
static void add_repeated_message(uint32_t &total_size, 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.
static void add_uint32_field(uint32_t &total_size, uint32_t field_id_size, uint32_t value, bool force=false)
Calculates and adds the size of a uint32 field to the total message size.
static void add_bool_field(uint32_t &total_size, uint32_t field_id_size, bool value, bool force=false)
Calculates and adds the size of a boolean field to the total message size.
static void add_int32_field(uint32_t &total_size, uint32_t field_id_size, int32_t value, bool force=false)
Common parameters for all add_*_field methods.
static void add_fixed_field(uint32_t &total_size, uint32_t field_id_size, bool is_nonzero, bool force=false)
Calculates and adds the size of a fixed field to the total message size.
static void add_message_object(uint32_t &total_size, uint32_t field_id_size, const MessageType &message, bool force=false)
Calculates and adds the size of a nested message field to the total message size.
static void add_string_field(uint32_t &total_size, uint32_t field_id_size, const std::string &str, bool force=false)
Calculates and adds the size of a string/bytes field to the total message size.
static void add_uint64_field(uint32_t &total_size, uint32_t field_id_size, uint64_t value, bool force=false)
Calculates and adds the size of a uint64 field to the total message size.
static void add_sint32_field(uint32_t &total_size, uint32_t field_id_size, int32_t value, bool force=false)
Calculates and adds the size of a sint32 field to the total message size.
static void add_enum_field(uint32_t &total_size, uint32_t field_id_size, uint32_t value, bool force=false)
Calculates and adds the size of an enum field to the total message size.
Representation of a VarInt - in ProtoBuf should be 64bit but we only use 32bit.
Definition proto.h:17
int32_t as_sint32() const
Definition proto.h:70
uint64_t as_uint64() const
Definition proto.h:59
bool as_bool() const
Definition proto.h:60
uint32_t as_uint32() const
Definition proto.h:58
int32_t as_int32() const
Definition proto.h:62
void encode_enum(uint32_t field_id, T value, bool force=false)
Definition proto.h:265
void encode_float(uint32_t field_id, float value, bool force=false)
Definition proto.h:268
void encode_int32(uint32_t field_id, int32_t value, bool force=false)
Definition proto.h:279
void encode_message(uint32_t field_id, const C &value, bool force=false)
Definition proto.h:308
void encode_string(uint32_t field_id, const char *string, size_t len, bool force=false)
Definition proto.h:208
void encode_bool(uint32_t field_id, bool value, bool force=false)
Definition proto.h:235
void encode_uint64(uint32_t field_id, uint64_t value, bool force=false)
Definition proto.h:229
void encode_uint32(uint32_t field_id, uint32_t value, bool force=false)
Definition proto.h:223
void encode_sint32(uint32_t field_id, int32_t value, bool force=false)
Definition proto.h:290
void encode_fixed32(uint32_t field_id, uint32_t value, bool force=false)
Definition proto.h:241
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:5337
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5361
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5357
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5347
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5366
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5278
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5298
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:5288
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5313
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5308
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5319
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2806
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2816
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2830
void dump_to(std::string &out) const override
Definition api_pb2.cpp:2841
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:2835
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5637
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5625
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:5590
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5560
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5614
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5600
void dump_to(std::string &out) const override
Definition api_pb2.cpp:5546
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:5541
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:5517
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:5527
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:5537
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7498
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7500
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7497
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:6461
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:6458
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:6448
void dump_to(std::string &out) const override
Definition api_pb2.cpp:6465
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3538
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3532
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3527
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3513
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3503
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3497
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3496
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3499
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3369
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3370
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3372
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3256
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3233
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3247
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3251
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3269
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3304
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3298
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3283
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3293
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:1048
void dump_to(std::string &out) const override
Definition api_pb2.cpp:1050
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:1047
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7922
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7917
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7899
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7913
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3032
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3046
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3022
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3042
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3051
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3008
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:2979
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3003
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:2999
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2989
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8987
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9011
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:8997
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9007
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9016
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3194
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:3204
void dump_to(std::string &out) const override
Definition api_pb2.cpp:3215
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:3209
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3184
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:3174
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:8948
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8938
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8928
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8963
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8958
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8969
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9464
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9487
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9446
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9480
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9474
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9370
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9392
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9402
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9417
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9409
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7783
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7785
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7782
void encode(ProtoWriteBuffer buffer) const override
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
enums::UpdateCommand command
Definition api_pb2.h:2534
void dump_to(std::string &out) const override
void calculate_size(uint32_t &total_size) const override
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
void calculate_size(uint32_t &total_size) const override
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
void encode(ProtoWriteBuffer buffer) const override
void dump_to(std::string &out) const override
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9909
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9875
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9916
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9903
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9889
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:9821
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:9831
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:9845
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:9850
void dump_to(std::string &out) const override
Definition api_pb2.cpp:9856
enums::ValveOperation current_operation
Definition api_pb2.h:2412
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8382
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8381
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8371
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8386
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8319
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8350
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8337
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8343
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8309
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8207
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8212
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8203
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8193
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8183
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7936
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:7950
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:7960
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:7965
void dump_to(std::string &out) const override
Definition api_pb2.cpp:7971
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8449
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8450
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8452
std::vector< VoiceAssistantWakeWord > available_wake_words
Definition api_pb2.h:2110
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8466
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8499
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8456
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8480
std::vector< std::string > active_wake_words
Definition api_pb2.h:2111
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8489
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8115
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8119
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8124
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8101
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8168
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8147
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8163
enums::VoiceAssistantEvent event_type
Definition api_pb2.h:2012
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8157
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8137
std::vector< VoiceAssistantEventData > data
Definition api_pb2.h:2013
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8030
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:7991
VoiceAssistantAudioSettings audio_settings
Definition api_pb2.h:1972
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8023
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8038
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8005
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8087
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8082
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8078
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8064
std::vector< std::string > active_wake_words
Definition api_pb2.h:2125
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8536
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8544
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8521
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8531
enums::VoiceAssistantTimerEvent event_type
Definition api_pb2.h:2040
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8247
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition api_pb2.cpp:8225
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8261
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8278
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8269
void encode(ProtoWriteBuffer buffer) const override
Definition api_pb2.cpp:8413
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:8395
void calculate_size(uint32_t &total_size) const override
Definition api_pb2.cpp:8420
std::vector< std::string > trained_languages
Definition api_pb2.h:2088
void dump_to(std::string &out) const override
Definition api_pb2.cpp:8430
struct @67::@68 __attribute__
@ ALARM_STATE_ARMED_CUSTOM_BYPASS
Definition api_pb2.h:223
@ SERVICE_ARG_TYPE_BOOL_ARRAY
Definition api_pb2.h:79
@ SERVICE_ARG_TYPE_STRING_ARRAY
Definition api_pb2.h:82
@ SERVICE_ARG_TYPE_FLOAT_ARRAY
Definition api_pb2.h:81
@ VOICE_ASSISTANT_REQUEST_USE_WAKE_WORD
Definition api_pb2.h:192
@ VOICE_ASSISTANT_REQUEST_USE_VAD
Definition api_pb2.h:191
@ MEDIA_PLAYER_FORMAT_PURPOSE_ANNOUNCEMENT
Definition api_pb2.h:162
@ MEDIA_PLAYER_FORMAT_PURPOSE_DEFAULT
Definition api_pb2.h:161
@ COLOR_MODE_RGB_COLOR_TEMPERATURE
Definition api_pb2.h:50
@ COLOR_MODE_COLOR_TEMPERATURE
Definition api_pb2.h:46
@ COLOR_MODE_RGB_COLD_WARM_WHITE
Definition api_pb2.h:51
@ VOICE_ASSISTANT_TIMER_UPDATED
Definition api_pb2.h:213
@ VOICE_ASSISTANT_TIMER_STARTED
Definition api_pb2.h:212
@ VOICE_ASSISTANT_TIMER_FINISHED
Definition api_pb2.h:215
@ VOICE_ASSISTANT_TIMER_CANCELLED
Definition api_pb2.h:214
@ VOICE_ASSISTANT_WAKE_WORD_START
Definition api_pb2.h:204
@ VOICE_ASSISTANT_TTS_STREAM_END
Definition api_pb2.h:209
@ VOICE_ASSISTANT_STT_VAD_START
Definition api_pb2.h:206
@ VOICE_ASSISTANT_TTS_STREAM_START
Definition api_pb2.h:208
@ VOICE_ASSISTANT_WAKE_WORD_END
Definition api_pb2.h:205
@ BLUETOOTH_DEVICE_REQUEST_TYPE_UNPAIR
Definition api_pb2.h:168
@ BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT_V3_WITH_CACHE
Definition api_pb2.h:169
@ BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT
Definition api_pb2.h:165
@ BLUETOOTH_DEVICE_REQUEST_TYPE_PAIR
Definition api_pb2.h:167
@ BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT_V3_WITHOUT_CACHE
Definition api_pb2.h:170
@ BLUETOOTH_DEVICE_REQUEST_TYPE_CLEAR_CACHE
Definition api_pb2.h:171
@ BLUETOOTH_DEVICE_REQUEST_TYPE_DISCONNECT
Definition api_pb2.h:166
@ BLUETOOTH_SCANNER_MODE_PASSIVE
Definition api_pb2.h:182
@ BLUETOOTH_SCANNER_MODE_ACTIVE
Definition api_pb2.h:183
@ BLUETOOTH_SCANNER_STATE_STOPPED
Definition api_pb2.h:179
@ BLUETOOTH_SCANNER_STATE_STARTING
Definition api_pb2.h:175
@ BLUETOOTH_SCANNER_STATE_STOPPING
Definition api_pb2.h:178
@ BLUETOOTH_SCANNER_STATE_RUNNING
Definition api_pb2.h:176
@ BLUETOOTH_SCANNER_STATE_FAILED
Definition api_pb2.h:177
@ ALARM_CONTROL_PANEL_ARM_NIGHT
Definition api_pb2.h:233
@ ALARM_CONTROL_PANEL_ARM_CUSTOM_BYPASS
Definition api_pb2.h:235
@ ALARM_CONTROL_PANEL_ARM_VACATION
Definition api_pb2.h:234
@ VOICE_ASSISTANT_SUBSCRIBE_API_AUDIO
Definition api_pb2.h:187
@ VOICE_ASSISTANT_SUBSCRIBE_NONE
Definition api_pb2.h:186
@ STATE_CLASS_TOTAL_INCREASING
Definition api_pb2.h:56
const char * proto_enum_to_string< enums::LegacyCoverCommand >(enums::LegacyCoverCommand value)
Definition api_pb2.cpp:53
const char * proto_enum_to_string< enums::AlarmControlPanelState >(enums::AlarmControlPanelState value)
Definition api_pb2.cpp:539
const char * proto_enum_to_string< enums::VoiceAssistantEvent >(enums::VoiceAssistantEvent value)
Definition api_pb2.cpp:485
const char * proto_enum_to_string< enums::MediaPlayerState >(enums::MediaPlayerState value)
Definition api_pb2.cpp:357
const char * proto_enum_to_string< enums::LegacyCoverState >(enums::LegacyCoverState value)
Definition api_pb2.cpp:27
const char * proto_enum_to_string< enums::NumberMode >(enums::NumberMode value)
Definition api_pb2.cpp:309
const char * proto_enum_to_string< enums::ServiceArgType >(enums::ServiceArgType value)
Definition api_pb2.cpp:175
const char * proto_enum_to_string< enums::BluetoothScannerMode >(enums::BluetoothScannerMode value)
Definition api_pb2.cpp:446
const char * proto_enum_to_string< enums::BluetoothScannerState >(enums::BluetoothScannerState value)
Definition api_pb2.cpp:426
const char * proto_enum_to_string< enums::VoiceAssistantSubscribeFlag >(enums::VoiceAssistantSubscribeFlag value)
Definition api_pb2.cpp:459
const char * proto_enum_to_string< enums::ColorMode >(enums::ColorMode value)
Definition api_pb2.cpp:93
const char * proto_enum_to_string< enums::LogLevel >(enums::LogLevel value)
Definition api_pb2.cpp:151
const char * proto_enum_to_string< enums::TextMode >(enums::TextMode value)
Definition api_pb2.cpp:590
const char * proto_enum_to_string< enums::LockState >(enums::LockState value)
Definition api_pb2.cpp:323
const char * proto_enum_to_string< enums::ClimateAction >(enums::ClimateAction value)
Definition api_pb2.cpp:265
const char * proto_enum_to_string< enums::FanSpeed >(enums::FanSpeed value)
Definition api_pb2.cpp:67
const char * proto_enum_to_string< enums::FanDirection >(enums::FanDirection value)
Definition api_pb2.cpp:81
const char * proto_enum_to_string< enums::CoverOperation >(enums::CoverOperation value)
Definition api_pb2.cpp:39
const char * proto_enum_to_string< enums::VoiceAssistantRequestFlag >(enums::VoiceAssistantRequestFlag value)
Definition api_pb2.cpp:471
const char * proto_enum_to_string< enums::BluetoothDeviceRequestType >(enums::BluetoothDeviceRequestType value)
Definition api_pb2.cpp:404
const char * proto_enum_to_string< enums::VoiceAssistantTimerEvent >(enums::VoiceAssistantTimerEvent value)
Definition api_pb2.cpp:523
const char * proto_enum_to_string< enums::AlarmControlPanelStateCommand >(enums::AlarmControlPanelStateCommand value)
Definition api_pb2.cpp:568
const char * proto_enum_to_string< enums::ClimatePreset >(enums::ClimatePreset value)
Definition api_pb2.cpp:285
const char * proto_enum_to_string< enums::MediaPlayerFormatPurpose >(enums::MediaPlayerFormatPurpose value)
Definition api_pb2.cpp:391
const char * proto_enum_to_string< enums::ClimateMode >(enums::ClimateMode value)
Definition api_pb2.cpp:199
const char * proto_enum_to_string< enums::MediaPlayerCommand >(enums::MediaPlayerCommand value)
Definition api_pb2.cpp:373
const char * proto_enum_to_string< enums::LockCommand >(enums::LockCommand value)
Definition api_pb2.cpp:343
const char * proto_enum_to_string< enums::ValveOperation >(enums::ValveOperation value)
Definition api_pb2.cpp:602
const char * proto_enum_to_string< enums::UpdateCommand >(enums::UpdateCommand value)
Definition api_pb2.cpp:616
const char * proto_enum_to_string< enums::ClimateFanMode >(enums::ClimateFanMode value)
Definition api_pb2.cpp:221
const char * proto_enum_to_string< enums::ClimateSwingMode >(enums::ClimateSwingMode value)
Definition api_pb2.cpp:249
const char * proto_enum_to_string< enums::EntityCategory >(enums::EntityCategory value)
Definition api_pb2.cpp:13
const char * proto_enum_to_string< enums::SensorLastResetType >(enums::SensorLastResetType value)
Definition api_pb2.cpp:137
const char * proto_enum_to_string< enums::SensorStateClass >(enums::SensorStateClass value)
Definition api_pb2.cpp:121
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7