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