ESPHome  2024.3.1
api_pb2.cpp
Go to the documentation of this file.
1 // This file was automatically generated with a tool.
2 // See scripts/api_protobuf/api_protobuf.py
3 #include "api_pb2.h"
4 #include "esphome/core/log.h"
5 
6 #include <cinttypes>
7 
8 namespace esphome {
9 namespace api {
10 
11 #ifdef HAS_PROTO_MESSAGE_DUMP
12 template<> const char *proto_enum_to_string<enums::EntityCategory>(enums::EntityCategory value) {
13  switch (value) {
15  return "ENTITY_CATEGORY_NONE";
17  return "ENTITY_CATEGORY_CONFIG";
19  return "ENTITY_CATEGORY_DIAGNOSTIC";
20  default:
21  return "UNKNOWN";
22  }
23 }
24 #endif
25 #ifdef HAS_PROTO_MESSAGE_DUMP
26 template<> const char *proto_enum_to_string<enums::LegacyCoverState>(enums::LegacyCoverState value) {
27  switch (value) {
29  return "LEGACY_COVER_STATE_OPEN";
31  return "LEGACY_COVER_STATE_CLOSED";
32  default:
33  return "UNKNOWN";
34  }
35 }
36 #endif
37 #ifdef HAS_PROTO_MESSAGE_DUMP
38 template<> const char *proto_enum_to_string<enums::CoverOperation>(enums::CoverOperation value) {
39  switch (value) {
41  return "COVER_OPERATION_IDLE";
43  return "COVER_OPERATION_IS_OPENING";
45  return "COVER_OPERATION_IS_CLOSING";
46  default:
47  return "UNKNOWN";
48  }
49 }
50 #endif
51 #ifdef HAS_PROTO_MESSAGE_DUMP
52 template<> const char *proto_enum_to_string<enums::LegacyCoverCommand>(enums::LegacyCoverCommand value) {
53  switch (value) {
55  return "LEGACY_COVER_COMMAND_OPEN";
57  return "LEGACY_COVER_COMMAND_CLOSE";
59  return "LEGACY_COVER_COMMAND_STOP";
60  default:
61  return "UNKNOWN";
62  }
63 }
64 #endif
65 #ifdef HAS_PROTO_MESSAGE_DUMP
66 template<> const char *proto_enum_to_string<enums::FanSpeed>(enums::FanSpeed value) {
67  switch (value) {
69  return "FAN_SPEED_LOW";
71  return "FAN_SPEED_MEDIUM";
73  return "FAN_SPEED_HIGH";
74  default:
75  return "UNKNOWN";
76  }
77 }
78 #endif
79 #ifdef HAS_PROTO_MESSAGE_DUMP
80 template<> const char *proto_enum_to_string<enums::FanDirection>(enums::FanDirection value) {
81  switch (value) {
83  return "FAN_DIRECTION_FORWARD";
85  return "FAN_DIRECTION_REVERSE";
86  default:
87  return "UNKNOWN";
88  }
89 }
90 #endif
91 #ifdef HAS_PROTO_MESSAGE_DUMP
92 template<> const char *proto_enum_to_string<enums::ColorMode>(enums::ColorMode value) {
93  switch (value) {
95  return "COLOR_MODE_UNKNOWN";
97  return "COLOR_MODE_ON_OFF";
99  return "COLOR_MODE_BRIGHTNESS";
101  return "COLOR_MODE_WHITE";
103  return "COLOR_MODE_COLOR_TEMPERATURE";
105  return "COLOR_MODE_COLD_WARM_WHITE";
107  return "COLOR_MODE_RGB";
109  return "COLOR_MODE_RGB_WHITE";
111  return "COLOR_MODE_RGB_COLOR_TEMPERATURE";
113  return "COLOR_MODE_RGB_COLD_WARM_WHITE";
114  default:
115  return "UNKNOWN";
116  }
117 }
118 #endif
119 #ifdef HAS_PROTO_MESSAGE_DUMP
120 template<> const char *proto_enum_to_string<enums::SensorStateClass>(enums::SensorStateClass value) {
121  switch (value) {
123  return "STATE_CLASS_NONE";
125  return "STATE_CLASS_MEASUREMENT";
127  return "STATE_CLASS_TOTAL_INCREASING";
129  return "STATE_CLASS_TOTAL";
130  default:
131  return "UNKNOWN";
132  }
133 }
134 #endif
135 #ifdef HAS_PROTO_MESSAGE_DUMP
136 template<> const char *proto_enum_to_string<enums::SensorLastResetType>(enums::SensorLastResetType value) {
137  switch (value) {
139  return "LAST_RESET_NONE";
141  return "LAST_RESET_NEVER";
143  return "LAST_RESET_AUTO";
144  default:
145  return "UNKNOWN";
146  }
147 }
148 #endif
149 #ifdef HAS_PROTO_MESSAGE_DUMP
150 template<> const char *proto_enum_to_string<enums::LogLevel>(enums::LogLevel value) {
151  switch (value) {
153  return "LOG_LEVEL_NONE";
155  return "LOG_LEVEL_ERROR";
157  return "LOG_LEVEL_WARN";
159  return "LOG_LEVEL_INFO";
161  return "LOG_LEVEL_CONFIG";
163  return "LOG_LEVEL_DEBUG";
165  return "LOG_LEVEL_VERBOSE";
167  return "LOG_LEVEL_VERY_VERBOSE";
168  default:
169  return "UNKNOWN";
170  }
171 }
172 #endif
173 #ifdef HAS_PROTO_MESSAGE_DUMP
174 template<> const char *proto_enum_to_string<enums::ServiceArgType>(enums::ServiceArgType value) {
175  switch (value) {
177  return "SERVICE_ARG_TYPE_BOOL";
179  return "SERVICE_ARG_TYPE_INT";
181  return "SERVICE_ARG_TYPE_FLOAT";
183  return "SERVICE_ARG_TYPE_STRING";
185  return "SERVICE_ARG_TYPE_BOOL_ARRAY";
187  return "SERVICE_ARG_TYPE_INT_ARRAY";
189  return "SERVICE_ARG_TYPE_FLOAT_ARRAY";
191  return "SERVICE_ARG_TYPE_STRING_ARRAY";
192  default:
193  return "UNKNOWN";
194  }
195 }
196 #endif
197 #ifdef HAS_PROTO_MESSAGE_DUMP
198 template<> const char *proto_enum_to_string<enums::ClimateMode>(enums::ClimateMode value) {
199  switch (value) {
201  return "CLIMATE_MODE_OFF";
203  return "CLIMATE_MODE_HEAT_COOL";
205  return "CLIMATE_MODE_COOL";
207  return "CLIMATE_MODE_HEAT";
209  return "CLIMATE_MODE_FAN_ONLY";
211  return "CLIMATE_MODE_DRY";
213  return "CLIMATE_MODE_AUTO";
214  default:
215  return "UNKNOWN";
216  }
217 }
218 #endif
219 #ifdef HAS_PROTO_MESSAGE_DUMP
220 template<> const char *proto_enum_to_string<enums::ClimateFanMode>(enums::ClimateFanMode value) {
221  switch (value) {
223  return "CLIMATE_FAN_ON";
225  return "CLIMATE_FAN_OFF";
227  return "CLIMATE_FAN_AUTO";
229  return "CLIMATE_FAN_LOW";
231  return "CLIMATE_FAN_MEDIUM";
233  return "CLIMATE_FAN_HIGH";
235  return "CLIMATE_FAN_MIDDLE";
237  return "CLIMATE_FAN_FOCUS";
239  return "CLIMATE_FAN_DIFFUSE";
241  return "CLIMATE_FAN_QUIET";
242  default:
243  return "UNKNOWN";
244  }
245 }
246 #endif
247 #ifdef HAS_PROTO_MESSAGE_DUMP
248 template<> const char *proto_enum_to_string<enums::ClimateSwingMode>(enums::ClimateSwingMode value) {
249  switch (value) {
251  return "CLIMATE_SWING_OFF";
253  return "CLIMATE_SWING_BOTH";
255  return "CLIMATE_SWING_VERTICAL";
257  return "CLIMATE_SWING_HORIZONTAL";
258  default:
259  return "UNKNOWN";
260  }
261 }
262 #endif
263 #ifdef HAS_PROTO_MESSAGE_DUMP
264 template<> const char *proto_enum_to_string<enums::ClimateAction>(enums::ClimateAction value) {
265  switch (value) {
267  return "CLIMATE_ACTION_OFF";
269  return "CLIMATE_ACTION_COOLING";
271  return "CLIMATE_ACTION_HEATING";
273  return "CLIMATE_ACTION_IDLE";
275  return "CLIMATE_ACTION_DRYING";
277  return "CLIMATE_ACTION_FAN";
278  default:
279  return "UNKNOWN";
280  }
281 }
282 #endif
283 #ifdef HAS_PROTO_MESSAGE_DUMP
284 template<> const char *proto_enum_to_string<enums::ClimatePreset>(enums::ClimatePreset value) {
285  switch (value) {
287  return "CLIMATE_PRESET_NONE";
289  return "CLIMATE_PRESET_HOME";
291  return "CLIMATE_PRESET_AWAY";
293  return "CLIMATE_PRESET_BOOST";
295  return "CLIMATE_PRESET_COMFORT";
297  return "CLIMATE_PRESET_ECO";
299  return "CLIMATE_PRESET_SLEEP";
301  return "CLIMATE_PRESET_ACTIVITY";
302  default:
303  return "UNKNOWN";
304  }
305 }
306 #endif
307 #ifdef HAS_PROTO_MESSAGE_DUMP
308 template<> const char *proto_enum_to_string<enums::NumberMode>(enums::NumberMode value) {
309  switch (value) {
311  return "NUMBER_MODE_AUTO";
313  return "NUMBER_MODE_BOX";
315  return "NUMBER_MODE_SLIDER";
316  default:
317  return "UNKNOWN";
318  }
319 }
320 #endif
321 #ifdef HAS_PROTO_MESSAGE_DUMP
322 template<> const char *proto_enum_to_string<enums::LockState>(enums::LockState value) {
323  switch (value) {
325  return "LOCK_STATE_NONE";
327  return "LOCK_STATE_LOCKED";
329  return "LOCK_STATE_UNLOCKED";
331  return "LOCK_STATE_JAMMED";
333  return "LOCK_STATE_LOCKING";
335  return "LOCK_STATE_UNLOCKING";
336  default:
337  return "UNKNOWN";
338  }
339 }
340 #endif
341 #ifdef HAS_PROTO_MESSAGE_DUMP
342 template<> const char *proto_enum_to_string<enums::LockCommand>(enums::LockCommand value) {
343  switch (value) {
344  case enums::LOCK_UNLOCK:
345  return "LOCK_UNLOCK";
346  case enums::LOCK_LOCK:
347  return "LOCK_LOCK";
348  case enums::LOCK_OPEN:
349  return "LOCK_OPEN";
350  default:
351  return "UNKNOWN";
352  }
353 }
354 #endif
355 #ifdef HAS_PROTO_MESSAGE_DUMP
356 template<> const char *proto_enum_to_string<enums::MediaPlayerState>(enums::MediaPlayerState value) {
357  switch (value) {
359  return "MEDIA_PLAYER_STATE_NONE";
361  return "MEDIA_PLAYER_STATE_IDLE";
363  return "MEDIA_PLAYER_STATE_PLAYING";
365  return "MEDIA_PLAYER_STATE_PAUSED";
366  default:
367  return "UNKNOWN";
368  }
369 }
370 #endif
371 #ifdef HAS_PROTO_MESSAGE_DUMP
372 template<> const char *proto_enum_to_string<enums::MediaPlayerCommand>(enums::MediaPlayerCommand value) {
373  switch (value) {
375  return "MEDIA_PLAYER_COMMAND_PLAY";
377  return "MEDIA_PLAYER_COMMAND_PAUSE";
379  return "MEDIA_PLAYER_COMMAND_STOP";
381  return "MEDIA_PLAYER_COMMAND_MUTE";
383  return "MEDIA_PLAYER_COMMAND_UNMUTE";
384  default:
385  return "UNKNOWN";
386  }
387 }
388 #endif
389 #ifdef HAS_PROTO_MESSAGE_DUMP
390 template<>
391 const char *proto_enum_to_string<enums::BluetoothDeviceRequestType>(enums::BluetoothDeviceRequestType value) {
392  switch (value) {
394  return "BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT";
396  return "BLUETOOTH_DEVICE_REQUEST_TYPE_DISCONNECT";
398  return "BLUETOOTH_DEVICE_REQUEST_TYPE_PAIR";
400  return "BLUETOOTH_DEVICE_REQUEST_TYPE_UNPAIR";
402  return "BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT_V3_WITH_CACHE";
404  return "BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT_V3_WITHOUT_CACHE";
406  return "BLUETOOTH_DEVICE_REQUEST_TYPE_CLEAR_CACHE";
407  default:
408  return "UNKNOWN";
409  }
410 }
411 #endif
412 #ifdef HAS_PROTO_MESSAGE_DUMP
413 template<> const char *proto_enum_to_string<enums::VoiceAssistantRequestFlag>(enums::VoiceAssistantRequestFlag value) {
414  switch (value) {
416  return "VOICE_ASSISTANT_REQUEST_NONE";
418  return "VOICE_ASSISTANT_REQUEST_USE_VAD";
420  return "VOICE_ASSISTANT_REQUEST_USE_WAKE_WORD";
421  default:
422  return "UNKNOWN";
423  }
424 }
425 #endif
426 #ifdef HAS_PROTO_MESSAGE_DUMP
427 template<> const char *proto_enum_to_string<enums::VoiceAssistantEvent>(enums::VoiceAssistantEvent value) {
428  switch (value) {
430  return "VOICE_ASSISTANT_ERROR";
432  return "VOICE_ASSISTANT_RUN_START";
434  return "VOICE_ASSISTANT_RUN_END";
436  return "VOICE_ASSISTANT_STT_START";
438  return "VOICE_ASSISTANT_STT_END";
440  return "VOICE_ASSISTANT_INTENT_START";
442  return "VOICE_ASSISTANT_INTENT_END";
444  return "VOICE_ASSISTANT_TTS_START";
446  return "VOICE_ASSISTANT_TTS_END";
448  return "VOICE_ASSISTANT_WAKE_WORD_START";
450  return "VOICE_ASSISTANT_WAKE_WORD_END";
452  return "VOICE_ASSISTANT_STT_VAD_START";
454  return "VOICE_ASSISTANT_STT_VAD_END";
456  return "VOICE_ASSISTANT_TTS_STREAM_START";
458  return "VOICE_ASSISTANT_TTS_STREAM_END";
459  default:
460  return "UNKNOWN";
461  }
462 }
463 #endif
464 #ifdef HAS_PROTO_MESSAGE_DUMP
465 template<> const char *proto_enum_to_string<enums::AlarmControlPanelState>(enums::AlarmControlPanelState value) {
466  switch (value) {
468  return "ALARM_STATE_DISARMED";
470  return "ALARM_STATE_ARMED_HOME";
472  return "ALARM_STATE_ARMED_AWAY";
474  return "ALARM_STATE_ARMED_NIGHT";
476  return "ALARM_STATE_ARMED_VACATION";
478  return "ALARM_STATE_ARMED_CUSTOM_BYPASS";
480  return "ALARM_STATE_PENDING";
482  return "ALARM_STATE_ARMING";
484  return "ALARM_STATE_DISARMING";
486  return "ALARM_STATE_TRIGGERED";
487  default:
488  return "UNKNOWN";
489  }
490 }
491 #endif
492 #ifdef HAS_PROTO_MESSAGE_DUMP
493 template<>
494 const char *proto_enum_to_string<enums::AlarmControlPanelStateCommand>(enums::AlarmControlPanelStateCommand value) {
495  switch (value) {
497  return "ALARM_CONTROL_PANEL_DISARM";
499  return "ALARM_CONTROL_PANEL_ARM_AWAY";
501  return "ALARM_CONTROL_PANEL_ARM_HOME";
503  return "ALARM_CONTROL_PANEL_ARM_NIGHT";
505  return "ALARM_CONTROL_PANEL_ARM_VACATION";
507  return "ALARM_CONTROL_PANEL_ARM_CUSTOM_BYPASS";
509  return "ALARM_CONTROL_PANEL_TRIGGER";
510  default:
511  return "UNKNOWN";
512  }
513 }
514 #endif
515 #ifdef HAS_PROTO_MESSAGE_DUMP
516 template<> const char *proto_enum_to_string<enums::TextMode>(enums::TextMode value) {
517  switch (value) {
519  return "TEXT_MODE_TEXT";
521  return "TEXT_MODE_PASSWORD";
522  default:
523  return "UNKNOWN";
524  }
525 }
526 #endif
527 bool HelloRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
528  switch (field_id) {
529  case 2: {
530  this->api_version_major = value.as_uint32();
531  return true;
532  }
533  case 3: {
534  this->api_version_minor = value.as_uint32();
535  return true;
536  }
537  default:
538  return false;
539  }
540 }
541 bool HelloRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
542  switch (field_id) {
543  case 1: {
544  this->client_info = value.as_string();
545  return true;
546  }
547  default:
548  return false;
549  }
550 }
552  buffer.encode_string(1, this->client_info);
553  buffer.encode_uint32(2, this->api_version_major);
554  buffer.encode_uint32(3, this->api_version_minor);
555 }
556 #ifdef HAS_PROTO_MESSAGE_DUMP
557 void HelloRequest::dump_to(std::string &out) const {
558  __attribute__((unused)) char buffer[64];
559  out.append("HelloRequest {\n");
560  out.append(" client_info: ");
561  out.append("'").append(this->client_info).append("'");
562  out.append("\n");
563 
564  out.append(" api_version_major: ");
565  sprintf(buffer, "%" PRIu32, this->api_version_major);
566  out.append(buffer);
567  out.append("\n");
568 
569  out.append(" api_version_minor: ");
570  sprintf(buffer, "%" PRIu32, this->api_version_minor);
571  out.append(buffer);
572  out.append("\n");
573  out.append("}");
574 }
575 #endif
576 bool HelloResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
577  switch (field_id) {
578  case 1: {
579  this->api_version_major = value.as_uint32();
580  return true;
581  }
582  case 2: {
583  this->api_version_minor = value.as_uint32();
584  return true;
585  }
586  default:
587  return false;
588  }
589 }
590 bool HelloResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
591  switch (field_id) {
592  case 3: {
593  this->server_info = value.as_string();
594  return true;
595  }
596  case 4: {
597  this->name = value.as_string();
598  return true;
599  }
600  default:
601  return false;
602  }
603 }
605  buffer.encode_uint32(1, this->api_version_major);
606  buffer.encode_uint32(2, this->api_version_minor);
607  buffer.encode_string(3, this->server_info);
608  buffer.encode_string(4, this->name);
609 }
610 #ifdef HAS_PROTO_MESSAGE_DUMP
611 void HelloResponse::dump_to(std::string &out) const {
612  __attribute__((unused)) char buffer[64];
613  out.append("HelloResponse {\n");
614  out.append(" api_version_major: ");
615  sprintf(buffer, "%" PRIu32, this->api_version_major);
616  out.append(buffer);
617  out.append("\n");
618 
619  out.append(" api_version_minor: ");
620  sprintf(buffer, "%" PRIu32, this->api_version_minor);
621  out.append(buffer);
622  out.append("\n");
623 
624  out.append(" server_info: ");
625  out.append("'").append(this->server_info).append("'");
626  out.append("\n");
627 
628  out.append(" name: ");
629  out.append("'").append(this->name).append("'");
630  out.append("\n");
631  out.append("}");
632 }
633 #endif
634 bool ConnectRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
635  switch (field_id) {
636  case 1: {
637  this->password = value.as_string();
638  return true;
639  }
640  default:
641  return false;
642  }
643 }
644 void ConnectRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_string(1, this->password); }
645 #ifdef HAS_PROTO_MESSAGE_DUMP
646 void ConnectRequest::dump_to(std::string &out) const {
647  __attribute__((unused)) char buffer[64];
648  out.append("ConnectRequest {\n");
649  out.append(" password: ");
650  out.append("'").append(this->password).append("'");
651  out.append("\n");
652  out.append("}");
653 }
654 #endif
655 bool ConnectResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
656  switch (field_id) {
657  case 1: {
658  this->invalid_password = value.as_bool();
659  return true;
660  }
661  default:
662  return false;
663  }
664 }
665 void ConnectResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->invalid_password); }
666 #ifdef HAS_PROTO_MESSAGE_DUMP
667 void ConnectResponse::dump_to(std::string &out) const {
668  __attribute__((unused)) char buffer[64];
669  out.append("ConnectResponse {\n");
670  out.append(" invalid_password: ");
671  out.append(YESNO(this->invalid_password));
672  out.append("\n");
673  out.append("}");
674 }
675 #endif
677 #ifdef HAS_PROTO_MESSAGE_DUMP
678 void DisconnectRequest::dump_to(std::string &out) const { out.append("DisconnectRequest {}"); }
679 #endif
681 #ifdef HAS_PROTO_MESSAGE_DUMP
682 void DisconnectResponse::dump_to(std::string &out) const { out.append("DisconnectResponse {}"); }
683 #endif
685 #ifdef HAS_PROTO_MESSAGE_DUMP
686 void PingRequest::dump_to(std::string &out) const { out.append("PingRequest {}"); }
687 #endif
689 #ifdef HAS_PROTO_MESSAGE_DUMP
690 void PingResponse::dump_to(std::string &out) const { out.append("PingResponse {}"); }
691 #endif
693 #ifdef HAS_PROTO_MESSAGE_DUMP
694 void DeviceInfoRequest::dump_to(std::string &out) const { out.append("DeviceInfoRequest {}"); }
695 #endif
696 bool DeviceInfoResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
697  switch (field_id) {
698  case 1: {
699  this->uses_password = value.as_bool();
700  return true;
701  }
702  case 7: {
703  this->has_deep_sleep = value.as_bool();
704  return true;
705  }
706  case 10: {
707  this->webserver_port = value.as_uint32();
708  return true;
709  }
710  case 11: {
711  this->legacy_bluetooth_proxy_version = value.as_uint32();
712  return true;
713  }
714  case 15: {
715  this->bluetooth_proxy_feature_flags = value.as_uint32();
716  return true;
717  }
718  case 14: {
719  this->voice_assistant_version = value.as_uint32();
720  return true;
721  }
722  default:
723  return false;
724  }
725 }
727  switch (field_id) {
728  case 2: {
729  this->name = value.as_string();
730  return true;
731  }
732  case 3: {
733  this->mac_address = value.as_string();
734  return true;
735  }
736  case 4: {
737  this->esphome_version = value.as_string();
738  return true;
739  }
740  case 5: {
741  this->compilation_time = value.as_string();
742  return true;
743  }
744  case 6: {
745  this->model = value.as_string();
746  return true;
747  }
748  case 8: {
749  this->project_name = value.as_string();
750  return true;
751  }
752  case 9: {
753  this->project_version = value.as_string();
754  return true;
755  }
756  case 12: {
757  this->manufacturer = value.as_string();
758  return true;
759  }
760  case 13: {
761  this->friendly_name = value.as_string();
762  return true;
763  }
764  case 16: {
765  this->suggested_area = value.as_string();
766  return true;
767  }
768  default:
769  return false;
770  }
771 }
773  buffer.encode_bool(1, this->uses_password);
774  buffer.encode_string(2, this->name);
775  buffer.encode_string(3, this->mac_address);
776  buffer.encode_string(4, this->esphome_version);
777  buffer.encode_string(5, this->compilation_time);
778  buffer.encode_string(6, this->model);
779  buffer.encode_bool(7, this->has_deep_sleep);
780  buffer.encode_string(8, this->project_name);
781  buffer.encode_string(9, this->project_version);
782  buffer.encode_uint32(10, this->webserver_port);
783  buffer.encode_uint32(11, this->legacy_bluetooth_proxy_version);
784  buffer.encode_uint32(15, this->bluetooth_proxy_feature_flags);
785  buffer.encode_string(12, this->manufacturer);
786  buffer.encode_string(13, this->friendly_name);
787  buffer.encode_uint32(14, this->voice_assistant_version);
788  buffer.encode_string(16, this->suggested_area);
789 }
790 #ifdef HAS_PROTO_MESSAGE_DUMP
791 void DeviceInfoResponse::dump_to(std::string &out) const {
792  __attribute__((unused)) char buffer[64];
793  out.append("DeviceInfoResponse {\n");
794  out.append(" uses_password: ");
795  out.append(YESNO(this->uses_password));
796  out.append("\n");
797 
798  out.append(" name: ");
799  out.append("'").append(this->name).append("'");
800  out.append("\n");
801 
802  out.append(" mac_address: ");
803  out.append("'").append(this->mac_address).append("'");
804  out.append("\n");
805 
806  out.append(" esphome_version: ");
807  out.append("'").append(this->esphome_version).append("'");
808  out.append("\n");
809 
810  out.append(" compilation_time: ");
811  out.append("'").append(this->compilation_time).append("'");
812  out.append("\n");
813 
814  out.append(" model: ");
815  out.append("'").append(this->model).append("'");
816  out.append("\n");
817 
818  out.append(" has_deep_sleep: ");
819  out.append(YESNO(this->has_deep_sleep));
820  out.append("\n");
821 
822  out.append(" project_name: ");
823  out.append("'").append(this->project_name).append("'");
824  out.append("\n");
825 
826  out.append(" project_version: ");
827  out.append("'").append(this->project_version).append("'");
828  out.append("\n");
829 
830  out.append(" webserver_port: ");
831  sprintf(buffer, "%" PRIu32, this->webserver_port);
832  out.append(buffer);
833  out.append("\n");
834 
835  out.append(" legacy_bluetooth_proxy_version: ");
836  sprintf(buffer, "%" PRIu32, this->legacy_bluetooth_proxy_version);
837  out.append(buffer);
838  out.append("\n");
839 
840  out.append(" bluetooth_proxy_feature_flags: ");
841  sprintf(buffer, "%" PRIu32, this->bluetooth_proxy_feature_flags);
842  out.append(buffer);
843  out.append("\n");
844 
845  out.append(" manufacturer: ");
846  out.append("'").append(this->manufacturer).append("'");
847  out.append("\n");
848 
849  out.append(" friendly_name: ");
850  out.append("'").append(this->friendly_name).append("'");
851  out.append("\n");
852 
853  out.append(" voice_assistant_version: ");
854  sprintf(buffer, "%" PRIu32, this->voice_assistant_version);
855  out.append(buffer);
856  out.append("\n");
857 
858  out.append(" suggested_area: ");
859  out.append("'").append(this->suggested_area).append("'");
860  out.append("\n");
861  out.append("}");
862 }
863 #endif
865 #ifdef HAS_PROTO_MESSAGE_DUMP
866 void ListEntitiesRequest::dump_to(std::string &out) const { out.append("ListEntitiesRequest {}"); }
867 #endif
869 #ifdef HAS_PROTO_MESSAGE_DUMP
870 void ListEntitiesDoneResponse::dump_to(std::string &out) const { out.append("ListEntitiesDoneResponse {}"); }
871 #endif
873 #ifdef HAS_PROTO_MESSAGE_DUMP
874 void SubscribeStatesRequest::dump_to(std::string &out) const { out.append("SubscribeStatesRequest {}"); }
875 #endif
877  switch (field_id) {
878  case 6: {
879  this->is_status_binary_sensor = value.as_bool();
880  return true;
881  }
882  case 7: {
883  this->disabled_by_default = value.as_bool();
884  return true;
885  }
886  case 9: {
887  this->entity_category = value.as_enum<enums::EntityCategory>();
888  return true;
889  }
890  default:
891  return false;
892  }
893 }
895  switch (field_id) {
896  case 1: {
897  this->object_id = value.as_string();
898  return true;
899  }
900  case 3: {
901  this->name = value.as_string();
902  return true;
903  }
904  case 4: {
905  this->unique_id = value.as_string();
906  return true;
907  }
908  case 5: {
909  this->device_class = value.as_string();
910  return true;
911  }
912  case 8: {
913  this->icon = value.as_string();
914  return true;
915  }
916  default:
917  return false;
918  }
919 }
921  switch (field_id) {
922  case 2: {
923  this->key = value.as_fixed32();
924  return true;
925  }
926  default:
927  return false;
928  }
929 }
931  buffer.encode_string(1, this->object_id);
932  buffer.encode_fixed32(2, this->key);
933  buffer.encode_string(3, this->name);
934  buffer.encode_string(4, this->unique_id);
935  buffer.encode_string(5, this->device_class);
936  buffer.encode_bool(6, this->is_status_binary_sensor);
937  buffer.encode_bool(7, this->disabled_by_default);
938  buffer.encode_string(8, this->icon);
939  buffer.encode_enum<enums::EntityCategory>(9, this->entity_category);
940 }
941 #ifdef HAS_PROTO_MESSAGE_DUMP
942 void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const {
943  __attribute__((unused)) char buffer[64];
944  out.append("ListEntitiesBinarySensorResponse {\n");
945  out.append(" object_id: ");
946  out.append("'").append(this->object_id).append("'");
947  out.append("\n");
948 
949  out.append(" key: ");
950  sprintf(buffer, "%" PRIu32, this->key);
951  out.append(buffer);
952  out.append("\n");
953 
954  out.append(" name: ");
955  out.append("'").append(this->name).append("'");
956  out.append("\n");
957 
958  out.append(" unique_id: ");
959  out.append("'").append(this->unique_id).append("'");
960  out.append("\n");
961 
962  out.append(" device_class: ");
963  out.append("'").append(this->device_class).append("'");
964  out.append("\n");
965 
966  out.append(" is_status_binary_sensor: ");
967  out.append(YESNO(this->is_status_binary_sensor));
968  out.append("\n");
969 
970  out.append(" disabled_by_default: ");
971  out.append(YESNO(this->disabled_by_default));
972  out.append("\n");
973 
974  out.append(" icon: ");
975  out.append("'").append(this->icon).append("'");
976  out.append("\n");
977 
978  out.append(" entity_category: ");
979  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
980  out.append("\n");
981  out.append("}");
982 }
983 #endif
985  switch (field_id) {
986  case 2: {
987  this->state = value.as_bool();
988  return true;
989  }
990  case 3: {
991  this->missing_state = value.as_bool();
992  return true;
993  }
994  default:
995  return false;
996  }
997 }
998 bool BinarySensorStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
999  switch (field_id) {
1000  case 1: {
1001  this->key = value.as_fixed32();
1002  return true;
1003  }
1004  default:
1005  return false;
1006  }
1007 }
1009  buffer.encode_fixed32(1, this->key);
1010  buffer.encode_bool(2, this->state);
1011  buffer.encode_bool(3, this->missing_state);
1012 }
1013 #ifdef HAS_PROTO_MESSAGE_DUMP
1014 void BinarySensorStateResponse::dump_to(std::string &out) const {
1015  __attribute__((unused)) char buffer[64];
1016  out.append("BinarySensorStateResponse {\n");
1017  out.append(" key: ");
1018  sprintf(buffer, "%" PRIu32, this->key);
1019  out.append(buffer);
1020  out.append("\n");
1021 
1022  out.append(" state: ");
1023  out.append(YESNO(this->state));
1024  out.append("\n");
1025 
1026  out.append(" missing_state: ");
1027  out.append(YESNO(this->missing_state));
1028  out.append("\n");
1029  out.append("}");
1030 }
1031 #endif
1033  switch (field_id) {
1034  case 5: {
1035  this->assumed_state = value.as_bool();
1036  return true;
1037  }
1038  case 6: {
1039  this->supports_position = value.as_bool();
1040  return true;
1041  }
1042  case 7: {
1043  this->supports_tilt = value.as_bool();
1044  return true;
1045  }
1046  case 9: {
1047  this->disabled_by_default = value.as_bool();
1048  return true;
1049  }
1050  case 11: {
1051  this->entity_category = value.as_enum<enums::EntityCategory>();
1052  return true;
1053  }
1054  case 12: {
1055  this->supports_stop = value.as_bool();
1056  return true;
1057  }
1058  default:
1059  return false;
1060  }
1061 }
1063  switch (field_id) {
1064  case 1: {
1065  this->object_id = value.as_string();
1066  return true;
1067  }
1068  case 3: {
1069  this->name = value.as_string();
1070  return true;
1071  }
1072  case 4: {
1073  this->unique_id = value.as_string();
1074  return true;
1075  }
1076  case 8: {
1077  this->device_class = value.as_string();
1078  return true;
1079  }
1080  case 10: {
1081  this->icon = value.as_string();
1082  return true;
1083  }
1084  default:
1085  return false;
1086  }
1087 }
1088 bool ListEntitiesCoverResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
1089  switch (field_id) {
1090  case 2: {
1091  this->key = value.as_fixed32();
1092  return true;
1093  }
1094  default:
1095  return false;
1096  }
1097 }
1099  buffer.encode_string(1, this->object_id);
1100  buffer.encode_fixed32(2, this->key);
1101  buffer.encode_string(3, this->name);
1102  buffer.encode_string(4, this->unique_id);
1103  buffer.encode_bool(5, this->assumed_state);
1104  buffer.encode_bool(6, this->supports_position);
1105  buffer.encode_bool(7, this->supports_tilt);
1106  buffer.encode_string(8, this->device_class);
1107  buffer.encode_bool(9, this->disabled_by_default);
1108  buffer.encode_string(10, this->icon);
1109  buffer.encode_enum<enums::EntityCategory>(11, this->entity_category);
1110  buffer.encode_bool(12, this->supports_stop);
1111 }
1112 #ifdef HAS_PROTO_MESSAGE_DUMP
1113 void ListEntitiesCoverResponse::dump_to(std::string &out) const {
1114  __attribute__((unused)) char buffer[64];
1115  out.append("ListEntitiesCoverResponse {\n");
1116  out.append(" object_id: ");
1117  out.append("'").append(this->object_id).append("'");
1118  out.append("\n");
1119 
1120  out.append(" key: ");
1121  sprintf(buffer, "%" PRIu32, this->key);
1122  out.append(buffer);
1123  out.append("\n");
1124 
1125  out.append(" name: ");
1126  out.append("'").append(this->name).append("'");
1127  out.append("\n");
1128 
1129  out.append(" unique_id: ");
1130  out.append("'").append(this->unique_id).append("'");
1131  out.append("\n");
1132 
1133  out.append(" assumed_state: ");
1134  out.append(YESNO(this->assumed_state));
1135  out.append("\n");
1136 
1137  out.append(" supports_position: ");
1138  out.append(YESNO(this->supports_position));
1139  out.append("\n");
1140 
1141  out.append(" supports_tilt: ");
1142  out.append(YESNO(this->supports_tilt));
1143  out.append("\n");
1144 
1145  out.append(" device_class: ");
1146  out.append("'").append(this->device_class).append("'");
1147  out.append("\n");
1148 
1149  out.append(" disabled_by_default: ");
1150  out.append(YESNO(this->disabled_by_default));
1151  out.append("\n");
1152 
1153  out.append(" icon: ");
1154  out.append("'").append(this->icon).append("'");
1155  out.append("\n");
1156 
1157  out.append(" entity_category: ");
1158  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
1159  out.append("\n");
1160 
1161  out.append(" supports_stop: ");
1162  out.append(YESNO(this->supports_stop));
1163  out.append("\n");
1164  out.append("}");
1165 }
1166 #endif
1167 bool CoverStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
1168  switch (field_id) {
1169  case 2: {
1170  this->legacy_state = value.as_enum<enums::LegacyCoverState>();
1171  return true;
1172  }
1173  case 5: {
1174  this->current_operation = value.as_enum<enums::CoverOperation>();
1175  return true;
1176  }
1177  default:
1178  return false;
1179  }
1180 }
1181 bool CoverStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
1182  switch (field_id) {
1183  case 1: {
1184  this->key = value.as_fixed32();
1185  return true;
1186  }
1187  case 3: {
1188  this->position = value.as_float();
1189  return true;
1190  }
1191  case 4: {
1192  this->tilt = value.as_float();
1193  return true;
1194  }
1195  default:
1196  return false;
1197  }
1198 }
1200  buffer.encode_fixed32(1, this->key);
1201  buffer.encode_enum<enums::LegacyCoverState>(2, this->legacy_state);
1202  buffer.encode_float(3, this->position);
1203  buffer.encode_float(4, this->tilt);
1204  buffer.encode_enum<enums::CoverOperation>(5, this->current_operation);
1205 }
1206 #ifdef HAS_PROTO_MESSAGE_DUMP
1207 void CoverStateResponse::dump_to(std::string &out) const {
1208  __attribute__((unused)) char buffer[64];
1209  out.append("CoverStateResponse {\n");
1210  out.append(" key: ");
1211  sprintf(buffer, "%" PRIu32, this->key);
1212  out.append(buffer);
1213  out.append("\n");
1214 
1215  out.append(" legacy_state: ");
1216  out.append(proto_enum_to_string<enums::LegacyCoverState>(this->legacy_state));
1217  out.append("\n");
1218 
1219  out.append(" position: ");
1220  sprintf(buffer, "%g", this->position);
1221  out.append(buffer);
1222  out.append("\n");
1223 
1224  out.append(" tilt: ");
1225  sprintf(buffer, "%g", this->tilt);
1226  out.append(buffer);
1227  out.append("\n");
1228 
1229  out.append(" current_operation: ");
1230  out.append(proto_enum_to_string<enums::CoverOperation>(this->current_operation));
1231  out.append("\n");
1232  out.append("}");
1233 }
1234 #endif
1235 bool CoverCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1236  switch (field_id) {
1237  case 2: {
1238  this->has_legacy_command = value.as_bool();
1239  return true;
1240  }
1241  case 3: {
1242  this->legacy_command = value.as_enum<enums::LegacyCoverCommand>();
1243  return true;
1244  }
1245  case 4: {
1246  this->has_position = value.as_bool();
1247  return true;
1248  }
1249  case 6: {
1250  this->has_tilt = value.as_bool();
1251  return true;
1252  }
1253  case 8: {
1254  this->stop = value.as_bool();
1255  return true;
1256  }
1257  default:
1258  return false;
1259  }
1260 }
1261 bool CoverCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1262  switch (field_id) {
1263  case 1: {
1264  this->key = value.as_fixed32();
1265  return true;
1266  }
1267  case 5: {
1268  this->position = value.as_float();
1269  return true;
1270  }
1271  case 7: {
1272  this->tilt = value.as_float();
1273  return true;
1274  }
1275  default:
1276  return false;
1277  }
1278 }
1280  buffer.encode_fixed32(1, this->key);
1281  buffer.encode_bool(2, this->has_legacy_command);
1282  buffer.encode_enum<enums::LegacyCoverCommand>(3, this->legacy_command);
1283  buffer.encode_bool(4, this->has_position);
1284  buffer.encode_float(5, this->position);
1285  buffer.encode_bool(6, this->has_tilt);
1286  buffer.encode_float(7, this->tilt);
1287  buffer.encode_bool(8, this->stop);
1288 }
1289 #ifdef HAS_PROTO_MESSAGE_DUMP
1290 void CoverCommandRequest::dump_to(std::string &out) const {
1291  __attribute__((unused)) char buffer[64];
1292  out.append("CoverCommandRequest {\n");
1293  out.append(" key: ");
1294  sprintf(buffer, "%" PRIu32, this->key);
1295  out.append(buffer);
1296  out.append("\n");
1297 
1298  out.append(" has_legacy_command: ");
1299  out.append(YESNO(this->has_legacy_command));
1300  out.append("\n");
1301 
1302  out.append(" legacy_command: ");
1303  out.append(proto_enum_to_string<enums::LegacyCoverCommand>(this->legacy_command));
1304  out.append("\n");
1305 
1306  out.append(" has_position: ");
1307  out.append(YESNO(this->has_position));
1308  out.append("\n");
1309 
1310  out.append(" position: ");
1311  sprintf(buffer, "%g", this->position);
1312  out.append(buffer);
1313  out.append("\n");
1314 
1315  out.append(" has_tilt: ");
1316  out.append(YESNO(this->has_tilt));
1317  out.append("\n");
1318 
1319  out.append(" tilt: ");
1320  sprintf(buffer, "%g", this->tilt);
1321  out.append(buffer);
1322  out.append("\n");
1323 
1324  out.append(" stop: ");
1325  out.append(YESNO(this->stop));
1326  out.append("\n");
1327  out.append("}");
1328 }
1329 #endif
1330 bool ListEntitiesFanResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
1331  switch (field_id) {
1332  case 5: {
1333  this->supports_oscillation = value.as_bool();
1334  return true;
1335  }
1336  case 6: {
1337  this->supports_speed = value.as_bool();
1338  return true;
1339  }
1340  case 7: {
1341  this->supports_direction = value.as_bool();
1342  return true;
1343  }
1344  case 8: {
1345  this->supported_speed_count = value.as_int32();
1346  return true;
1347  }
1348  case 9: {
1349  this->disabled_by_default = value.as_bool();
1350  return true;
1351  }
1352  case 11: {
1353  this->entity_category = value.as_enum<enums::EntityCategory>();
1354  return true;
1355  }
1356  default:
1357  return false;
1358  }
1359 }
1361  switch (field_id) {
1362  case 1: {
1363  this->object_id = value.as_string();
1364  return true;
1365  }
1366  case 3: {
1367  this->name = value.as_string();
1368  return true;
1369  }
1370  case 4: {
1371  this->unique_id = value.as_string();
1372  return true;
1373  }
1374  case 10: {
1375  this->icon = value.as_string();
1376  return true;
1377  }
1378  case 12: {
1379  this->supported_preset_modes.push_back(value.as_string());
1380  return true;
1381  }
1382  default:
1383  return false;
1384  }
1385 }
1386 bool ListEntitiesFanResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
1387  switch (field_id) {
1388  case 2: {
1389  this->key = value.as_fixed32();
1390  return true;
1391  }
1392  default:
1393  return false;
1394  }
1395 }
1397  buffer.encode_string(1, this->object_id);
1398  buffer.encode_fixed32(2, this->key);
1399  buffer.encode_string(3, this->name);
1400  buffer.encode_string(4, this->unique_id);
1401  buffer.encode_bool(5, this->supports_oscillation);
1402  buffer.encode_bool(6, this->supports_speed);
1403  buffer.encode_bool(7, this->supports_direction);
1404  buffer.encode_int32(8, this->supported_speed_count);
1405  buffer.encode_bool(9, this->disabled_by_default);
1406  buffer.encode_string(10, this->icon);
1407  buffer.encode_enum<enums::EntityCategory>(11, this->entity_category);
1408  for (auto &it : this->supported_preset_modes) {
1409  buffer.encode_string(12, it, true);
1410  }
1411 }
1412 #ifdef HAS_PROTO_MESSAGE_DUMP
1413 void ListEntitiesFanResponse::dump_to(std::string &out) const {
1414  __attribute__((unused)) char buffer[64];
1415  out.append("ListEntitiesFanResponse {\n");
1416  out.append(" object_id: ");
1417  out.append("'").append(this->object_id).append("'");
1418  out.append("\n");
1419 
1420  out.append(" key: ");
1421  sprintf(buffer, "%" PRIu32, this->key);
1422  out.append(buffer);
1423  out.append("\n");
1424 
1425  out.append(" name: ");
1426  out.append("'").append(this->name).append("'");
1427  out.append("\n");
1428 
1429  out.append(" unique_id: ");
1430  out.append("'").append(this->unique_id).append("'");
1431  out.append("\n");
1432 
1433  out.append(" supports_oscillation: ");
1434  out.append(YESNO(this->supports_oscillation));
1435  out.append("\n");
1436 
1437  out.append(" supports_speed: ");
1438  out.append(YESNO(this->supports_speed));
1439  out.append("\n");
1440 
1441  out.append(" supports_direction: ");
1442  out.append(YESNO(this->supports_direction));
1443  out.append("\n");
1444 
1445  out.append(" supported_speed_count: ");
1446  sprintf(buffer, "%" PRId32, this->supported_speed_count);
1447  out.append(buffer);
1448  out.append("\n");
1449 
1450  out.append(" disabled_by_default: ");
1451  out.append(YESNO(this->disabled_by_default));
1452  out.append("\n");
1453 
1454  out.append(" icon: ");
1455  out.append("'").append(this->icon).append("'");
1456  out.append("\n");
1457 
1458  out.append(" entity_category: ");
1459  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
1460  out.append("\n");
1461 
1462  for (const auto &it : this->supported_preset_modes) {
1463  out.append(" supported_preset_modes: ");
1464  out.append("'").append(it).append("'");
1465  out.append("\n");
1466  }
1467  out.append("}");
1468 }
1469 #endif
1470 bool FanStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
1471  switch (field_id) {
1472  case 2: {
1473  this->state = value.as_bool();
1474  return true;
1475  }
1476  case 3: {
1477  this->oscillating = value.as_bool();
1478  return true;
1479  }
1480  case 4: {
1481  this->speed = value.as_enum<enums::FanSpeed>();
1482  return true;
1483  }
1484  case 5: {
1485  this->direction = value.as_enum<enums::FanDirection>();
1486  return true;
1487  }
1488  case 6: {
1489  this->speed_level = value.as_int32();
1490  return true;
1491  }
1492  default:
1493  return false;
1494  }
1495 }
1497  switch (field_id) {
1498  case 7: {
1499  this->preset_mode = value.as_string();
1500  return true;
1501  }
1502  default:
1503  return false;
1504  }
1505 }
1506 bool FanStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
1507  switch (field_id) {
1508  case 1: {
1509  this->key = value.as_fixed32();
1510  return true;
1511  }
1512  default:
1513  return false;
1514  }
1515 }
1517  buffer.encode_fixed32(1, this->key);
1518  buffer.encode_bool(2, this->state);
1519  buffer.encode_bool(3, this->oscillating);
1520  buffer.encode_enum<enums::FanSpeed>(4, this->speed);
1521  buffer.encode_enum<enums::FanDirection>(5, this->direction);
1522  buffer.encode_int32(6, this->speed_level);
1523  buffer.encode_string(7, this->preset_mode);
1524 }
1525 #ifdef HAS_PROTO_MESSAGE_DUMP
1526 void FanStateResponse::dump_to(std::string &out) const {
1527  __attribute__((unused)) char buffer[64];
1528  out.append("FanStateResponse {\n");
1529  out.append(" key: ");
1530  sprintf(buffer, "%" PRIu32, this->key);
1531  out.append(buffer);
1532  out.append("\n");
1533 
1534  out.append(" state: ");
1535  out.append(YESNO(this->state));
1536  out.append("\n");
1537 
1538  out.append(" oscillating: ");
1539  out.append(YESNO(this->oscillating));
1540  out.append("\n");
1541 
1542  out.append(" speed: ");
1543  out.append(proto_enum_to_string<enums::FanSpeed>(this->speed));
1544  out.append("\n");
1545 
1546  out.append(" direction: ");
1547  out.append(proto_enum_to_string<enums::FanDirection>(this->direction));
1548  out.append("\n");
1549 
1550  out.append(" speed_level: ");
1551  sprintf(buffer, "%" PRId32, this->speed_level);
1552  out.append(buffer);
1553  out.append("\n");
1554 
1555  out.append(" preset_mode: ");
1556  out.append("'").append(this->preset_mode).append("'");
1557  out.append("\n");
1558  out.append("}");
1559 }
1560 #endif
1561 bool FanCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
1562  switch (field_id) {
1563  case 2: {
1564  this->has_state = value.as_bool();
1565  return true;
1566  }
1567  case 3: {
1568  this->state = value.as_bool();
1569  return true;
1570  }
1571  case 4: {
1572  this->has_speed = value.as_bool();
1573  return true;
1574  }
1575  case 5: {
1576  this->speed = value.as_enum<enums::FanSpeed>();
1577  return true;
1578  }
1579  case 6: {
1580  this->has_oscillating = value.as_bool();
1581  return true;
1582  }
1583  case 7: {
1584  this->oscillating = value.as_bool();
1585  return true;
1586  }
1587  case 8: {
1588  this->has_direction = value.as_bool();
1589  return true;
1590  }
1591  case 9: {
1592  this->direction = value.as_enum<enums::FanDirection>();
1593  return true;
1594  }
1595  case 10: {
1596  this->has_speed_level = value.as_bool();
1597  return true;
1598  }
1599  case 11: {
1600  this->speed_level = value.as_int32();
1601  return true;
1602  }
1603  case 12: {
1604  this->has_preset_mode = value.as_bool();
1605  return true;
1606  }
1607  default:
1608  return false;
1609  }
1610 }
1612  switch (field_id) {
1613  case 13: {
1614  this->preset_mode = value.as_string();
1615  return true;
1616  }
1617  default:
1618  return false;
1619  }
1620 }
1621 bool FanCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
1622  switch (field_id) {
1623  case 1: {
1624  this->key = value.as_fixed32();
1625  return true;
1626  }
1627  default:
1628  return false;
1629  }
1630 }
1632  buffer.encode_fixed32(1, this->key);
1633  buffer.encode_bool(2, this->has_state);
1634  buffer.encode_bool(3, this->state);
1635  buffer.encode_bool(4, this->has_speed);
1636  buffer.encode_enum<enums::FanSpeed>(5, this->speed);
1637  buffer.encode_bool(6, this->has_oscillating);
1638  buffer.encode_bool(7, this->oscillating);
1639  buffer.encode_bool(8, this->has_direction);
1640  buffer.encode_enum<enums::FanDirection>(9, this->direction);
1641  buffer.encode_bool(10, this->has_speed_level);
1642  buffer.encode_int32(11, this->speed_level);
1643  buffer.encode_bool(12, this->has_preset_mode);
1644  buffer.encode_string(13, this->preset_mode);
1645 }
1646 #ifdef HAS_PROTO_MESSAGE_DUMP
1647 void FanCommandRequest::dump_to(std::string &out) const {
1648  __attribute__((unused)) char buffer[64];
1649  out.append("FanCommandRequest {\n");
1650  out.append(" key: ");
1651  sprintf(buffer, "%" PRIu32, this->key);
1652  out.append(buffer);
1653  out.append("\n");
1654 
1655  out.append(" has_state: ");
1656  out.append(YESNO(this->has_state));
1657  out.append("\n");
1658 
1659  out.append(" state: ");
1660  out.append(YESNO(this->state));
1661  out.append("\n");
1662 
1663  out.append(" has_speed: ");
1664  out.append(YESNO(this->has_speed));
1665  out.append("\n");
1666 
1667  out.append(" speed: ");
1668  out.append(proto_enum_to_string<enums::FanSpeed>(this->speed));
1669  out.append("\n");
1670 
1671  out.append(" has_oscillating: ");
1672  out.append(YESNO(this->has_oscillating));
1673  out.append("\n");
1674 
1675  out.append(" oscillating: ");
1676  out.append(YESNO(this->oscillating));
1677  out.append("\n");
1678 
1679  out.append(" has_direction: ");
1680  out.append(YESNO(this->has_direction));
1681  out.append("\n");
1682 
1683  out.append(" direction: ");
1684  out.append(proto_enum_to_string<enums::FanDirection>(this->direction));
1685  out.append("\n");
1686 
1687  out.append(" has_speed_level: ");
1688  out.append(YESNO(this->has_speed_level));
1689  out.append("\n");
1690 
1691  out.append(" speed_level: ");
1692  sprintf(buffer, "%" PRId32, this->speed_level);
1693  out.append(buffer);
1694  out.append("\n");
1695 
1696  out.append(" has_preset_mode: ");
1697  out.append(YESNO(this->has_preset_mode));
1698  out.append("\n");
1699 
1700  out.append(" preset_mode: ");
1701  out.append("'").append(this->preset_mode).append("'");
1702  out.append("\n");
1703  out.append("}");
1704 }
1705 #endif
1707  switch (field_id) {
1708  case 12: {
1709  this->supported_color_modes.push_back(value.as_enum<enums::ColorMode>());
1710  return true;
1711  }
1712  case 5: {
1713  this->legacy_supports_brightness = value.as_bool();
1714  return true;
1715  }
1716  case 6: {
1717  this->legacy_supports_rgb = value.as_bool();
1718  return true;
1719  }
1720  case 7: {
1721  this->legacy_supports_white_value = value.as_bool();
1722  return true;
1723  }
1724  case 8: {
1725  this->legacy_supports_color_temperature = value.as_bool();
1726  return true;
1727  }
1728  case 13: {
1729  this->disabled_by_default = value.as_bool();
1730  return true;
1731  }
1732  case 15: {
1733  this->entity_category = value.as_enum<enums::EntityCategory>();
1734  return true;
1735  }
1736  default:
1737  return false;
1738  }
1739 }
1741  switch (field_id) {
1742  case 1: {
1743  this->object_id = value.as_string();
1744  return true;
1745  }
1746  case 3: {
1747  this->name = value.as_string();
1748  return true;
1749  }
1750  case 4: {
1751  this->unique_id = value.as_string();
1752  return true;
1753  }
1754  case 11: {
1755  this->effects.push_back(value.as_string());
1756  return true;
1757  }
1758  case 14: {
1759  this->icon = value.as_string();
1760  return true;
1761  }
1762  default:
1763  return false;
1764  }
1765 }
1766 bool ListEntitiesLightResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
1767  switch (field_id) {
1768  case 2: {
1769  this->key = value.as_fixed32();
1770  return true;
1771  }
1772  case 9: {
1773  this->min_mireds = value.as_float();
1774  return true;
1775  }
1776  case 10: {
1777  this->max_mireds = value.as_float();
1778  return true;
1779  }
1780  default:
1781  return false;
1782  }
1783 }
1785  buffer.encode_string(1, this->object_id);
1786  buffer.encode_fixed32(2, this->key);
1787  buffer.encode_string(3, this->name);
1788  buffer.encode_string(4, this->unique_id);
1789  for (auto &it : this->supported_color_modes) {
1790  buffer.encode_enum<enums::ColorMode>(12, it, true);
1791  }
1792  buffer.encode_bool(5, this->legacy_supports_brightness);
1793  buffer.encode_bool(6, this->legacy_supports_rgb);
1794  buffer.encode_bool(7, this->legacy_supports_white_value);
1795  buffer.encode_bool(8, this->legacy_supports_color_temperature);
1796  buffer.encode_float(9, this->min_mireds);
1797  buffer.encode_float(10, this->max_mireds);
1798  for (auto &it : this->effects) {
1799  buffer.encode_string(11, it, true);
1800  }
1801  buffer.encode_bool(13, this->disabled_by_default);
1802  buffer.encode_string(14, this->icon);
1803  buffer.encode_enum<enums::EntityCategory>(15, this->entity_category);
1804 }
1805 #ifdef HAS_PROTO_MESSAGE_DUMP
1806 void ListEntitiesLightResponse::dump_to(std::string &out) const {
1807  __attribute__((unused)) char buffer[64];
1808  out.append("ListEntitiesLightResponse {\n");
1809  out.append(" object_id: ");
1810  out.append("'").append(this->object_id).append("'");
1811  out.append("\n");
1812 
1813  out.append(" key: ");
1814  sprintf(buffer, "%" PRIu32, this->key);
1815  out.append(buffer);
1816  out.append("\n");
1817 
1818  out.append(" name: ");
1819  out.append("'").append(this->name).append("'");
1820  out.append("\n");
1821 
1822  out.append(" unique_id: ");
1823  out.append("'").append(this->unique_id).append("'");
1824  out.append("\n");
1825 
1826  for (const auto &it : this->supported_color_modes) {
1827  out.append(" supported_color_modes: ");
1828  out.append(proto_enum_to_string<enums::ColorMode>(it));
1829  out.append("\n");
1830  }
1831 
1832  out.append(" legacy_supports_brightness: ");
1833  out.append(YESNO(this->legacy_supports_brightness));
1834  out.append("\n");
1835 
1836  out.append(" legacy_supports_rgb: ");
1837  out.append(YESNO(this->legacy_supports_rgb));
1838  out.append("\n");
1839 
1840  out.append(" legacy_supports_white_value: ");
1841  out.append(YESNO(this->legacy_supports_white_value));
1842  out.append("\n");
1843 
1844  out.append(" legacy_supports_color_temperature: ");
1845  out.append(YESNO(this->legacy_supports_color_temperature));
1846  out.append("\n");
1847 
1848  out.append(" min_mireds: ");
1849  sprintf(buffer, "%g", this->min_mireds);
1850  out.append(buffer);
1851  out.append("\n");
1852 
1853  out.append(" max_mireds: ");
1854  sprintf(buffer, "%g", this->max_mireds);
1855  out.append(buffer);
1856  out.append("\n");
1857 
1858  for (const auto &it : this->effects) {
1859  out.append(" effects: ");
1860  out.append("'").append(it).append("'");
1861  out.append("\n");
1862  }
1863 
1864  out.append(" disabled_by_default: ");
1865  out.append(YESNO(this->disabled_by_default));
1866  out.append("\n");
1867 
1868  out.append(" icon: ");
1869  out.append("'").append(this->icon).append("'");
1870  out.append("\n");
1871 
1872  out.append(" entity_category: ");
1873  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
1874  out.append("\n");
1875  out.append("}");
1876 }
1877 #endif
1878 bool LightStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
1879  switch (field_id) {
1880  case 2: {
1881  this->state = value.as_bool();
1882  return true;
1883  }
1884  case 11: {
1885  this->color_mode = value.as_enum<enums::ColorMode>();
1886  return true;
1887  }
1888  default:
1889  return false;
1890  }
1891 }
1893  switch (field_id) {
1894  case 9: {
1895  this->effect = value.as_string();
1896  return true;
1897  }
1898  default:
1899  return false;
1900  }
1901 }
1902 bool LightStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
1903  switch (field_id) {
1904  case 1: {
1905  this->key = value.as_fixed32();
1906  return true;
1907  }
1908  case 3: {
1909  this->brightness = value.as_float();
1910  return true;
1911  }
1912  case 10: {
1913  this->color_brightness = value.as_float();
1914  return true;
1915  }
1916  case 4: {
1917  this->red = value.as_float();
1918  return true;
1919  }
1920  case 5: {
1921  this->green = value.as_float();
1922  return true;
1923  }
1924  case 6: {
1925  this->blue = value.as_float();
1926  return true;
1927  }
1928  case 7: {
1929  this->white = value.as_float();
1930  return true;
1931  }
1932  case 8: {
1933  this->color_temperature = value.as_float();
1934  return true;
1935  }
1936  case 12: {
1937  this->cold_white = value.as_float();
1938  return true;
1939  }
1940  case 13: {
1941  this->warm_white = value.as_float();
1942  return true;
1943  }
1944  default:
1945  return false;
1946  }
1947 }
1949  buffer.encode_fixed32(1, this->key);
1950  buffer.encode_bool(2, this->state);
1951  buffer.encode_float(3, this->brightness);
1952  buffer.encode_enum<enums::ColorMode>(11, this->color_mode);
1953  buffer.encode_float(10, this->color_brightness);
1954  buffer.encode_float(4, this->red);
1955  buffer.encode_float(5, this->green);
1956  buffer.encode_float(6, this->blue);
1957  buffer.encode_float(7, this->white);
1958  buffer.encode_float(8, this->color_temperature);
1959  buffer.encode_float(12, this->cold_white);
1960  buffer.encode_float(13, this->warm_white);
1961  buffer.encode_string(9, this->effect);
1962 }
1963 #ifdef HAS_PROTO_MESSAGE_DUMP
1964 void LightStateResponse::dump_to(std::string &out) const {
1965  __attribute__((unused)) char buffer[64];
1966  out.append("LightStateResponse {\n");
1967  out.append(" key: ");
1968  sprintf(buffer, "%" PRIu32, this->key);
1969  out.append(buffer);
1970  out.append("\n");
1971 
1972  out.append(" state: ");
1973  out.append(YESNO(this->state));
1974  out.append("\n");
1975 
1976  out.append(" brightness: ");
1977  sprintf(buffer, "%g", this->brightness);
1978  out.append(buffer);
1979  out.append("\n");
1980 
1981  out.append(" color_mode: ");
1982  out.append(proto_enum_to_string<enums::ColorMode>(this->color_mode));
1983  out.append("\n");
1984 
1985  out.append(" color_brightness: ");
1986  sprintf(buffer, "%g", this->color_brightness);
1987  out.append(buffer);
1988  out.append("\n");
1989 
1990  out.append(" red: ");
1991  sprintf(buffer, "%g", this->red);
1992  out.append(buffer);
1993  out.append("\n");
1994 
1995  out.append(" green: ");
1996  sprintf(buffer, "%g", this->green);
1997  out.append(buffer);
1998  out.append("\n");
1999 
2000  out.append(" blue: ");
2001  sprintf(buffer, "%g", this->blue);
2002  out.append(buffer);
2003  out.append("\n");
2004 
2005  out.append(" white: ");
2006  sprintf(buffer, "%g", this->white);
2007  out.append(buffer);
2008  out.append("\n");
2009 
2010  out.append(" color_temperature: ");
2011  sprintf(buffer, "%g", this->color_temperature);
2012  out.append(buffer);
2013  out.append("\n");
2014 
2015  out.append(" cold_white: ");
2016  sprintf(buffer, "%g", this->cold_white);
2017  out.append(buffer);
2018  out.append("\n");
2019 
2020  out.append(" warm_white: ");
2021  sprintf(buffer, "%g", this->warm_white);
2022  out.append(buffer);
2023  out.append("\n");
2024 
2025  out.append(" effect: ");
2026  out.append("'").append(this->effect).append("'");
2027  out.append("\n");
2028  out.append("}");
2029 }
2030 #endif
2031 bool LightCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2032  switch (field_id) {
2033  case 2: {
2034  this->has_state = value.as_bool();
2035  return true;
2036  }
2037  case 3: {
2038  this->state = value.as_bool();
2039  return true;
2040  }
2041  case 4: {
2042  this->has_brightness = value.as_bool();
2043  return true;
2044  }
2045  case 22: {
2046  this->has_color_mode = value.as_bool();
2047  return true;
2048  }
2049  case 23: {
2050  this->color_mode = value.as_enum<enums::ColorMode>();
2051  return true;
2052  }
2053  case 20: {
2054  this->has_color_brightness = value.as_bool();
2055  return true;
2056  }
2057  case 6: {
2058  this->has_rgb = value.as_bool();
2059  return true;
2060  }
2061  case 10: {
2062  this->has_white = value.as_bool();
2063  return true;
2064  }
2065  case 12: {
2066  this->has_color_temperature = value.as_bool();
2067  return true;
2068  }
2069  case 24: {
2070  this->has_cold_white = value.as_bool();
2071  return true;
2072  }
2073  case 26: {
2074  this->has_warm_white = value.as_bool();
2075  return true;
2076  }
2077  case 14: {
2078  this->has_transition_length = value.as_bool();
2079  return true;
2080  }
2081  case 15: {
2082  this->transition_length = value.as_uint32();
2083  return true;
2084  }
2085  case 16: {
2086  this->has_flash_length = value.as_bool();
2087  return true;
2088  }
2089  case 17: {
2090  this->flash_length = value.as_uint32();
2091  return true;
2092  }
2093  case 18: {
2094  this->has_effect = value.as_bool();
2095  return true;
2096  }
2097  default:
2098  return false;
2099  }
2100 }
2102  switch (field_id) {
2103  case 19: {
2104  this->effect = value.as_string();
2105  return true;
2106  }
2107  default:
2108  return false;
2109  }
2110 }
2111 bool LightCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2112  switch (field_id) {
2113  case 1: {
2114  this->key = value.as_fixed32();
2115  return true;
2116  }
2117  case 5: {
2118  this->brightness = value.as_float();
2119  return true;
2120  }
2121  case 21: {
2122  this->color_brightness = value.as_float();
2123  return true;
2124  }
2125  case 7: {
2126  this->red = value.as_float();
2127  return true;
2128  }
2129  case 8: {
2130  this->green = value.as_float();
2131  return true;
2132  }
2133  case 9: {
2134  this->blue = value.as_float();
2135  return true;
2136  }
2137  case 11: {
2138  this->white = value.as_float();
2139  return true;
2140  }
2141  case 13: {
2142  this->color_temperature = value.as_float();
2143  return true;
2144  }
2145  case 25: {
2146  this->cold_white = value.as_float();
2147  return true;
2148  }
2149  case 27: {
2150  this->warm_white = value.as_float();
2151  return true;
2152  }
2153  default:
2154  return false;
2155  }
2156 }
2158  buffer.encode_fixed32(1, this->key);
2159  buffer.encode_bool(2, this->has_state);
2160  buffer.encode_bool(3, this->state);
2161  buffer.encode_bool(4, this->has_brightness);
2162  buffer.encode_float(5, this->brightness);
2163  buffer.encode_bool(22, this->has_color_mode);
2164  buffer.encode_enum<enums::ColorMode>(23, this->color_mode);
2165  buffer.encode_bool(20, this->has_color_brightness);
2166  buffer.encode_float(21, this->color_brightness);
2167  buffer.encode_bool(6, this->has_rgb);
2168  buffer.encode_float(7, this->red);
2169  buffer.encode_float(8, this->green);
2170  buffer.encode_float(9, this->blue);
2171  buffer.encode_bool(10, this->has_white);
2172  buffer.encode_float(11, this->white);
2173  buffer.encode_bool(12, this->has_color_temperature);
2174  buffer.encode_float(13, this->color_temperature);
2175  buffer.encode_bool(24, this->has_cold_white);
2176  buffer.encode_float(25, this->cold_white);
2177  buffer.encode_bool(26, this->has_warm_white);
2178  buffer.encode_float(27, this->warm_white);
2179  buffer.encode_bool(14, this->has_transition_length);
2180  buffer.encode_uint32(15, this->transition_length);
2181  buffer.encode_bool(16, this->has_flash_length);
2182  buffer.encode_uint32(17, this->flash_length);
2183  buffer.encode_bool(18, this->has_effect);
2184  buffer.encode_string(19, this->effect);
2185 }
2186 #ifdef HAS_PROTO_MESSAGE_DUMP
2187 void LightCommandRequest::dump_to(std::string &out) const {
2188  __attribute__((unused)) char buffer[64];
2189  out.append("LightCommandRequest {\n");
2190  out.append(" key: ");
2191  sprintf(buffer, "%" PRIu32, this->key);
2192  out.append(buffer);
2193  out.append("\n");
2194 
2195  out.append(" has_state: ");
2196  out.append(YESNO(this->has_state));
2197  out.append("\n");
2198 
2199  out.append(" state: ");
2200  out.append(YESNO(this->state));
2201  out.append("\n");
2202 
2203  out.append(" has_brightness: ");
2204  out.append(YESNO(this->has_brightness));
2205  out.append("\n");
2206 
2207  out.append(" brightness: ");
2208  sprintf(buffer, "%g", this->brightness);
2209  out.append(buffer);
2210  out.append("\n");
2211 
2212  out.append(" has_color_mode: ");
2213  out.append(YESNO(this->has_color_mode));
2214  out.append("\n");
2215 
2216  out.append(" color_mode: ");
2217  out.append(proto_enum_to_string<enums::ColorMode>(this->color_mode));
2218  out.append("\n");
2219 
2220  out.append(" has_color_brightness: ");
2221  out.append(YESNO(this->has_color_brightness));
2222  out.append("\n");
2223 
2224  out.append(" color_brightness: ");
2225  sprintf(buffer, "%g", this->color_brightness);
2226  out.append(buffer);
2227  out.append("\n");
2228 
2229  out.append(" has_rgb: ");
2230  out.append(YESNO(this->has_rgb));
2231  out.append("\n");
2232 
2233  out.append(" red: ");
2234  sprintf(buffer, "%g", this->red);
2235  out.append(buffer);
2236  out.append("\n");
2237 
2238  out.append(" green: ");
2239  sprintf(buffer, "%g", this->green);
2240  out.append(buffer);
2241  out.append("\n");
2242 
2243  out.append(" blue: ");
2244  sprintf(buffer, "%g", this->blue);
2245  out.append(buffer);
2246  out.append("\n");
2247 
2248  out.append(" has_white: ");
2249  out.append(YESNO(this->has_white));
2250  out.append("\n");
2251 
2252  out.append(" white: ");
2253  sprintf(buffer, "%g", this->white);
2254  out.append(buffer);
2255  out.append("\n");
2256 
2257  out.append(" has_color_temperature: ");
2258  out.append(YESNO(this->has_color_temperature));
2259  out.append("\n");
2260 
2261  out.append(" color_temperature: ");
2262  sprintf(buffer, "%g", this->color_temperature);
2263  out.append(buffer);
2264  out.append("\n");
2265 
2266  out.append(" has_cold_white: ");
2267  out.append(YESNO(this->has_cold_white));
2268  out.append("\n");
2269 
2270  out.append(" cold_white: ");
2271  sprintf(buffer, "%g", this->cold_white);
2272  out.append(buffer);
2273  out.append("\n");
2274 
2275  out.append(" has_warm_white: ");
2276  out.append(YESNO(this->has_warm_white));
2277  out.append("\n");
2278 
2279  out.append(" warm_white: ");
2280  sprintf(buffer, "%g", this->warm_white);
2281  out.append(buffer);
2282  out.append("\n");
2283 
2284  out.append(" has_transition_length: ");
2285  out.append(YESNO(this->has_transition_length));
2286  out.append("\n");
2287 
2288  out.append(" transition_length: ");
2289  sprintf(buffer, "%" PRIu32, this->transition_length);
2290  out.append(buffer);
2291  out.append("\n");
2292 
2293  out.append(" has_flash_length: ");
2294  out.append(YESNO(this->has_flash_length));
2295  out.append("\n");
2296 
2297  out.append(" flash_length: ");
2298  sprintf(buffer, "%" PRIu32, this->flash_length);
2299  out.append(buffer);
2300  out.append("\n");
2301 
2302  out.append(" has_effect: ");
2303  out.append(YESNO(this->has_effect));
2304  out.append("\n");
2305 
2306  out.append(" effect: ");
2307  out.append("'").append(this->effect).append("'");
2308  out.append("\n");
2309  out.append("}");
2310 }
2311 #endif
2313  switch (field_id) {
2314  case 7: {
2315  this->accuracy_decimals = value.as_int32();
2316  return true;
2317  }
2318  case 8: {
2319  this->force_update = value.as_bool();
2320  return true;
2321  }
2322  case 10: {
2323  this->state_class = value.as_enum<enums::SensorStateClass>();
2324  return true;
2325  }
2326  case 11: {
2327  this->legacy_last_reset_type = value.as_enum<enums::SensorLastResetType>();
2328  return true;
2329  }
2330  case 12: {
2331  this->disabled_by_default = value.as_bool();
2332  return true;
2333  }
2334  case 13: {
2335  this->entity_category = value.as_enum<enums::EntityCategory>();
2336  return true;
2337  }
2338  default:
2339  return false;
2340  }
2341 }
2343  switch (field_id) {
2344  case 1: {
2345  this->object_id = value.as_string();
2346  return true;
2347  }
2348  case 3: {
2349  this->name = value.as_string();
2350  return true;
2351  }
2352  case 4: {
2353  this->unique_id = value.as_string();
2354  return true;
2355  }
2356  case 5: {
2357  this->icon = value.as_string();
2358  return true;
2359  }
2360  case 6: {
2361  this->unit_of_measurement = value.as_string();
2362  return true;
2363  }
2364  case 9: {
2365  this->device_class = value.as_string();
2366  return true;
2367  }
2368  default:
2369  return false;
2370  }
2371 }
2373  switch (field_id) {
2374  case 2: {
2375  this->key = value.as_fixed32();
2376  return true;
2377  }
2378  default:
2379  return false;
2380  }
2381 }
2383  buffer.encode_string(1, this->object_id);
2384  buffer.encode_fixed32(2, this->key);
2385  buffer.encode_string(3, this->name);
2386  buffer.encode_string(4, this->unique_id);
2387  buffer.encode_string(5, this->icon);
2388  buffer.encode_string(6, this->unit_of_measurement);
2389  buffer.encode_int32(7, this->accuracy_decimals);
2390  buffer.encode_bool(8, this->force_update);
2391  buffer.encode_string(9, this->device_class);
2392  buffer.encode_enum<enums::SensorStateClass>(10, this->state_class);
2393  buffer.encode_enum<enums::SensorLastResetType>(11, this->legacy_last_reset_type);
2394  buffer.encode_bool(12, this->disabled_by_default);
2395  buffer.encode_enum<enums::EntityCategory>(13, this->entity_category);
2396 }
2397 #ifdef HAS_PROTO_MESSAGE_DUMP
2398 void ListEntitiesSensorResponse::dump_to(std::string &out) const {
2399  __attribute__((unused)) char buffer[64];
2400  out.append("ListEntitiesSensorResponse {\n");
2401  out.append(" object_id: ");
2402  out.append("'").append(this->object_id).append("'");
2403  out.append("\n");
2404 
2405  out.append(" key: ");
2406  sprintf(buffer, "%" PRIu32, this->key);
2407  out.append(buffer);
2408  out.append("\n");
2409 
2410  out.append(" name: ");
2411  out.append("'").append(this->name).append("'");
2412  out.append("\n");
2413 
2414  out.append(" unique_id: ");
2415  out.append("'").append(this->unique_id).append("'");
2416  out.append("\n");
2417 
2418  out.append(" icon: ");
2419  out.append("'").append(this->icon).append("'");
2420  out.append("\n");
2421 
2422  out.append(" unit_of_measurement: ");
2423  out.append("'").append(this->unit_of_measurement).append("'");
2424  out.append("\n");
2425 
2426  out.append(" accuracy_decimals: ");
2427  sprintf(buffer, "%" PRId32, this->accuracy_decimals);
2428  out.append(buffer);
2429  out.append("\n");
2430 
2431  out.append(" force_update: ");
2432  out.append(YESNO(this->force_update));
2433  out.append("\n");
2434 
2435  out.append(" device_class: ");
2436  out.append("'").append(this->device_class).append("'");
2437  out.append("\n");
2438 
2439  out.append(" state_class: ");
2440  out.append(proto_enum_to_string<enums::SensorStateClass>(this->state_class));
2441  out.append("\n");
2442 
2443  out.append(" legacy_last_reset_type: ");
2444  out.append(proto_enum_to_string<enums::SensorLastResetType>(this->legacy_last_reset_type));
2445  out.append("\n");
2446 
2447  out.append(" disabled_by_default: ");
2448  out.append(YESNO(this->disabled_by_default));
2449  out.append("\n");
2450 
2451  out.append(" entity_category: ");
2452  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
2453  out.append("\n");
2454  out.append("}");
2455 }
2456 #endif
2457 bool SensorStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
2458  switch (field_id) {
2459  case 3: {
2460  this->missing_state = value.as_bool();
2461  return true;
2462  }
2463  default:
2464  return false;
2465  }
2466 }
2467 bool SensorStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
2468  switch (field_id) {
2469  case 1: {
2470  this->key = value.as_fixed32();
2471  return true;
2472  }
2473  case 2: {
2474  this->state = value.as_float();
2475  return true;
2476  }
2477  default:
2478  return false;
2479  }
2480 }
2482  buffer.encode_fixed32(1, this->key);
2483  buffer.encode_float(2, this->state);
2484  buffer.encode_bool(3, this->missing_state);
2485 }
2486 #ifdef HAS_PROTO_MESSAGE_DUMP
2487 void SensorStateResponse::dump_to(std::string &out) const {
2488  __attribute__((unused)) char buffer[64];
2489  out.append("SensorStateResponse {\n");
2490  out.append(" key: ");
2491  sprintf(buffer, "%" PRIu32, this->key);
2492  out.append(buffer);
2493  out.append("\n");
2494 
2495  out.append(" state: ");
2496  sprintf(buffer, "%g", this->state);
2497  out.append(buffer);
2498  out.append("\n");
2499 
2500  out.append(" missing_state: ");
2501  out.append(YESNO(this->missing_state));
2502  out.append("\n");
2503  out.append("}");
2504 }
2505 #endif
2507  switch (field_id) {
2508  case 6: {
2509  this->assumed_state = value.as_bool();
2510  return true;
2511  }
2512  case 7: {
2513  this->disabled_by_default = value.as_bool();
2514  return true;
2515  }
2516  case 8: {
2517  this->entity_category = value.as_enum<enums::EntityCategory>();
2518  return true;
2519  }
2520  default:
2521  return false;
2522  }
2523 }
2525  switch (field_id) {
2526  case 1: {
2527  this->object_id = value.as_string();
2528  return true;
2529  }
2530  case 3: {
2531  this->name = value.as_string();
2532  return true;
2533  }
2534  case 4: {
2535  this->unique_id = value.as_string();
2536  return true;
2537  }
2538  case 5: {
2539  this->icon = value.as_string();
2540  return true;
2541  }
2542  case 9: {
2543  this->device_class = value.as_string();
2544  return true;
2545  }
2546  default:
2547  return false;
2548  }
2549 }
2551  switch (field_id) {
2552  case 2: {
2553  this->key = value.as_fixed32();
2554  return true;
2555  }
2556  default:
2557  return false;
2558  }
2559 }
2561  buffer.encode_string(1, this->object_id);
2562  buffer.encode_fixed32(2, this->key);
2563  buffer.encode_string(3, this->name);
2564  buffer.encode_string(4, this->unique_id);
2565  buffer.encode_string(5, this->icon);
2566  buffer.encode_bool(6, this->assumed_state);
2567  buffer.encode_bool(7, this->disabled_by_default);
2568  buffer.encode_enum<enums::EntityCategory>(8, this->entity_category);
2569  buffer.encode_string(9, this->device_class);
2570 }
2571 #ifdef HAS_PROTO_MESSAGE_DUMP
2572 void ListEntitiesSwitchResponse::dump_to(std::string &out) const {
2573  __attribute__((unused)) char buffer[64];
2574  out.append("ListEntitiesSwitchResponse {\n");
2575  out.append(" object_id: ");
2576  out.append("'").append(this->object_id).append("'");
2577  out.append("\n");
2578 
2579  out.append(" key: ");
2580  sprintf(buffer, "%" PRIu32, this->key);
2581  out.append(buffer);
2582  out.append("\n");
2583 
2584  out.append(" name: ");
2585  out.append("'").append(this->name).append("'");
2586  out.append("\n");
2587 
2588  out.append(" unique_id: ");
2589  out.append("'").append(this->unique_id).append("'");
2590  out.append("\n");
2591 
2592  out.append(" icon: ");
2593  out.append("'").append(this->icon).append("'");
2594  out.append("\n");
2595 
2596  out.append(" assumed_state: ");
2597  out.append(YESNO(this->assumed_state));
2598  out.append("\n");
2599 
2600  out.append(" disabled_by_default: ");
2601  out.append(YESNO(this->disabled_by_default));
2602  out.append("\n");
2603 
2604  out.append(" entity_category: ");
2605  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
2606  out.append("\n");
2607 
2608  out.append(" device_class: ");
2609  out.append("'").append(this->device_class).append("'");
2610  out.append("\n");
2611  out.append("}");
2612 }
2613 #endif
2614 bool SwitchStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
2615  switch (field_id) {
2616  case 2: {
2617  this->state = value.as_bool();
2618  return true;
2619  }
2620  default:
2621  return false;
2622  }
2623 }
2624 bool SwitchStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
2625  switch (field_id) {
2626  case 1: {
2627  this->key = value.as_fixed32();
2628  return true;
2629  }
2630  default:
2631  return false;
2632  }
2633 }
2635  buffer.encode_fixed32(1, this->key);
2636  buffer.encode_bool(2, this->state);
2637 }
2638 #ifdef HAS_PROTO_MESSAGE_DUMP
2639 void SwitchStateResponse::dump_to(std::string &out) const {
2640  __attribute__((unused)) char buffer[64];
2641  out.append("SwitchStateResponse {\n");
2642  out.append(" key: ");
2643  sprintf(buffer, "%" PRIu32, this->key);
2644  out.append(buffer);
2645  out.append("\n");
2646 
2647  out.append(" state: ");
2648  out.append(YESNO(this->state));
2649  out.append("\n");
2650  out.append("}");
2651 }
2652 #endif
2653 bool SwitchCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2654  switch (field_id) {
2655  case 2: {
2656  this->state = value.as_bool();
2657  return true;
2658  }
2659  default:
2660  return false;
2661  }
2662 }
2663 bool SwitchCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
2664  switch (field_id) {
2665  case 1: {
2666  this->key = value.as_fixed32();
2667  return true;
2668  }
2669  default:
2670  return false;
2671  }
2672 }
2674  buffer.encode_fixed32(1, this->key);
2675  buffer.encode_bool(2, this->state);
2676 }
2677 #ifdef HAS_PROTO_MESSAGE_DUMP
2678 void SwitchCommandRequest::dump_to(std::string &out) const {
2679  __attribute__((unused)) char buffer[64];
2680  out.append("SwitchCommandRequest {\n");
2681  out.append(" key: ");
2682  sprintf(buffer, "%" PRIu32, this->key);
2683  out.append(buffer);
2684  out.append("\n");
2685 
2686  out.append(" state: ");
2687  out.append(YESNO(this->state));
2688  out.append("\n");
2689  out.append("}");
2690 }
2691 #endif
2693  switch (field_id) {
2694  case 6: {
2695  this->disabled_by_default = value.as_bool();
2696  return true;
2697  }
2698  case 7: {
2699  this->entity_category = value.as_enum<enums::EntityCategory>();
2700  return true;
2701  }
2702  default:
2703  return false;
2704  }
2705 }
2707  switch (field_id) {
2708  case 1: {
2709  this->object_id = value.as_string();
2710  return true;
2711  }
2712  case 3: {
2713  this->name = value.as_string();
2714  return true;
2715  }
2716  case 4: {
2717  this->unique_id = value.as_string();
2718  return true;
2719  }
2720  case 5: {
2721  this->icon = value.as_string();
2722  return true;
2723  }
2724  case 8: {
2725  this->device_class = value.as_string();
2726  return true;
2727  }
2728  default:
2729  return false;
2730  }
2731 }
2733  switch (field_id) {
2734  case 2: {
2735  this->key = value.as_fixed32();
2736  return true;
2737  }
2738  default:
2739  return false;
2740  }
2741 }
2743  buffer.encode_string(1, this->object_id);
2744  buffer.encode_fixed32(2, this->key);
2745  buffer.encode_string(3, this->name);
2746  buffer.encode_string(4, this->unique_id);
2747  buffer.encode_string(5, this->icon);
2748  buffer.encode_bool(6, this->disabled_by_default);
2749  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
2750  buffer.encode_string(8, this->device_class);
2751 }
2752 #ifdef HAS_PROTO_MESSAGE_DUMP
2753 void ListEntitiesTextSensorResponse::dump_to(std::string &out) const {
2754  __attribute__((unused)) char buffer[64];
2755  out.append("ListEntitiesTextSensorResponse {\n");
2756  out.append(" object_id: ");
2757  out.append("'").append(this->object_id).append("'");
2758  out.append("\n");
2759 
2760  out.append(" key: ");
2761  sprintf(buffer, "%" PRIu32, this->key);
2762  out.append(buffer);
2763  out.append("\n");
2764 
2765  out.append(" name: ");
2766  out.append("'").append(this->name).append("'");
2767  out.append("\n");
2768 
2769  out.append(" unique_id: ");
2770  out.append("'").append(this->unique_id).append("'");
2771  out.append("\n");
2772 
2773  out.append(" icon: ");
2774  out.append("'").append(this->icon).append("'");
2775  out.append("\n");
2776 
2777  out.append(" disabled_by_default: ");
2778  out.append(YESNO(this->disabled_by_default));
2779  out.append("\n");
2780 
2781  out.append(" entity_category: ");
2782  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
2783  out.append("\n");
2784 
2785  out.append(" device_class: ");
2786  out.append("'").append(this->device_class).append("'");
2787  out.append("\n");
2788  out.append("}");
2789 }
2790 #endif
2791 bool TextSensorStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
2792  switch (field_id) {
2793  case 3: {
2794  this->missing_state = value.as_bool();
2795  return true;
2796  }
2797  default:
2798  return false;
2799  }
2800 }
2802  switch (field_id) {
2803  case 2: {
2804  this->state = value.as_string();
2805  return true;
2806  }
2807  default:
2808  return false;
2809  }
2810 }
2811 bool TextSensorStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
2812  switch (field_id) {
2813  case 1: {
2814  this->key = value.as_fixed32();
2815  return true;
2816  }
2817  default:
2818  return false;
2819  }
2820 }
2822  buffer.encode_fixed32(1, this->key);
2823  buffer.encode_string(2, this->state);
2824  buffer.encode_bool(3, this->missing_state);
2825 }
2826 #ifdef HAS_PROTO_MESSAGE_DUMP
2827 void TextSensorStateResponse::dump_to(std::string &out) const {
2828  __attribute__((unused)) char buffer[64];
2829  out.append("TextSensorStateResponse {\n");
2830  out.append(" key: ");
2831  sprintf(buffer, "%" PRIu32, this->key);
2832  out.append(buffer);
2833  out.append("\n");
2834 
2835  out.append(" state: ");
2836  out.append("'").append(this->state).append("'");
2837  out.append("\n");
2838 
2839  out.append(" missing_state: ");
2840  out.append(YESNO(this->missing_state));
2841  out.append("\n");
2842  out.append("}");
2843 }
2844 #endif
2845 bool SubscribeLogsRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
2846  switch (field_id) {
2847  case 1: {
2848  this->level = value.as_enum<enums::LogLevel>();
2849  return true;
2850  }
2851  case 2: {
2852  this->dump_config = value.as_bool();
2853  return true;
2854  }
2855  default:
2856  return false;
2857  }
2858 }
2860  buffer.encode_enum<enums::LogLevel>(1, this->level);
2861  buffer.encode_bool(2, this->dump_config);
2862 }
2863 #ifdef HAS_PROTO_MESSAGE_DUMP
2864 void SubscribeLogsRequest::dump_to(std::string &out) const {
2865  __attribute__((unused)) char buffer[64];
2866  out.append("SubscribeLogsRequest {\n");
2867  out.append(" level: ");
2868  out.append(proto_enum_to_string<enums::LogLevel>(this->level));
2869  out.append("\n");
2870 
2871  out.append(" dump_config: ");
2872  out.append(YESNO(this->dump_config));
2873  out.append("\n");
2874  out.append("}");
2875 }
2876 #endif
2877 bool SubscribeLogsResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
2878  switch (field_id) {
2879  case 1: {
2880  this->level = value.as_enum<enums::LogLevel>();
2881  return true;
2882  }
2883  case 4: {
2884  this->send_failed = value.as_bool();
2885  return true;
2886  }
2887  default:
2888  return false;
2889  }
2890 }
2892  switch (field_id) {
2893  case 3: {
2894  this->message = value.as_string();
2895  return true;
2896  }
2897  default:
2898  return false;
2899  }
2900 }
2902  buffer.encode_enum<enums::LogLevel>(1, this->level);
2903  buffer.encode_string(3, this->message);
2904  buffer.encode_bool(4, this->send_failed);
2905 }
2906 #ifdef HAS_PROTO_MESSAGE_DUMP
2907 void SubscribeLogsResponse::dump_to(std::string &out) const {
2908  __attribute__((unused)) char buffer[64];
2909  out.append("SubscribeLogsResponse {\n");
2910  out.append(" level: ");
2911  out.append(proto_enum_to_string<enums::LogLevel>(this->level));
2912  out.append("\n");
2913 
2914  out.append(" message: ");
2915  out.append("'").append(this->message).append("'");
2916  out.append("\n");
2917 
2918  out.append(" send_failed: ");
2919  out.append(YESNO(this->send_failed));
2920  out.append("\n");
2921  out.append("}");
2922 }
2923 #endif
2925 #ifdef HAS_PROTO_MESSAGE_DUMP
2927  out.append("SubscribeHomeassistantServicesRequest {}");
2928 }
2929 #endif
2931  switch (field_id) {
2932  case 1: {
2933  this->key = value.as_string();
2934  return true;
2935  }
2936  case 2: {
2937  this->value = value.as_string();
2938  return true;
2939  }
2940  default:
2941  return false;
2942  }
2943 }
2945  buffer.encode_string(1, this->key);
2946  buffer.encode_string(2, this->value);
2947 }
2948 #ifdef HAS_PROTO_MESSAGE_DUMP
2949 void HomeassistantServiceMap::dump_to(std::string &out) const {
2950  __attribute__((unused)) char buffer[64];
2951  out.append("HomeassistantServiceMap {\n");
2952  out.append(" key: ");
2953  out.append("'").append(this->key).append("'");
2954  out.append("\n");
2955 
2956  out.append(" value: ");
2957  out.append("'").append(this->value).append("'");
2958  out.append("\n");
2959  out.append("}");
2960 }
2961 #endif
2963  switch (field_id) {
2964  case 5: {
2965  this->is_event = value.as_bool();
2966  return true;
2967  }
2968  default:
2969  return false;
2970  }
2971 }
2973  switch (field_id) {
2974  case 1: {
2975  this->service = value.as_string();
2976  return true;
2977  }
2978  case 2: {
2979  this->data.push_back(value.as_message<HomeassistantServiceMap>());
2980  return true;
2981  }
2982  case 3: {
2983  this->data_template.push_back(value.as_message<HomeassistantServiceMap>());
2984  return true;
2985  }
2986  case 4: {
2987  this->variables.push_back(value.as_message<HomeassistantServiceMap>());
2988  return true;
2989  }
2990  default:
2991  return false;
2992  }
2993 }
2995  buffer.encode_string(1, this->service);
2996  for (auto &it : this->data) {
2997  buffer.encode_message<HomeassistantServiceMap>(2, it, true);
2998  }
2999  for (auto &it : this->data_template) {
3000  buffer.encode_message<HomeassistantServiceMap>(3, it, true);
3001  }
3002  for (auto &it : this->variables) {
3003  buffer.encode_message<HomeassistantServiceMap>(4, it, true);
3004  }
3005  buffer.encode_bool(5, this->is_event);
3006 }
3007 #ifdef HAS_PROTO_MESSAGE_DUMP
3008 void HomeassistantServiceResponse::dump_to(std::string &out) const {
3009  __attribute__((unused)) char buffer[64];
3010  out.append("HomeassistantServiceResponse {\n");
3011  out.append(" service: ");
3012  out.append("'").append(this->service).append("'");
3013  out.append("\n");
3014 
3015  for (const auto &it : this->data) {
3016  out.append(" data: ");
3017  it.dump_to(out);
3018  out.append("\n");
3019  }
3020 
3021  for (const auto &it : this->data_template) {
3022  out.append(" data_template: ");
3023  it.dump_to(out);
3024  out.append("\n");
3025  }
3026 
3027  for (const auto &it : this->variables) {
3028  out.append(" variables: ");
3029  it.dump_to(out);
3030  out.append("\n");
3031  }
3032 
3033  out.append(" is_event: ");
3034  out.append(YESNO(this->is_event));
3035  out.append("\n");
3036  out.append("}");
3037 }
3038 #endif
3040 #ifdef HAS_PROTO_MESSAGE_DUMP
3041 void SubscribeHomeAssistantStatesRequest::dump_to(std::string &out) const {
3042  out.append("SubscribeHomeAssistantStatesRequest {}");
3043 }
3044 #endif
3046  switch (field_id) {
3047  case 1: {
3048  this->entity_id = value.as_string();
3049  return true;
3050  }
3051  case 2: {
3052  this->attribute = value.as_string();
3053  return true;
3054  }
3055  default:
3056  return false;
3057  }
3058 }
3060  buffer.encode_string(1, this->entity_id);
3061  buffer.encode_string(2, this->attribute);
3062 }
3063 #ifdef HAS_PROTO_MESSAGE_DUMP
3064 void SubscribeHomeAssistantStateResponse::dump_to(std::string &out) const {
3065  __attribute__((unused)) char buffer[64];
3066  out.append("SubscribeHomeAssistantStateResponse {\n");
3067  out.append(" entity_id: ");
3068  out.append("'").append(this->entity_id).append("'");
3069  out.append("\n");
3070 
3071  out.append(" attribute: ");
3072  out.append("'").append(this->attribute).append("'");
3073  out.append("\n");
3074  out.append("}");
3075 }
3076 #endif
3078  switch (field_id) {
3079  case 1: {
3080  this->entity_id = value.as_string();
3081  return true;
3082  }
3083  case 2: {
3084  this->state = value.as_string();
3085  return true;
3086  }
3087  case 3: {
3088  this->attribute = value.as_string();
3089  return true;
3090  }
3091  default:
3092  return false;
3093  }
3094 }
3096  buffer.encode_string(1, this->entity_id);
3097  buffer.encode_string(2, this->state);
3098  buffer.encode_string(3, this->attribute);
3099 }
3100 #ifdef HAS_PROTO_MESSAGE_DUMP
3101 void HomeAssistantStateResponse::dump_to(std::string &out) const {
3102  __attribute__((unused)) char buffer[64];
3103  out.append("HomeAssistantStateResponse {\n");
3104  out.append(" entity_id: ");
3105  out.append("'").append(this->entity_id).append("'");
3106  out.append("\n");
3107 
3108  out.append(" state: ");
3109  out.append("'").append(this->state).append("'");
3110  out.append("\n");
3111 
3112  out.append(" attribute: ");
3113  out.append("'").append(this->attribute).append("'");
3114  out.append("\n");
3115  out.append("}");
3116 }
3117 #endif
3119 #ifdef HAS_PROTO_MESSAGE_DUMP
3120 void GetTimeRequest::dump_to(std::string &out) const { out.append("GetTimeRequest {}"); }
3121 #endif
3122 bool GetTimeResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
3123  switch (field_id) {
3124  case 1: {
3125  this->epoch_seconds = value.as_fixed32();
3126  return true;
3127  }
3128  default:
3129  return false;
3130  }
3131 }
3132 void GetTimeResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->epoch_seconds); }
3133 #ifdef HAS_PROTO_MESSAGE_DUMP
3134 void GetTimeResponse::dump_to(std::string &out) const {
3135  __attribute__((unused)) char buffer[64];
3136  out.append("GetTimeResponse {\n");
3137  out.append(" epoch_seconds: ");
3138  sprintf(buffer, "%" PRIu32, this->epoch_seconds);
3139  out.append(buffer);
3140  out.append("\n");
3141  out.append("}");
3142 }
3143 #endif
3145  switch (field_id) {
3146  case 2: {
3147  this->type = value.as_enum<enums::ServiceArgType>();
3148  return true;
3149  }
3150  default:
3151  return false;
3152  }
3153 }
3155  switch (field_id) {
3156  case 1: {
3157  this->name = value.as_string();
3158  return true;
3159  }
3160  default:
3161  return false;
3162  }
3163 }
3165  buffer.encode_string(1, this->name);
3166  buffer.encode_enum<enums::ServiceArgType>(2, this->type);
3167 }
3168 #ifdef HAS_PROTO_MESSAGE_DUMP
3169 void ListEntitiesServicesArgument::dump_to(std::string &out) const {
3170  __attribute__((unused)) char buffer[64];
3171  out.append("ListEntitiesServicesArgument {\n");
3172  out.append(" name: ");
3173  out.append("'").append(this->name).append("'");
3174  out.append("\n");
3175 
3176  out.append(" type: ");
3177  out.append(proto_enum_to_string<enums::ServiceArgType>(this->type));
3178  out.append("\n");
3179  out.append("}");
3180 }
3181 #endif
3183  switch (field_id) {
3184  case 1: {
3185  this->name = value.as_string();
3186  return true;
3187  }
3188  case 3: {
3189  this->args.push_back(value.as_message<ListEntitiesServicesArgument>());
3190  return true;
3191  }
3192  default:
3193  return false;
3194  }
3195 }
3197  switch (field_id) {
3198  case 2: {
3199  this->key = value.as_fixed32();
3200  return true;
3201  }
3202  default:
3203  return false;
3204  }
3205 }
3207  buffer.encode_string(1, this->name);
3208  buffer.encode_fixed32(2, this->key);
3209  for (auto &it : this->args) {
3210  buffer.encode_message<ListEntitiesServicesArgument>(3, it, true);
3211  }
3212 }
3213 #ifdef HAS_PROTO_MESSAGE_DUMP
3214 void ListEntitiesServicesResponse::dump_to(std::string &out) const {
3215  __attribute__((unused)) char buffer[64];
3216  out.append("ListEntitiesServicesResponse {\n");
3217  out.append(" name: ");
3218  out.append("'").append(this->name).append("'");
3219  out.append("\n");
3220 
3221  out.append(" key: ");
3222  sprintf(buffer, "%" PRIu32, this->key);
3223  out.append(buffer);
3224  out.append("\n");
3225 
3226  for (const auto &it : this->args) {
3227  out.append(" args: ");
3228  it.dump_to(out);
3229  out.append("\n");
3230  }
3231  out.append("}");
3232 }
3233 #endif
3234 bool ExecuteServiceArgument::decode_varint(uint32_t field_id, ProtoVarInt value) {
3235  switch (field_id) {
3236  case 1: {
3237  this->bool_ = value.as_bool();
3238  return true;
3239  }
3240  case 2: {
3241  this->legacy_int = value.as_int32();
3242  return true;
3243  }
3244  case 5: {
3245  this->int_ = value.as_sint32();
3246  return true;
3247  }
3248  case 6: {
3249  this->bool_array.push_back(value.as_bool());
3250  return true;
3251  }
3252  case 7: {
3253  this->int_array.push_back(value.as_sint32());
3254  return true;
3255  }
3256  default:
3257  return false;
3258  }
3259 }
3261  switch (field_id) {
3262  case 4: {
3263  this->string_ = value.as_string();
3264  return true;
3265  }
3266  case 9: {
3267  this->string_array.push_back(value.as_string());
3268  return true;
3269  }
3270  default:
3271  return false;
3272  }
3273 }
3274 bool ExecuteServiceArgument::decode_32bit(uint32_t field_id, Proto32Bit value) {
3275  switch (field_id) {
3276  case 3: {
3277  this->float_ = value.as_float();
3278  return true;
3279  }
3280  case 8: {
3281  this->float_array.push_back(value.as_float());
3282  return true;
3283  }
3284  default:
3285  return false;
3286  }
3287 }
3289  buffer.encode_bool(1, this->bool_);
3290  buffer.encode_int32(2, this->legacy_int);
3291  buffer.encode_float(3, this->float_);
3292  buffer.encode_string(4, this->string_);
3293  buffer.encode_sint32(5, this->int_);
3294  for (auto it : this->bool_array) {
3295  buffer.encode_bool(6, it, true);
3296  }
3297  for (auto &it : this->int_array) {
3298  buffer.encode_sint32(7, it, true);
3299  }
3300  for (auto &it : this->float_array) {
3301  buffer.encode_float(8, it, true);
3302  }
3303  for (auto &it : this->string_array) {
3304  buffer.encode_string(9, it, true);
3305  }
3306 }
3307 #ifdef HAS_PROTO_MESSAGE_DUMP
3308 void ExecuteServiceArgument::dump_to(std::string &out) const {
3309  __attribute__((unused)) char buffer[64];
3310  out.append("ExecuteServiceArgument {\n");
3311  out.append(" bool_: ");
3312  out.append(YESNO(this->bool_));
3313  out.append("\n");
3314 
3315  out.append(" legacy_int: ");
3316  sprintf(buffer, "%" PRId32, this->legacy_int);
3317  out.append(buffer);
3318  out.append("\n");
3319 
3320  out.append(" float_: ");
3321  sprintf(buffer, "%g", this->float_);
3322  out.append(buffer);
3323  out.append("\n");
3324 
3325  out.append(" string_: ");
3326  out.append("'").append(this->string_).append("'");
3327  out.append("\n");
3328 
3329  out.append(" int_: ");
3330  sprintf(buffer, "%" PRId32, this->int_);
3331  out.append(buffer);
3332  out.append("\n");
3333 
3334  for (const auto it : this->bool_array) {
3335  out.append(" bool_array: ");
3336  out.append(YESNO(it));
3337  out.append("\n");
3338  }
3339 
3340  for (const auto &it : this->int_array) {
3341  out.append(" int_array: ");
3342  sprintf(buffer, "%" PRId32, it);
3343  out.append(buffer);
3344  out.append("\n");
3345  }
3346 
3347  for (const auto &it : this->float_array) {
3348  out.append(" float_array: ");
3349  sprintf(buffer, "%g", it);
3350  out.append(buffer);
3351  out.append("\n");
3352  }
3353 
3354  for (const auto &it : this->string_array) {
3355  out.append(" string_array: ");
3356  out.append("'").append(it).append("'");
3357  out.append("\n");
3358  }
3359  out.append("}");
3360 }
3361 #endif
3363  switch (field_id) {
3364  case 2: {
3365  this->args.push_back(value.as_message<ExecuteServiceArgument>());
3366  return true;
3367  }
3368  default:
3369  return false;
3370  }
3371 }
3372 bool ExecuteServiceRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
3373  switch (field_id) {
3374  case 1: {
3375  this->key = value.as_fixed32();
3376  return true;
3377  }
3378  default:
3379  return false;
3380  }
3381 }
3383  buffer.encode_fixed32(1, this->key);
3384  for (auto &it : this->args) {
3385  buffer.encode_message<ExecuteServiceArgument>(2, it, true);
3386  }
3387 }
3388 #ifdef HAS_PROTO_MESSAGE_DUMP
3389 void ExecuteServiceRequest::dump_to(std::string &out) const {
3390  __attribute__((unused)) char buffer[64];
3391  out.append("ExecuteServiceRequest {\n");
3392  out.append(" key: ");
3393  sprintf(buffer, "%" PRIu32, this->key);
3394  out.append(buffer);
3395  out.append("\n");
3396 
3397  for (const auto &it : this->args) {
3398  out.append(" args: ");
3399  it.dump_to(out);
3400  out.append("\n");
3401  }
3402  out.append("}");
3403 }
3404 #endif
3406  switch (field_id) {
3407  case 5: {
3408  this->disabled_by_default = value.as_bool();
3409  return true;
3410  }
3411  case 7: {
3412  this->entity_category = value.as_enum<enums::EntityCategory>();
3413  return true;
3414  }
3415  default:
3416  return false;
3417  }
3418 }
3420  switch (field_id) {
3421  case 1: {
3422  this->object_id = value.as_string();
3423  return true;
3424  }
3425  case 3: {
3426  this->name = value.as_string();
3427  return true;
3428  }
3429  case 4: {
3430  this->unique_id = value.as_string();
3431  return true;
3432  }
3433  case 6: {
3434  this->icon = value.as_string();
3435  return true;
3436  }
3437  default:
3438  return false;
3439  }
3440 }
3442  switch (field_id) {
3443  case 2: {
3444  this->key = value.as_fixed32();
3445  return true;
3446  }
3447  default:
3448  return false;
3449  }
3450 }
3452  buffer.encode_string(1, this->object_id);
3453  buffer.encode_fixed32(2, this->key);
3454  buffer.encode_string(3, this->name);
3455  buffer.encode_string(4, this->unique_id);
3456  buffer.encode_bool(5, this->disabled_by_default);
3457  buffer.encode_string(6, this->icon);
3458  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
3459 }
3460 #ifdef HAS_PROTO_MESSAGE_DUMP
3461 void ListEntitiesCameraResponse::dump_to(std::string &out) const {
3462  __attribute__((unused)) char buffer[64];
3463  out.append("ListEntitiesCameraResponse {\n");
3464  out.append(" object_id: ");
3465  out.append("'").append(this->object_id).append("'");
3466  out.append("\n");
3467 
3468  out.append(" key: ");
3469  sprintf(buffer, "%" PRIu32, this->key);
3470  out.append(buffer);
3471  out.append("\n");
3472 
3473  out.append(" name: ");
3474  out.append("'").append(this->name).append("'");
3475  out.append("\n");
3476 
3477  out.append(" unique_id: ");
3478  out.append("'").append(this->unique_id).append("'");
3479  out.append("\n");
3480 
3481  out.append(" disabled_by_default: ");
3482  out.append(YESNO(this->disabled_by_default));
3483  out.append("\n");
3484 
3485  out.append(" icon: ");
3486  out.append("'").append(this->icon).append("'");
3487  out.append("\n");
3488 
3489  out.append(" entity_category: ");
3490  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
3491  out.append("\n");
3492  out.append("}");
3493 }
3494 #endif
3495 bool CameraImageResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
3496  switch (field_id) {
3497  case 3: {
3498  this->done = value.as_bool();
3499  return true;
3500  }
3501  default:
3502  return false;
3503  }
3504 }
3506  switch (field_id) {
3507  case 2: {
3508  this->data = value.as_string();
3509  return true;
3510  }
3511  default:
3512  return false;
3513  }
3514 }
3515 bool CameraImageResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
3516  switch (field_id) {
3517  case 1: {
3518  this->key = value.as_fixed32();
3519  return true;
3520  }
3521  default:
3522  return false;
3523  }
3524 }
3526  buffer.encode_fixed32(1, this->key);
3527  buffer.encode_string(2, this->data);
3528  buffer.encode_bool(3, this->done);
3529 }
3530 #ifdef HAS_PROTO_MESSAGE_DUMP
3531 void CameraImageResponse::dump_to(std::string &out) const {
3532  __attribute__((unused)) char buffer[64];
3533  out.append("CameraImageResponse {\n");
3534  out.append(" key: ");
3535  sprintf(buffer, "%" PRIu32, this->key);
3536  out.append(buffer);
3537  out.append("\n");
3538 
3539  out.append(" data: ");
3540  out.append("'").append(this->data).append("'");
3541  out.append("\n");
3542 
3543  out.append(" done: ");
3544  out.append(YESNO(this->done));
3545  out.append("\n");
3546  out.append("}");
3547 }
3548 #endif
3549 bool CameraImageRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
3550  switch (field_id) {
3551  case 1: {
3552  this->single = value.as_bool();
3553  return true;
3554  }
3555  case 2: {
3556  this->stream = value.as_bool();
3557  return true;
3558  }
3559  default:
3560  return false;
3561  }
3562 }
3564  buffer.encode_bool(1, this->single);
3565  buffer.encode_bool(2, this->stream);
3566 }
3567 #ifdef HAS_PROTO_MESSAGE_DUMP
3568 void CameraImageRequest::dump_to(std::string &out) const {
3569  __attribute__((unused)) char buffer[64];
3570  out.append("CameraImageRequest {\n");
3571  out.append(" single: ");
3572  out.append(YESNO(this->single));
3573  out.append("\n");
3574 
3575  out.append(" stream: ");
3576  out.append(YESNO(this->stream));
3577  out.append("\n");
3578  out.append("}");
3579 }
3580 #endif
3582  switch (field_id) {
3583  case 5: {
3584  this->supports_current_temperature = value.as_bool();
3585  return true;
3586  }
3587  case 6: {
3588  this->supports_two_point_target_temperature = value.as_bool();
3589  return true;
3590  }
3591  case 7: {
3592  this->supported_modes.push_back(value.as_enum<enums::ClimateMode>());
3593  return true;
3594  }
3595  case 11: {
3596  this->legacy_supports_away = value.as_bool();
3597  return true;
3598  }
3599  case 12: {
3600  this->supports_action = value.as_bool();
3601  return true;
3602  }
3603  case 13: {
3604  this->supported_fan_modes.push_back(value.as_enum<enums::ClimateFanMode>());
3605  return true;
3606  }
3607  case 14: {
3608  this->supported_swing_modes.push_back(value.as_enum<enums::ClimateSwingMode>());
3609  return true;
3610  }
3611  case 16: {
3612  this->supported_presets.push_back(value.as_enum<enums::ClimatePreset>());
3613  return true;
3614  }
3615  case 18: {
3616  this->disabled_by_default = value.as_bool();
3617  return true;
3618  }
3619  case 20: {
3620  this->entity_category = value.as_enum<enums::EntityCategory>();
3621  return true;
3622  }
3623  case 22: {
3624  this->supports_current_humidity = value.as_bool();
3625  return true;
3626  }
3627  case 23: {
3628  this->supports_target_humidity = value.as_bool();
3629  return true;
3630  }
3631  default:
3632  return false;
3633  }
3634 }
3636  switch (field_id) {
3637  case 1: {
3638  this->object_id = value.as_string();
3639  return true;
3640  }
3641  case 3: {
3642  this->name = value.as_string();
3643  return true;
3644  }
3645  case 4: {
3646  this->unique_id = value.as_string();
3647  return true;
3648  }
3649  case 15: {
3650  this->supported_custom_fan_modes.push_back(value.as_string());
3651  return true;
3652  }
3653  case 17: {
3654  this->supported_custom_presets.push_back(value.as_string());
3655  return true;
3656  }
3657  case 19: {
3658  this->icon = value.as_string();
3659  return true;
3660  }
3661  default:
3662  return false;
3663  }
3664 }
3666  switch (field_id) {
3667  case 2: {
3668  this->key = value.as_fixed32();
3669  return true;
3670  }
3671  case 8: {
3672  this->visual_min_temperature = value.as_float();
3673  return true;
3674  }
3675  case 9: {
3676  this->visual_max_temperature = value.as_float();
3677  return true;
3678  }
3679  case 10: {
3680  this->visual_target_temperature_step = value.as_float();
3681  return true;
3682  }
3683  case 21: {
3684  this->visual_current_temperature_step = value.as_float();
3685  return true;
3686  }
3687  case 24: {
3688  this->visual_min_humidity = value.as_float();
3689  return true;
3690  }
3691  case 25: {
3692  this->visual_max_humidity = value.as_float();
3693  return true;
3694  }
3695  default:
3696  return false;
3697  }
3698 }
3700  buffer.encode_string(1, this->object_id);
3701  buffer.encode_fixed32(2, this->key);
3702  buffer.encode_string(3, this->name);
3703  buffer.encode_string(4, this->unique_id);
3704  buffer.encode_bool(5, this->supports_current_temperature);
3705  buffer.encode_bool(6, this->supports_two_point_target_temperature);
3706  for (auto &it : this->supported_modes) {
3707  buffer.encode_enum<enums::ClimateMode>(7, it, true);
3708  }
3709  buffer.encode_float(8, this->visual_min_temperature);
3710  buffer.encode_float(9, this->visual_max_temperature);
3711  buffer.encode_float(10, this->visual_target_temperature_step);
3712  buffer.encode_bool(11, this->legacy_supports_away);
3713  buffer.encode_bool(12, this->supports_action);
3714  for (auto &it : this->supported_fan_modes) {
3715  buffer.encode_enum<enums::ClimateFanMode>(13, it, true);
3716  }
3717  for (auto &it : this->supported_swing_modes) {
3718  buffer.encode_enum<enums::ClimateSwingMode>(14, it, true);
3719  }
3720  for (auto &it : this->supported_custom_fan_modes) {
3721  buffer.encode_string(15, it, true);
3722  }
3723  for (auto &it : this->supported_presets) {
3724  buffer.encode_enum<enums::ClimatePreset>(16, it, true);
3725  }
3726  for (auto &it : this->supported_custom_presets) {
3727  buffer.encode_string(17, it, true);
3728  }
3729  buffer.encode_bool(18, this->disabled_by_default);
3730  buffer.encode_string(19, this->icon);
3731  buffer.encode_enum<enums::EntityCategory>(20, this->entity_category);
3732  buffer.encode_float(21, this->visual_current_temperature_step);
3733  buffer.encode_bool(22, this->supports_current_humidity);
3734  buffer.encode_bool(23, this->supports_target_humidity);
3735  buffer.encode_float(24, this->visual_min_humidity);
3736  buffer.encode_float(25, this->visual_max_humidity);
3737 }
3738 #ifdef HAS_PROTO_MESSAGE_DUMP
3739 void ListEntitiesClimateResponse::dump_to(std::string &out) const {
3740  __attribute__((unused)) char buffer[64];
3741  out.append("ListEntitiesClimateResponse {\n");
3742  out.append(" object_id: ");
3743  out.append("'").append(this->object_id).append("'");
3744  out.append("\n");
3745 
3746  out.append(" key: ");
3747  sprintf(buffer, "%" PRIu32, this->key);
3748  out.append(buffer);
3749  out.append("\n");
3750 
3751  out.append(" name: ");
3752  out.append("'").append(this->name).append("'");
3753  out.append("\n");
3754 
3755  out.append(" unique_id: ");
3756  out.append("'").append(this->unique_id).append("'");
3757  out.append("\n");
3758 
3759  out.append(" supports_current_temperature: ");
3760  out.append(YESNO(this->supports_current_temperature));
3761  out.append("\n");
3762 
3763  out.append(" supports_two_point_target_temperature: ");
3764  out.append(YESNO(this->supports_two_point_target_temperature));
3765  out.append("\n");
3766 
3767  for (const auto &it : this->supported_modes) {
3768  out.append(" supported_modes: ");
3769  out.append(proto_enum_to_string<enums::ClimateMode>(it));
3770  out.append("\n");
3771  }
3772 
3773  out.append(" visual_min_temperature: ");
3774  sprintf(buffer, "%g", this->visual_min_temperature);
3775  out.append(buffer);
3776  out.append("\n");
3777 
3778  out.append(" visual_max_temperature: ");
3779  sprintf(buffer, "%g", this->visual_max_temperature);
3780  out.append(buffer);
3781  out.append("\n");
3782 
3783  out.append(" visual_target_temperature_step: ");
3784  sprintf(buffer, "%g", this->visual_target_temperature_step);
3785  out.append(buffer);
3786  out.append("\n");
3787 
3788  out.append(" legacy_supports_away: ");
3789  out.append(YESNO(this->legacy_supports_away));
3790  out.append("\n");
3791 
3792  out.append(" supports_action: ");
3793  out.append(YESNO(this->supports_action));
3794  out.append("\n");
3795 
3796  for (const auto &it : this->supported_fan_modes) {
3797  out.append(" supported_fan_modes: ");
3798  out.append(proto_enum_to_string<enums::ClimateFanMode>(it));
3799  out.append("\n");
3800  }
3801 
3802  for (const auto &it : this->supported_swing_modes) {
3803  out.append(" supported_swing_modes: ");
3804  out.append(proto_enum_to_string<enums::ClimateSwingMode>(it));
3805  out.append("\n");
3806  }
3807 
3808  for (const auto &it : this->supported_custom_fan_modes) {
3809  out.append(" supported_custom_fan_modes: ");
3810  out.append("'").append(it).append("'");
3811  out.append("\n");
3812  }
3813 
3814  for (const auto &it : this->supported_presets) {
3815  out.append(" supported_presets: ");
3816  out.append(proto_enum_to_string<enums::ClimatePreset>(it));
3817  out.append("\n");
3818  }
3819 
3820  for (const auto &it : this->supported_custom_presets) {
3821  out.append(" supported_custom_presets: ");
3822  out.append("'").append(it).append("'");
3823  out.append("\n");
3824  }
3825 
3826  out.append(" disabled_by_default: ");
3827  out.append(YESNO(this->disabled_by_default));
3828  out.append("\n");
3829 
3830  out.append(" icon: ");
3831  out.append("'").append(this->icon).append("'");
3832  out.append("\n");
3833 
3834  out.append(" entity_category: ");
3835  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
3836  out.append("\n");
3837 
3838  out.append(" visual_current_temperature_step: ");
3839  sprintf(buffer, "%g", this->visual_current_temperature_step);
3840  out.append(buffer);
3841  out.append("\n");
3842 
3843  out.append(" supports_current_humidity: ");
3844  out.append(YESNO(this->supports_current_humidity));
3845  out.append("\n");
3846 
3847  out.append(" supports_target_humidity: ");
3848  out.append(YESNO(this->supports_target_humidity));
3849  out.append("\n");
3850 
3851  out.append(" visual_min_humidity: ");
3852  sprintf(buffer, "%g", this->visual_min_humidity);
3853  out.append(buffer);
3854  out.append("\n");
3855 
3856  out.append(" visual_max_humidity: ");
3857  sprintf(buffer, "%g", this->visual_max_humidity);
3858  out.append(buffer);
3859  out.append("\n");
3860  out.append("}");
3861 }
3862 #endif
3863 bool ClimateStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
3864  switch (field_id) {
3865  case 2: {
3866  this->mode = value.as_enum<enums::ClimateMode>();
3867  return true;
3868  }
3869  case 7: {
3870  this->unused_legacy_away = value.as_bool();
3871  return true;
3872  }
3873  case 8: {
3874  this->action = value.as_enum<enums::ClimateAction>();
3875  return true;
3876  }
3877  case 9: {
3878  this->fan_mode = value.as_enum<enums::ClimateFanMode>();
3879  return true;
3880  }
3881  case 10: {
3882  this->swing_mode = value.as_enum<enums::ClimateSwingMode>();
3883  return true;
3884  }
3885  case 12: {
3886  this->preset = value.as_enum<enums::ClimatePreset>();
3887  return true;
3888  }
3889  default:
3890  return false;
3891  }
3892 }
3894  switch (field_id) {
3895  case 11: {
3896  this->custom_fan_mode = value.as_string();
3897  return true;
3898  }
3899  case 13: {
3900  this->custom_preset = value.as_string();
3901  return true;
3902  }
3903  default:
3904  return false;
3905  }
3906 }
3907 bool ClimateStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
3908  switch (field_id) {
3909  case 1: {
3910  this->key = value.as_fixed32();
3911  return true;
3912  }
3913  case 3: {
3914  this->current_temperature = value.as_float();
3915  return true;
3916  }
3917  case 4: {
3918  this->target_temperature = value.as_float();
3919  return true;
3920  }
3921  case 5: {
3922  this->target_temperature_low = value.as_float();
3923  return true;
3924  }
3925  case 6: {
3926  this->target_temperature_high = value.as_float();
3927  return true;
3928  }
3929  case 14: {
3930  this->current_humidity = value.as_float();
3931  return true;
3932  }
3933  case 15: {
3934  this->target_humidity = value.as_float();
3935  return true;
3936  }
3937  default:
3938  return false;
3939  }
3940 }
3942  buffer.encode_fixed32(1, this->key);
3943  buffer.encode_enum<enums::ClimateMode>(2, this->mode);
3944  buffer.encode_float(3, this->current_temperature);
3945  buffer.encode_float(4, this->target_temperature);
3946  buffer.encode_float(5, this->target_temperature_low);
3947  buffer.encode_float(6, this->target_temperature_high);
3948  buffer.encode_bool(7, this->unused_legacy_away);
3949  buffer.encode_enum<enums::ClimateAction>(8, this->action);
3950  buffer.encode_enum<enums::ClimateFanMode>(9, this->fan_mode);
3951  buffer.encode_enum<enums::ClimateSwingMode>(10, this->swing_mode);
3952  buffer.encode_string(11, this->custom_fan_mode);
3953  buffer.encode_enum<enums::ClimatePreset>(12, this->preset);
3954  buffer.encode_string(13, this->custom_preset);
3955  buffer.encode_float(14, this->current_humidity);
3956  buffer.encode_float(15, this->target_humidity);
3957 }
3958 #ifdef HAS_PROTO_MESSAGE_DUMP
3959 void ClimateStateResponse::dump_to(std::string &out) const {
3960  __attribute__((unused)) char buffer[64];
3961  out.append("ClimateStateResponse {\n");
3962  out.append(" key: ");
3963  sprintf(buffer, "%" PRIu32, this->key);
3964  out.append(buffer);
3965  out.append("\n");
3966 
3967  out.append(" mode: ");
3968  out.append(proto_enum_to_string<enums::ClimateMode>(this->mode));
3969  out.append("\n");
3970 
3971  out.append(" current_temperature: ");
3972  sprintf(buffer, "%g", this->current_temperature);
3973  out.append(buffer);
3974  out.append("\n");
3975 
3976  out.append(" target_temperature: ");
3977  sprintf(buffer, "%g", this->target_temperature);
3978  out.append(buffer);
3979  out.append("\n");
3980 
3981  out.append(" target_temperature_low: ");
3982  sprintf(buffer, "%g", this->target_temperature_low);
3983  out.append(buffer);
3984  out.append("\n");
3985 
3986  out.append(" target_temperature_high: ");
3987  sprintf(buffer, "%g", this->target_temperature_high);
3988  out.append(buffer);
3989  out.append("\n");
3990 
3991  out.append(" unused_legacy_away: ");
3992  out.append(YESNO(this->unused_legacy_away));
3993  out.append("\n");
3994 
3995  out.append(" action: ");
3996  out.append(proto_enum_to_string<enums::ClimateAction>(this->action));
3997  out.append("\n");
3998 
3999  out.append(" fan_mode: ");
4000  out.append(proto_enum_to_string<enums::ClimateFanMode>(this->fan_mode));
4001  out.append("\n");
4002 
4003  out.append(" swing_mode: ");
4004  out.append(proto_enum_to_string<enums::ClimateSwingMode>(this->swing_mode));
4005  out.append("\n");
4006 
4007  out.append(" custom_fan_mode: ");
4008  out.append("'").append(this->custom_fan_mode).append("'");
4009  out.append("\n");
4010 
4011  out.append(" preset: ");
4012  out.append(proto_enum_to_string<enums::ClimatePreset>(this->preset));
4013  out.append("\n");
4014 
4015  out.append(" custom_preset: ");
4016  out.append("'").append(this->custom_preset).append("'");
4017  out.append("\n");
4018 
4019  out.append(" current_humidity: ");
4020  sprintf(buffer, "%g", this->current_humidity);
4021  out.append(buffer);
4022  out.append("\n");
4023 
4024  out.append(" target_humidity: ");
4025  sprintf(buffer, "%g", this->target_humidity);
4026  out.append(buffer);
4027  out.append("\n");
4028  out.append("}");
4029 }
4030 #endif
4031 bool ClimateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
4032  switch (field_id) {
4033  case 2: {
4034  this->has_mode = value.as_bool();
4035  return true;
4036  }
4037  case 3: {
4038  this->mode = value.as_enum<enums::ClimateMode>();
4039  return true;
4040  }
4041  case 4: {
4042  this->has_target_temperature = value.as_bool();
4043  return true;
4044  }
4045  case 6: {
4046  this->has_target_temperature_low = value.as_bool();
4047  return true;
4048  }
4049  case 8: {
4050  this->has_target_temperature_high = value.as_bool();
4051  return true;
4052  }
4053  case 10: {
4054  this->unused_has_legacy_away = value.as_bool();
4055  return true;
4056  }
4057  case 11: {
4058  this->unused_legacy_away = value.as_bool();
4059  return true;
4060  }
4061  case 12: {
4062  this->has_fan_mode = value.as_bool();
4063  return true;
4064  }
4065  case 13: {
4066  this->fan_mode = value.as_enum<enums::ClimateFanMode>();
4067  return true;
4068  }
4069  case 14: {
4070  this->has_swing_mode = value.as_bool();
4071  return true;
4072  }
4073  case 15: {
4074  this->swing_mode = value.as_enum<enums::ClimateSwingMode>();
4075  return true;
4076  }
4077  case 16: {
4078  this->has_custom_fan_mode = value.as_bool();
4079  return true;
4080  }
4081  case 18: {
4082  this->has_preset = value.as_bool();
4083  return true;
4084  }
4085  case 19: {
4086  this->preset = value.as_enum<enums::ClimatePreset>();
4087  return true;
4088  }
4089  case 20: {
4090  this->has_custom_preset = value.as_bool();
4091  return true;
4092  }
4093  case 22: {
4094  this->has_target_humidity = value.as_bool();
4095  return true;
4096  }
4097  default:
4098  return false;
4099  }
4100 }
4102  switch (field_id) {
4103  case 17: {
4104  this->custom_fan_mode = value.as_string();
4105  return true;
4106  }
4107  case 21: {
4108  this->custom_preset = value.as_string();
4109  return true;
4110  }
4111  default:
4112  return false;
4113  }
4114 }
4115 bool ClimateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
4116  switch (field_id) {
4117  case 1: {
4118  this->key = value.as_fixed32();
4119  return true;
4120  }
4121  case 5: {
4122  this->target_temperature = value.as_float();
4123  return true;
4124  }
4125  case 7: {
4126  this->target_temperature_low = value.as_float();
4127  return true;
4128  }
4129  case 9: {
4130  this->target_temperature_high = value.as_float();
4131  return true;
4132  }
4133  case 23: {
4134  this->target_humidity = value.as_float();
4135  return true;
4136  }
4137  default:
4138  return false;
4139  }
4140 }
4142  buffer.encode_fixed32(1, this->key);
4143  buffer.encode_bool(2, this->has_mode);
4144  buffer.encode_enum<enums::ClimateMode>(3, this->mode);
4145  buffer.encode_bool(4, this->has_target_temperature);
4146  buffer.encode_float(5, this->target_temperature);
4147  buffer.encode_bool(6, this->has_target_temperature_low);
4148  buffer.encode_float(7, this->target_temperature_low);
4149  buffer.encode_bool(8, this->has_target_temperature_high);
4150  buffer.encode_float(9, this->target_temperature_high);
4151  buffer.encode_bool(10, this->unused_has_legacy_away);
4152  buffer.encode_bool(11, this->unused_legacy_away);
4153  buffer.encode_bool(12, this->has_fan_mode);
4154  buffer.encode_enum<enums::ClimateFanMode>(13, this->fan_mode);
4155  buffer.encode_bool(14, this->has_swing_mode);
4156  buffer.encode_enum<enums::ClimateSwingMode>(15, this->swing_mode);
4157  buffer.encode_bool(16, this->has_custom_fan_mode);
4158  buffer.encode_string(17, this->custom_fan_mode);
4159  buffer.encode_bool(18, this->has_preset);
4160  buffer.encode_enum<enums::ClimatePreset>(19, this->preset);
4161  buffer.encode_bool(20, this->has_custom_preset);
4162  buffer.encode_string(21, this->custom_preset);
4163  buffer.encode_bool(22, this->has_target_humidity);
4164  buffer.encode_float(23, this->target_humidity);
4165 }
4166 #ifdef HAS_PROTO_MESSAGE_DUMP
4167 void ClimateCommandRequest::dump_to(std::string &out) const {
4168  __attribute__((unused)) char buffer[64];
4169  out.append("ClimateCommandRequest {\n");
4170  out.append(" key: ");
4171  sprintf(buffer, "%" PRIu32, this->key);
4172  out.append(buffer);
4173  out.append("\n");
4174 
4175  out.append(" has_mode: ");
4176  out.append(YESNO(this->has_mode));
4177  out.append("\n");
4178 
4179  out.append(" mode: ");
4180  out.append(proto_enum_to_string<enums::ClimateMode>(this->mode));
4181  out.append("\n");
4182 
4183  out.append(" has_target_temperature: ");
4184  out.append(YESNO(this->has_target_temperature));
4185  out.append("\n");
4186 
4187  out.append(" target_temperature: ");
4188  sprintf(buffer, "%g", this->target_temperature);
4189  out.append(buffer);
4190  out.append("\n");
4191 
4192  out.append(" has_target_temperature_low: ");
4193  out.append(YESNO(this->has_target_temperature_low));
4194  out.append("\n");
4195 
4196  out.append(" target_temperature_low: ");
4197  sprintf(buffer, "%g", this->target_temperature_low);
4198  out.append(buffer);
4199  out.append("\n");
4200 
4201  out.append(" has_target_temperature_high: ");
4202  out.append(YESNO(this->has_target_temperature_high));
4203  out.append("\n");
4204 
4205  out.append(" target_temperature_high: ");
4206  sprintf(buffer, "%g", this->target_temperature_high);
4207  out.append(buffer);
4208  out.append("\n");
4209 
4210  out.append(" unused_has_legacy_away: ");
4211  out.append(YESNO(this->unused_has_legacy_away));
4212  out.append("\n");
4213 
4214  out.append(" unused_legacy_away: ");
4215  out.append(YESNO(this->unused_legacy_away));
4216  out.append("\n");
4217 
4218  out.append(" has_fan_mode: ");
4219  out.append(YESNO(this->has_fan_mode));
4220  out.append("\n");
4221 
4222  out.append(" fan_mode: ");
4223  out.append(proto_enum_to_string<enums::ClimateFanMode>(this->fan_mode));
4224  out.append("\n");
4225 
4226  out.append(" has_swing_mode: ");
4227  out.append(YESNO(this->has_swing_mode));
4228  out.append("\n");
4229 
4230  out.append(" swing_mode: ");
4231  out.append(proto_enum_to_string<enums::ClimateSwingMode>(this->swing_mode));
4232  out.append("\n");
4233 
4234  out.append(" has_custom_fan_mode: ");
4235  out.append(YESNO(this->has_custom_fan_mode));
4236  out.append("\n");
4237 
4238  out.append(" custom_fan_mode: ");
4239  out.append("'").append(this->custom_fan_mode).append("'");
4240  out.append("\n");
4241 
4242  out.append(" has_preset: ");
4243  out.append(YESNO(this->has_preset));
4244  out.append("\n");
4245 
4246  out.append(" preset: ");
4247  out.append(proto_enum_to_string<enums::ClimatePreset>(this->preset));
4248  out.append("\n");
4249 
4250  out.append(" has_custom_preset: ");
4251  out.append(YESNO(this->has_custom_preset));
4252  out.append("\n");
4253 
4254  out.append(" custom_preset: ");
4255  out.append("'").append(this->custom_preset).append("'");
4256  out.append("\n");
4257 
4258  out.append(" has_target_humidity: ");
4259  out.append(YESNO(this->has_target_humidity));
4260  out.append("\n");
4261 
4262  out.append(" target_humidity: ");
4263  sprintf(buffer, "%g", this->target_humidity);
4264  out.append(buffer);
4265  out.append("\n");
4266  out.append("}");
4267 }
4268 #endif
4270  switch (field_id) {
4271  case 9: {
4272  this->disabled_by_default = value.as_bool();
4273  return true;
4274  }
4275  case 10: {
4276  this->entity_category = value.as_enum<enums::EntityCategory>();
4277  return true;
4278  }
4279  case 12: {
4280  this->mode = value.as_enum<enums::NumberMode>();
4281  return true;
4282  }
4283  default:
4284  return false;
4285  }
4286 }
4288  switch (field_id) {
4289  case 1: {
4290  this->object_id = value.as_string();
4291  return true;
4292  }
4293  case 3: {
4294  this->name = value.as_string();
4295  return true;
4296  }
4297  case 4: {
4298  this->unique_id = value.as_string();
4299  return true;
4300  }
4301  case 5: {
4302  this->icon = value.as_string();
4303  return true;
4304  }
4305  case 11: {
4306  this->unit_of_measurement = value.as_string();
4307  return true;
4308  }
4309  case 13: {
4310  this->device_class = value.as_string();
4311  return true;
4312  }
4313  default:
4314  return false;
4315  }
4316 }
4318  switch (field_id) {
4319  case 2: {
4320  this->key = value.as_fixed32();
4321  return true;
4322  }
4323  case 6: {
4324  this->min_value = value.as_float();
4325  return true;
4326  }
4327  case 7: {
4328  this->max_value = value.as_float();
4329  return true;
4330  }
4331  case 8: {
4332  this->step = value.as_float();
4333  return true;
4334  }
4335  default:
4336  return false;
4337  }
4338 }
4340  buffer.encode_string(1, this->object_id);
4341  buffer.encode_fixed32(2, this->key);
4342  buffer.encode_string(3, this->name);
4343  buffer.encode_string(4, this->unique_id);
4344  buffer.encode_string(5, this->icon);
4345  buffer.encode_float(6, this->min_value);
4346  buffer.encode_float(7, this->max_value);
4347  buffer.encode_float(8, this->step);
4348  buffer.encode_bool(9, this->disabled_by_default);
4349  buffer.encode_enum<enums::EntityCategory>(10, this->entity_category);
4350  buffer.encode_string(11, this->unit_of_measurement);
4351  buffer.encode_enum<enums::NumberMode>(12, this->mode);
4352  buffer.encode_string(13, this->device_class);
4353 }
4354 #ifdef HAS_PROTO_MESSAGE_DUMP
4355 void ListEntitiesNumberResponse::dump_to(std::string &out) const {
4356  __attribute__((unused)) char buffer[64];
4357  out.append("ListEntitiesNumberResponse {\n");
4358  out.append(" object_id: ");
4359  out.append("'").append(this->object_id).append("'");
4360  out.append("\n");
4361 
4362  out.append(" key: ");
4363  sprintf(buffer, "%" PRIu32, this->key);
4364  out.append(buffer);
4365  out.append("\n");
4366 
4367  out.append(" name: ");
4368  out.append("'").append(this->name).append("'");
4369  out.append("\n");
4370 
4371  out.append(" unique_id: ");
4372  out.append("'").append(this->unique_id).append("'");
4373  out.append("\n");
4374 
4375  out.append(" icon: ");
4376  out.append("'").append(this->icon).append("'");
4377  out.append("\n");
4378 
4379  out.append(" min_value: ");
4380  sprintf(buffer, "%g", this->min_value);
4381  out.append(buffer);
4382  out.append("\n");
4383 
4384  out.append(" max_value: ");
4385  sprintf(buffer, "%g", this->max_value);
4386  out.append(buffer);
4387  out.append("\n");
4388 
4389  out.append(" step: ");
4390  sprintf(buffer, "%g", this->step);
4391  out.append(buffer);
4392  out.append("\n");
4393 
4394  out.append(" disabled_by_default: ");
4395  out.append(YESNO(this->disabled_by_default));
4396  out.append("\n");
4397 
4398  out.append(" entity_category: ");
4399  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
4400  out.append("\n");
4401 
4402  out.append(" unit_of_measurement: ");
4403  out.append("'").append(this->unit_of_measurement).append("'");
4404  out.append("\n");
4405 
4406  out.append(" mode: ");
4407  out.append(proto_enum_to_string<enums::NumberMode>(this->mode));
4408  out.append("\n");
4409 
4410  out.append(" device_class: ");
4411  out.append("'").append(this->device_class).append("'");
4412  out.append("\n");
4413  out.append("}");
4414 }
4415 #endif
4416 bool NumberStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
4417  switch (field_id) {
4418  case 3: {
4419  this->missing_state = value.as_bool();
4420  return true;
4421  }
4422  default:
4423  return false;
4424  }
4425 }
4426 bool NumberStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
4427  switch (field_id) {
4428  case 1: {
4429  this->key = value.as_fixed32();
4430  return true;
4431  }
4432  case 2: {
4433  this->state = value.as_float();
4434  return true;
4435  }
4436  default:
4437  return false;
4438  }
4439 }
4441  buffer.encode_fixed32(1, this->key);
4442  buffer.encode_float(2, this->state);
4443  buffer.encode_bool(3, this->missing_state);
4444 }
4445 #ifdef HAS_PROTO_MESSAGE_DUMP
4446 void NumberStateResponse::dump_to(std::string &out) const {
4447  __attribute__((unused)) char buffer[64];
4448  out.append("NumberStateResponse {\n");
4449  out.append(" key: ");
4450  sprintf(buffer, "%" PRIu32, this->key);
4451  out.append(buffer);
4452  out.append("\n");
4453 
4454  out.append(" state: ");
4455  sprintf(buffer, "%g", this->state);
4456  out.append(buffer);
4457  out.append("\n");
4458 
4459  out.append(" missing_state: ");
4460  out.append(YESNO(this->missing_state));
4461  out.append("\n");
4462  out.append("}");
4463 }
4464 #endif
4465 bool NumberCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
4466  switch (field_id) {
4467  case 1: {
4468  this->key = value.as_fixed32();
4469  return true;
4470  }
4471  case 2: {
4472  this->state = value.as_float();
4473  return true;
4474  }
4475  default:
4476  return false;
4477  }
4478 }
4480  buffer.encode_fixed32(1, this->key);
4481  buffer.encode_float(2, this->state);
4482 }
4483 #ifdef HAS_PROTO_MESSAGE_DUMP
4484 void NumberCommandRequest::dump_to(std::string &out) const {
4485  __attribute__((unused)) char buffer[64];
4486  out.append("NumberCommandRequest {\n");
4487  out.append(" key: ");
4488  sprintf(buffer, "%" PRIu32, this->key);
4489  out.append(buffer);
4490  out.append("\n");
4491 
4492  out.append(" state: ");
4493  sprintf(buffer, "%g", this->state);
4494  out.append(buffer);
4495  out.append("\n");
4496  out.append("}");
4497 }
4498 #endif
4500  switch (field_id) {
4501  case 7: {
4502  this->disabled_by_default = value.as_bool();
4503  return true;
4504  }
4505  case 8: {
4506  this->entity_category = value.as_enum<enums::EntityCategory>();
4507  return true;
4508  }
4509  default:
4510  return false;
4511  }
4512 }
4514  switch (field_id) {
4515  case 1: {
4516  this->object_id = value.as_string();
4517  return true;
4518  }
4519  case 3: {
4520  this->name = value.as_string();
4521  return true;
4522  }
4523  case 4: {
4524  this->unique_id = value.as_string();
4525  return true;
4526  }
4527  case 5: {
4528  this->icon = value.as_string();
4529  return true;
4530  }
4531  case 6: {
4532  this->options.push_back(value.as_string());
4533  return true;
4534  }
4535  default:
4536  return false;
4537  }
4538 }
4540  switch (field_id) {
4541  case 2: {
4542  this->key = value.as_fixed32();
4543  return true;
4544  }
4545  default:
4546  return false;
4547  }
4548 }
4550  buffer.encode_string(1, this->object_id);
4551  buffer.encode_fixed32(2, this->key);
4552  buffer.encode_string(3, this->name);
4553  buffer.encode_string(4, this->unique_id);
4554  buffer.encode_string(5, this->icon);
4555  for (auto &it : this->options) {
4556  buffer.encode_string(6, it, true);
4557  }
4558  buffer.encode_bool(7, this->disabled_by_default);
4559  buffer.encode_enum<enums::EntityCategory>(8, this->entity_category);
4560 }
4561 #ifdef HAS_PROTO_MESSAGE_DUMP
4562 void ListEntitiesSelectResponse::dump_to(std::string &out) const {
4563  __attribute__((unused)) char buffer[64];
4564  out.append("ListEntitiesSelectResponse {\n");
4565  out.append(" object_id: ");
4566  out.append("'").append(this->object_id).append("'");
4567  out.append("\n");
4568 
4569  out.append(" key: ");
4570  sprintf(buffer, "%" PRIu32, this->key);
4571  out.append(buffer);
4572  out.append("\n");
4573 
4574  out.append(" name: ");
4575  out.append("'").append(this->name).append("'");
4576  out.append("\n");
4577 
4578  out.append(" unique_id: ");
4579  out.append("'").append(this->unique_id).append("'");
4580  out.append("\n");
4581 
4582  out.append(" icon: ");
4583  out.append("'").append(this->icon).append("'");
4584  out.append("\n");
4585 
4586  for (const auto &it : this->options) {
4587  out.append(" options: ");
4588  out.append("'").append(it).append("'");
4589  out.append("\n");
4590  }
4591 
4592  out.append(" disabled_by_default: ");
4593  out.append(YESNO(this->disabled_by_default));
4594  out.append("\n");
4595 
4596  out.append(" entity_category: ");
4597  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
4598  out.append("\n");
4599  out.append("}");
4600 }
4601 #endif
4602 bool SelectStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
4603  switch (field_id) {
4604  case 3: {
4605  this->missing_state = value.as_bool();
4606  return true;
4607  }
4608  default:
4609  return false;
4610  }
4611 }
4613  switch (field_id) {
4614  case 2: {
4615  this->state = value.as_string();
4616  return true;
4617  }
4618  default:
4619  return false;
4620  }
4621 }
4622 bool SelectStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
4623  switch (field_id) {
4624  case 1: {
4625  this->key = value.as_fixed32();
4626  return true;
4627  }
4628  default:
4629  return false;
4630  }
4631 }
4633  buffer.encode_fixed32(1, this->key);
4634  buffer.encode_string(2, this->state);
4635  buffer.encode_bool(3, this->missing_state);
4636 }
4637 #ifdef HAS_PROTO_MESSAGE_DUMP
4638 void SelectStateResponse::dump_to(std::string &out) const {
4639  __attribute__((unused)) char buffer[64];
4640  out.append("SelectStateResponse {\n");
4641  out.append(" key: ");
4642  sprintf(buffer, "%" PRIu32, this->key);
4643  out.append(buffer);
4644  out.append("\n");
4645 
4646  out.append(" state: ");
4647  out.append("'").append(this->state).append("'");
4648  out.append("\n");
4649 
4650  out.append(" missing_state: ");
4651  out.append(YESNO(this->missing_state));
4652  out.append("\n");
4653  out.append("}");
4654 }
4655 #endif
4657  switch (field_id) {
4658  case 2: {
4659  this->state = value.as_string();
4660  return true;
4661  }
4662  default:
4663  return false;
4664  }
4665 }
4666 bool SelectCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
4667  switch (field_id) {
4668  case 1: {
4669  this->key = value.as_fixed32();
4670  return true;
4671  }
4672  default:
4673  return false;
4674  }
4675 }
4677  buffer.encode_fixed32(1, this->key);
4678  buffer.encode_string(2, this->state);
4679 }
4680 #ifdef HAS_PROTO_MESSAGE_DUMP
4681 void SelectCommandRequest::dump_to(std::string &out) const {
4682  __attribute__((unused)) char buffer[64];
4683  out.append("SelectCommandRequest {\n");
4684  out.append(" key: ");
4685  sprintf(buffer, "%" PRIu32, this->key);
4686  out.append(buffer);
4687  out.append("\n");
4688 
4689  out.append(" state: ");
4690  out.append("'").append(this->state).append("'");
4691  out.append("\n");
4692  out.append("}");
4693 }
4694 #endif
4696  switch (field_id) {
4697  case 6: {
4698  this->disabled_by_default = value.as_bool();
4699  return true;
4700  }
4701  case 7: {
4702  this->entity_category = value.as_enum<enums::EntityCategory>();
4703  return true;
4704  }
4705  case 8: {
4706  this->assumed_state = value.as_bool();
4707  return true;
4708  }
4709  case 9: {
4710  this->supports_open = value.as_bool();
4711  return true;
4712  }
4713  case 10: {
4714  this->requires_code = value.as_bool();
4715  return true;
4716  }
4717  default:
4718  return false;
4719  }
4720 }
4722  switch (field_id) {
4723  case 1: {
4724  this->object_id = value.as_string();
4725  return true;
4726  }
4727  case 3: {
4728  this->name = value.as_string();
4729  return true;
4730  }
4731  case 4: {
4732  this->unique_id = value.as_string();
4733  return true;
4734  }
4735  case 5: {
4736  this->icon = value.as_string();
4737  return true;
4738  }
4739  case 11: {
4740  this->code_format = value.as_string();
4741  return true;
4742  }
4743  default:
4744  return false;
4745  }
4746 }
4747 bool ListEntitiesLockResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
4748  switch (field_id) {
4749  case 2: {
4750  this->key = value.as_fixed32();
4751  return true;
4752  }
4753  default:
4754  return false;
4755  }
4756 }
4758  buffer.encode_string(1, this->object_id);
4759  buffer.encode_fixed32(2, this->key);
4760  buffer.encode_string(3, this->name);
4761  buffer.encode_string(4, this->unique_id);
4762  buffer.encode_string(5, this->icon);
4763  buffer.encode_bool(6, this->disabled_by_default);
4764  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
4765  buffer.encode_bool(8, this->assumed_state);
4766  buffer.encode_bool(9, this->supports_open);
4767  buffer.encode_bool(10, this->requires_code);
4768  buffer.encode_string(11, this->code_format);
4769 }
4770 #ifdef HAS_PROTO_MESSAGE_DUMP
4771 void ListEntitiesLockResponse::dump_to(std::string &out) const {
4772  __attribute__((unused)) char buffer[64];
4773  out.append("ListEntitiesLockResponse {\n");
4774  out.append(" object_id: ");
4775  out.append("'").append(this->object_id).append("'");
4776  out.append("\n");
4777 
4778  out.append(" key: ");
4779  sprintf(buffer, "%" PRIu32, this->key);
4780  out.append(buffer);
4781  out.append("\n");
4782 
4783  out.append(" name: ");
4784  out.append("'").append(this->name).append("'");
4785  out.append("\n");
4786 
4787  out.append(" unique_id: ");
4788  out.append("'").append(this->unique_id).append("'");
4789  out.append("\n");
4790 
4791  out.append(" icon: ");
4792  out.append("'").append(this->icon).append("'");
4793  out.append("\n");
4794 
4795  out.append(" disabled_by_default: ");
4796  out.append(YESNO(this->disabled_by_default));
4797  out.append("\n");
4798 
4799  out.append(" entity_category: ");
4800  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
4801  out.append("\n");
4802 
4803  out.append(" assumed_state: ");
4804  out.append(YESNO(this->assumed_state));
4805  out.append("\n");
4806 
4807  out.append(" supports_open: ");
4808  out.append(YESNO(this->supports_open));
4809  out.append("\n");
4810 
4811  out.append(" requires_code: ");
4812  out.append(YESNO(this->requires_code));
4813  out.append("\n");
4814 
4815  out.append(" code_format: ");
4816  out.append("'").append(this->code_format).append("'");
4817  out.append("\n");
4818  out.append("}");
4819 }
4820 #endif
4821 bool LockStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
4822  switch (field_id) {
4823  case 2: {
4824  this->state = value.as_enum<enums::LockState>();
4825  return true;
4826  }
4827  default:
4828  return false;
4829  }
4830 }
4831 bool LockStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
4832  switch (field_id) {
4833  case 1: {
4834  this->key = value.as_fixed32();
4835  return true;
4836  }
4837  default:
4838  return false;
4839  }
4840 }
4842  buffer.encode_fixed32(1, this->key);
4843  buffer.encode_enum<enums::LockState>(2, this->state);
4844 }
4845 #ifdef HAS_PROTO_MESSAGE_DUMP
4846 void LockStateResponse::dump_to(std::string &out) const {
4847  __attribute__((unused)) char buffer[64];
4848  out.append("LockStateResponse {\n");
4849  out.append(" key: ");
4850  sprintf(buffer, "%" PRIu32, this->key);
4851  out.append(buffer);
4852  out.append("\n");
4853 
4854  out.append(" state: ");
4855  out.append(proto_enum_to_string<enums::LockState>(this->state));
4856  out.append("\n");
4857  out.append("}");
4858 }
4859 #endif
4860 bool LockCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
4861  switch (field_id) {
4862  case 2: {
4863  this->command = value.as_enum<enums::LockCommand>();
4864  return true;
4865  }
4866  case 3: {
4867  this->has_code = value.as_bool();
4868  return true;
4869  }
4870  default:
4871  return false;
4872  }
4873 }
4875  switch (field_id) {
4876  case 4: {
4877  this->code = value.as_string();
4878  return true;
4879  }
4880  default:
4881  return false;
4882  }
4883 }
4884 bool LockCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
4885  switch (field_id) {
4886  case 1: {
4887  this->key = value.as_fixed32();
4888  return true;
4889  }
4890  default:
4891  return false;
4892  }
4893 }
4895  buffer.encode_fixed32(1, this->key);
4896  buffer.encode_enum<enums::LockCommand>(2, this->command);
4897  buffer.encode_bool(3, this->has_code);
4898  buffer.encode_string(4, this->code);
4899 }
4900 #ifdef HAS_PROTO_MESSAGE_DUMP
4901 void LockCommandRequest::dump_to(std::string &out) const {
4902  __attribute__((unused)) char buffer[64];
4903  out.append("LockCommandRequest {\n");
4904  out.append(" key: ");
4905  sprintf(buffer, "%" PRIu32, this->key);
4906  out.append(buffer);
4907  out.append("\n");
4908 
4909  out.append(" command: ");
4910  out.append(proto_enum_to_string<enums::LockCommand>(this->command));
4911  out.append("\n");
4912 
4913  out.append(" has_code: ");
4914  out.append(YESNO(this->has_code));
4915  out.append("\n");
4916 
4917  out.append(" code: ");
4918  out.append("'").append(this->code).append("'");
4919  out.append("\n");
4920  out.append("}");
4921 }
4922 #endif
4924  switch (field_id) {
4925  case 6: {
4926  this->disabled_by_default = value.as_bool();
4927  return true;
4928  }
4929  case 7: {
4930  this->entity_category = value.as_enum<enums::EntityCategory>();
4931  return true;
4932  }
4933  default:
4934  return false;
4935  }
4936 }
4938  switch (field_id) {
4939  case 1: {
4940  this->object_id = value.as_string();
4941  return true;
4942  }
4943  case 3: {
4944  this->name = value.as_string();
4945  return true;
4946  }
4947  case 4: {
4948  this->unique_id = value.as_string();
4949  return true;
4950  }
4951  case 5: {
4952  this->icon = value.as_string();
4953  return true;
4954  }
4955  case 8: {
4956  this->device_class = value.as_string();
4957  return true;
4958  }
4959  default:
4960  return false;
4961  }
4962 }
4964  switch (field_id) {
4965  case 2: {
4966  this->key = value.as_fixed32();
4967  return true;
4968  }
4969  default:
4970  return false;
4971  }
4972 }
4974  buffer.encode_string(1, this->object_id);
4975  buffer.encode_fixed32(2, this->key);
4976  buffer.encode_string(3, this->name);
4977  buffer.encode_string(4, this->unique_id);
4978  buffer.encode_string(5, this->icon);
4979  buffer.encode_bool(6, this->disabled_by_default);
4980  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
4981  buffer.encode_string(8, this->device_class);
4982 }
4983 #ifdef HAS_PROTO_MESSAGE_DUMP
4984 void ListEntitiesButtonResponse::dump_to(std::string &out) const {
4985  __attribute__((unused)) char buffer[64];
4986  out.append("ListEntitiesButtonResponse {\n");
4987  out.append(" object_id: ");
4988  out.append("'").append(this->object_id).append("'");
4989  out.append("\n");
4990 
4991  out.append(" key: ");
4992  sprintf(buffer, "%" PRIu32, this->key);
4993  out.append(buffer);
4994  out.append("\n");
4995 
4996  out.append(" name: ");
4997  out.append("'").append(this->name).append("'");
4998  out.append("\n");
4999 
5000  out.append(" unique_id: ");
5001  out.append("'").append(this->unique_id).append("'");
5002  out.append("\n");
5003 
5004  out.append(" icon: ");
5005  out.append("'").append(this->icon).append("'");
5006  out.append("\n");
5007 
5008  out.append(" disabled_by_default: ");
5009  out.append(YESNO(this->disabled_by_default));
5010  out.append("\n");
5011 
5012  out.append(" entity_category: ");
5013  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
5014  out.append("\n");
5015 
5016  out.append(" device_class: ");
5017  out.append("'").append(this->device_class).append("'");
5018  out.append("\n");
5019  out.append("}");
5020 }
5021 #endif
5022 bool ButtonCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
5023  switch (field_id) {
5024  case 1: {
5025  this->key = value.as_fixed32();
5026  return true;
5027  }
5028  default:
5029  return false;
5030  }
5031 }
5032 void ButtonCommandRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->key); }
5033 #ifdef HAS_PROTO_MESSAGE_DUMP
5034 void ButtonCommandRequest::dump_to(std::string &out) const {
5035  __attribute__((unused)) char buffer[64];
5036  out.append("ButtonCommandRequest {\n");
5037  out.append(" key: ");
5038  sprintf(buffer, "%" PRIu32, this->key);
5039  out.append(buffer);
5040  out.append("\n");
5041  out.append("}");
5042 }
5043 #endif
5045  switch (field_id) {
5046  case 6: {
5047  this->disabled_by_default = value.as_bool();
5048  return true;
5049  }
5050  case 7: {
5051  this->entity_category = value.as_enum<enums::EntityCategory>();
5052  return true;
5053  }
5054  case 8: {
5055  this->supports_pause = value.as_bool();
5056  return true;
5057  }
5058  default:
5059  return false;
5060  }
5061 }
5063  switch (field_id) {
5064  case 1: {
5065  this->object_id = value.as_string();
5066  return true;
5067  }
5068  case 3: {
5069  this->name = value.as_string();
5070  return true;
5071  }
5072  case 4: {
5073  this->unique_id = value.as_string();
5074  return true;
5075  }
5076  case 5: {
5077  this->icon = value.as_string();
5078  return true;
5079  }
5080  default:
5081  return false;
5082  }
5083 }
5085  switch (field_id) {
5086  case 2: {
5087  this->key = value.as_fixed32();
5088  return true;
5089  }
5090  default:
5091  return false;
5092  }
5093 }
5095  buffer.encode_string(1, this->object_id);
5096  buffer.encode_fixed32(2, this->key);
5097  buffer.encode_string(3, this->name);
5098  buffer.encode_string(4, this->unique_id);
5099  buffer.encode_string(5, this->icon);
5100  buffer.encode_bool(6, this->disabled_by_default);
5101  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
5102  buffer.encode_bool(8, this->supports_pause);
5103 }
5104 #ifdef HAS_PROTO_MESSAGE_DUMP
5105 void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const {
5106  __attribute__((unused)) char buffer[64];
5107  out.append("ListEntitiesMediaPlayerResponse {\n");
5108  out.append(" object_id: ");
5109  out.append("'").append(this->object_id).append("'");
5110  out.append("\n");
5111 
5112  out.append(" key: ");
5113  sprintf(buffer, "%" PRIu32, this->key);
5114  out.append(buffer);
5115  out.append("\n");
5116 
5117  out.append(" name: ");
5118  out.append("'").append(this->name).append("'");
5119  out.append("\n");
5120 
5121  out.append(" unique_id: ");
5122  out.append("'").append(this->unique_id).append("'");
5123  out.append("\n");
5124 
5125  out.append(" icon: ");
5126  out.append("'").append(this->icon).append("'");
5127  out.append("\n");
5128 
5129  out.append(" disabled_by_default: ");
5130  out.append(YESNO(this->disabled_by_default));
5131  out.append("\n");
5132 
5133  out.append(" entity_category: ");
5134  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
5135  out.append("\n");
5136 
5137  out.append(" supports_pause: ");
5138  out.append(YESNO(this->supports_pause));
5139  out.append("\n");
5140  out.append("}");
5141 }
5142 #endif
5144  switch (field_id) {
5145  case 2: {
5146  this->state = value.as_enum<enums::MediaPlayerState>();
5147  return true;
5148  }
5149  case 4: {
5150  this->muted = value.as_bool();
5151  return true;
5152  }
5153  default:
5154  return false;
5155  }
5156 }
5157 bool MediaPlayerStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
5158  switch (field_id) {
5159  case 1: {
5160  this->key = value.as_fixed32();
5161  return true;
5162  }
5163  case 3: {
5164  this->volume = value.as_float();
5165  return true;
5166  }
5167  default:
5168  return false;
5169  }
5170 }
5172  buffer.encode_fixed32(1, this->key);
5173  buffer.encode_enum<enums::MediaPlayerState>(2, this->state);
5174  buffer.encode_float(3, this->volume);
5175  buffer.encode_bool(4, this->muted);
5176 }
5177 #ifdef HAS_PROTO_MESSAGE_DUMP
5178 void MediaPlayerStateResponse::dump_to(std::string &out) const {
5179  __attribute__((unused)) char buffer[64];
5180  out.append("MediaPlayerStateResponse {\n");
5181  out.append(" key: ");
5182  sprintf(buffer, "%" PRIu32, this->key);
5183  out.append(buffer);
5184  out.append("\n");
5185 
5186  out.append(" state: ");
5187  out.append(proto_enum_to_string<enums::MediaPlayerState>(this->state));
5188  out.append("\n");
5189 
5190  out.append(" volume: ");
5191  sprintf(buffer, "%g", this->volume);
5192  out.append(buffer);
5193  out.append("\n");
5194 
5195  out.append(" muted: ");
5196  out.append(YESNO(this->muted));
5197  out.append("\n");
5198  out.append("}");
5199 }
5200 #endif
5202  switch (field_id) {
5203  case 2: {
5204  this->has_command = value.as_bool();
5205  return true;
5206  }
5207  case 3: {
5208  this->command = value.as_enum<enums::MediaPlayerCommand>();
5209  return true;
5210  }
5211  case 4: {
5212  this->has_volume = value.as_bool();
5213  return true;
5214  }
5215  case 6: {
5216  this->has_media_url = value.as_bool();
5217  return true;
5218  }
5219  default:
5220  return false;
5221  }
5222 }
5224  switch (field_id) {
5225  case 7: {
5226  this->media_url = value.as_string();
5227  return true;
5228  }
5229  default:
5230  return false;
5231  }
5232 }
5233 bool MediaPlayerCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
5234  switch (field_id) {
5235  case 1: {
5236  this->key = value.as_fixed32();
5237  return true;
5238  }
5239  case 5: {
5240  this->volume = value.as_float();
5241  return true;
5242  }
5243  default:
5244  return false;
5245  }
5246 }
5248  buffer.encode_fixed32(1, this->key);
5249  buffer.encode_bool(2, this->has_command);
5250  buffer.encode_enum<enums::MediaPlayerCommand>(3, this->command);
5251  buffer.encode_bool(4, this->has_volume);
5252  buffer.encode_float(5, this->volume);
5253  buffer.encode_bool(6, this->has_media_url);
5254  buffer.encode_string(7, this->media_url);
5255 }
5256 #ifdef HAS_PROTO_MESSAGE_DUMP
5257 void MediaPlayerCommandRequest::dump_to(std::string &out) const {
5258  __attribute__((unused)) char buffer[64];
5259  out.append("MediaPlayerCommandRequest {\n");
5260  out.append(" key: ");
5261  sprintf(buffer, "%" PRIu32, this->key);
5262  out.append(buffer);
5263  out.append("\n");
5264 
5265  out.append(" has_command: ");
5266  out.append(YESNO(this->has_command));
5267  out.append("\n");
5268 
5269  out.append(" command: ");
5270  out.append(proto_enum_to_string<enums::MediaPlayerCommand>(this->command));
5271  out.append("\n");
5272 
5273  out.append(" has_volume: ");
5274  out.append(YESNO(this->has_volume));
5275  out.append("\n");
5276 
5277  out.append(" volume: ");
5278  sprintf(buffer, "%g", this->volume);
5279  out.append(buffer);
5280  out.append("\n");
5281 
5282  out.append(" has_media_url: ");
5283  out.append(YESNO(this->has_media_url));
5284  out.append("\n");
5285 
5286  out.append(" media_url: ");
5287  out.append("'").append(this->media_url).append("'");
5288  out.append("\n");
5289  out.append("}");
5290 }
5291 #endif
5293  switch (field_id) {
5294  case 1: {
5295  this->flags = value.as_uint32();
5296  return true;
5297  }
5298  default:
5299  return false;
5300  }
5301 }
5303  buffer.encode_uint32(1, this->flags);
5304 }
5305 #ifdef HAS_PROTO_MESSAGE_DUMP
5307  __attribute__((unused)) char buffer[64];
5308  out.append("SubscribeBluetoothLEAdvertisementsRequest {\n");
5309  out.append(" flags: ");
5310  sprintf(buffer, "%" PRIu32, this->flags);
5311  out.append(buffer);
5312  out.append("\n");
5313  out.append("}");
5314 }
5315 #endif
5316 bool BluetoothServiceData::decode_varint(uint32_t field_id, ProtoVarInt value) {
5317  switch (field_id) {
5318  case 2: {
5319  this->legacy_data.push_back(value.as_uint32());
5320  return true;
5321  }
5322  default:
5323  return false;
5324  }
5325 }
5327  switch (field_id) {
5328  case 1: {
5329  this->uuid = value.as_string();
5330  return true;
5331  }
5332  case 3: {
5333  this->data = value.as_string();
5334  return true;
5335  }
5336  default:
5337  return false;
5338  }
5339 }
5341  buffer.encode_string(1, this->uuid);
5342  for (auto &it : this->legacy_data) {
5343  buffer.encode_uint32(2, it, true);
5344  }
5345  buffer.encode_string(3, this->data);
5346 }
5347 #ifdef HAS_PROTO_MESSAGE_DUMP
5348 void BluetoothServiceData::dump_to(std::string &out) const {
5349  __attribute__((unused)) char buffer[64];
5350  out.append("BluetoothServiceData {\n");
5351  out.append(" uuid: ");
5352  out.append("'").append(this->uuid).append("'");
5353  out.append("\n");
5354 
5355  for (const auto &it : this->legacy_data) {
5356  out.append(" legacy_data: ");
5357  sprintf(buffer, "%" PRIu32, it);
5358  out.append(buffer);
5359  out.append("\n");
5360  }
5361 
5362  out.append(" data: ");
5363  out.append("'").append(this->data).append("'");
5364  out.append("\n");
5365  out.append("}");
5366 }
5367 #endif
5369  switch (field_id) {
5370  case 1: {
5371  this->address = value.as_uint64();
5372  return true;
5373  }
5374  case 3: {
5375  this->rssi = value.as_sint32();
5376  return true;
5377  }
5378  case 7: {
5379  this->address_type = value.as_uint32();
5380  return true;
5381  }
5382  default:
5383  return false;
5384  }
5385 }
5387  switch (field_id) {
5388  case 2: {
5389  this->name = value.as_string();
5390  return true;
5391  }
5392  case 4: {
5393  this->service_uuids.push_back(value.as_string());
5394  return true;
5395  }
5396  case 5: {
5397  this->service_data.push_back(value.as_message<BluetoothServiceData>());
5398  return true;
5399  }
5400  case 6: {
5401  this->manufacturer_data.push_back(value.as_message<BluetoothServiceData>());
5402  return true;
5403  }
5404  default:
5405  return false;
5406  }
5407 }
5409  buffer.encode_uint64(1, this->address);
5410  buffer.encode_string(2, this->name);
5411  buffer.encode_sint32(3, this->rssi);
5412  for (auto &it : this->service_uuids) {
5413  buffer.encode_string(4, it, true);
5414  }
5415  for (auto &it : this->service_data) {
5416  buffer.encode_message<BluetoothServiceData>(5, it, true);
5417  }
5418  for (auto &it : this->manufacturer_data) {
5419  buffer.encode_message<BluetoothServiceData>(6, it, true);
5420  }
5421  buffer.encode_uint32(7, this->address_type);
5422 }
5423 #ifdef HAS_PROTO_MESSAGE_DUMP
5424 void BluetoothLEAdvertisementResponse::dump_to(std::string &out) const {
5425  __attribute__((unused)) char buffer[64];
5426  out.append("BluetoothLEAdvertisementResponse {\n");
5427  out.append(" address: ");
5428  sprintf(buffer, "%llu", this->address);
5429  out.append(buffer);
5430  out.append("\n");
5431 
5432  out.append(" name: ");
5433  out.append("'").append(this->name).append("'");
5434  out.append("\n");
5435 
5436  out.append(" rssi: ");
5437  sprintf(buffer, "%" PRId32, this->rssi);
5438  out.append(buffer);
5439  out.append("\n");
5440 
5441  for (const auto &it : this->service_uuids) {
5442  out.append(" service_uuids: ");
5443  out.append("'").append(it).append("'");
5444  out.append("\n");
5445  }
5446 
5447  for (const auto &it : this->service_data) {
5448  out.append(" service_data: ");
5449  it.dump_to(out);
5450  out.append("\n");
5451  }
5452 
5453  for (const auto &it : this->manufacturer_data) {
5454  out.append(" manufacturer_data: ");
5455  it.dump_to(out);
5456  out.append("\n");
5457  }
5458 
5459  out.append(" address_type: ");
5460  sprintf(buffer, "%" PRIu32, this->address_type);
5461  out.append(buffer);
5462  out.append("\n");
5463  out.append("}");
5464 }
5465 #endif
5467  switch (field_id) {
5468  case 1: {
5469  this->address = value.as_uint64();
5470  return true;
5471  }
5472  case 2: {
5473  this->rssi = value.as_sint32();
5474  return true;
5475  }
5476  case 3: {
5477  this->address_type = value.as_uint32();
5478  return true;
5479  }
5480  default:
5481  return false;
5482  }
5483 }
5485  switch (field_id) {
5486  case 4: {
5487  this->data = value.as_string();
5488  return true;
5489  }
5490  default:
5491  return false;
5492  }
5493 }
5495  buffer.encode_uint64(1, this->address);
5496  buffer.encode_sint32(2, this->rssi);
5497  buffer.encode_uint32(3, this->address_type);
5498  buffer.encode_string(4, this->data);
5499 }
5500 #ifdef HAS_PROTO_MESSAGE_DUMP
5501 void BluetoothLERawAdvertisement::dump_to(std::string &out) const {
5502  __attribute__((unused)) char buffer[64];
5503  out.append("BluetoothLERawAdvertisement {\n");
5504  out.append(" address: ");
5505  sprintf(buffer, "%llu", this->address);
5506  out.append(buffer);
5507  out.append("\n");
5508 
5509  out.append(" rssi: ");
5510  sprintf(buffer, "%" PRId32, this->rssi);
5511  out.append(buffer);
5512  out.append("\n");
5513 
5514  out.append(" address_type: ");
5515  sprintf(buffer, "%" PRIu32, this->address_type);
5516  out.append(buffer);
5517  out.append("\n");
5518 
5519  out.append(" data: ");
5520  out.append("'").append(this->data).append("'");
5521  out.append("\n");
5522  out.append("}");
5523 }
5524 #endif
5526  switch (field_id) {
5527  case 1: {
5528  this->advertisements.push_back(value.as_message<BluetoothLERawAdvertisement>());
5529  return true;
5530  }
5531  default:
5532  return false;
5533  }
5534 }
5536  for (auto &it : this->advertisements) {
5537  buffer.encode_message<BluetoothLERawAdvertisement>(1, it, true);
5538  }
5539 }
5540 #ifdef HAS_PROTO_MESSAGE_DUMP
5542  __attribute__((unused)) char buffer[64];
5543  out.append("BluetoothLERawAdvertisementsResponse {\n");
5544  for (const auto &it : this->advertisements) {
5545  out.append(" advertisements: ");
5546  it.dump_to(out);
5547  out.append("\n");
5548  }
5549  out.append("}");
5550 }
5551 #endif
5552 bool BluetoothDeviceRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
5553  switch (field_id) {
5554  case 1: {
5555  this->address = value.as_uint64();
5556  return true;
5557  }
5558  case 2: {
5559  this->request_type = value.as_enum<enums::BluetoothDeviceRequestType>();
5560  return true;
5561  }
5562  case 3: {
5563  this->has_address_type = value.as_bool();
5564  return true;
5565  }
5566  case 4: {
5567  this->address_type = value.as_uint32();
5568  return true;
5569  }
5570  default:
5571  return false;
5572  }
5573 }
5575  buffer.encode_uint64(1, this->address);
5576  buffer.encode_enum<enums::BluetoothDeviceRequestType>(2, this->request_type);
5577  buffer.encode_bool(3, this->has_address_type);
5578  buffer.encode_uint32(4, this->address_type);
5579 }
5580 #ifdef HAS_PROTO_MESSAGE_DUMP
5581 void BluetoothDeviceRequest::dump_to(std::string &out) const {
5582  __attribute__((unused)) char buffer[64];
5583  out.append("BluetoothDeviceRequest {\n");
5584  out.append(" address: ");
5585  sprintf(buffer, "%llu", this->address);
5586  out.append(buffer);
5587  out.append("\n");
5588 
5589  out.append(" request_type: ");
5590  out.append(proto_enum_to_string<enums::BluetoothDeviceRequestType>(this->request_type));
5591  out.append("\n");
5592 
5593  out.append(" has_address_type: ");
5594  out.append(YESNO(this->has_address_type));
5595  out.append("\n");
5596 
5597  out.append(" address_type: ");
5598  sprintf(buffer, "%" PRIu32, this->address_type);
5599  out.append(buffer);
5600  out.append("\n");
5601  out.append("}");
5602 }
5603 #endif
5605  switch (field_id) {
5606  case 1: {
5607  this->address = value.as_uint64();
5608  return true;
5609  }
5610  case 2: {
5611  this->connected = value.as_bool();
5612  return true;
5613  }
5614  case 3: {
5615  this->mtu = value.as_uint32();
5616  return true;
5617  }
5618  case 4: {
5619  this->error = value.as_int32();
5620  return true;
5621  }
5622  default:
5623  return false;
5624  }
5625 }
5627  buffer.encode_uint64(1, this->address);
5628  buffer.encode_bool(2, this->connected);
5629  buffer.encode_uint32(3, this->mtu);
5630  buffer.encode_int32(4, this->error);
5631 }
5632 #ifdef HAS_PROTO_MESSAGE_DUMP
5633 void BluetoothDeviceConnectionResponse::dump_to(std::string &out) const {
5634  __attribute__((unused)) char buffer[64];
5635  out.append("BluetoothDeviceConnectionResponse {\n");
5636  out.append(" address: ");
5637  sprintf(buffer, "%llu", this->address);
5638  out.append(buffer);
5639  out.append("\n");
5640 
5641  out.append(" connected: ");
5642  out.append(YESNO(this->connected));
5643  out.append("\n");
5644 
5645  out.append(" mtu: ");
5646  sprintf(buffer, "%" PRIu32, this->mtu);
5647  out.append(buffer);
5648  out.append("\n");
5649 
5650  out.append(" error: ");
5651  sprintf(buffer, "%" PRId32, this->error);
5652  out.append(buffer);
5653  out.append("\n");
5654  out.append("}");
5655 }
5656 #endif
5658  switch (field_id) {
5659  case 1: {
5660  this->address = value.as_uint64();
5661  return true;
5662  }
5663  default:
5664  return false;
5665  }
5666 }
5667 void BluetoothGATTGetServicesRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_uint64(1, this->address); }
5668 #ifdef HAS_PROTO_MESSAGE_DUMP
5669 void BluetoothGATTGetServicesRequest::dump_to(std::string &out) const {
5670  __attribute__((unused)) char buffer[64];
5671  out.append("BluetoothGATTGetServicesRequest {\n");
5672  out.append(" address: ");
5673  sprintf(buffer, "%llu", this->address);
5674  out.append(buffer);
5675  out.append("\n");
5676  out.append("}");
5677 }
5678 #endif
5679 bool BluetoothGATTDescriptor::decode_varint(uint32_t field_id, ProtoVarInt value) {
5680  switch (field_id) {
5681  case 1: {
5682  this->uuid.push_back(value.as_uint64());
5683  return true;
5684  }
5685  case 2: {
5686  this->handle = value.as_uint32();
5687  return true;
5688  }
5689  default:
5690  return false;
5691  }
5692 }
5694  for (auto &it : this->uuid) {
5695  buffer.encode_uint64(1, it, true);
5696  }
5697  buffer.encode_uint32(2, this->handle);
5698 }
5699 #ifdef HAS_PROTO_MESSAGE_DUMP
5700 void BluetoothGATTDescriptor::dump_to(std::string &out) const {
5701  __attribute__((unused)) char buffer[64];
5702  out.append("BluetoothGATTDescriptor {\n");
5703  for (const auto &it : this->uuid) {
5704  out.append(" uuid: ");
5705  sprintf(buffer, "%llu", it);
5706  out.append(buffer);
5707  out.append("\n");
5708  }
5709 
5710  out.append(" handle: ");
5711  sprintf(buffer, "%" PRIu32, this->handle);
5712  out.append(buffer);
5713  out.append("\n");
5714  out.append("}");
5715 }
5716 #endif
5718  switch (field_id) {
5719  case 1: {
5720  this->uuid.push_back(value.as_uint64());
5721  return true;
5722  }
5723  case 2: {
5724  this->handle = value.as_uint32();
5725  return true;
5726  }
5727  case 3: {
5728  this->properties = value.as_uint32();
5729  return true;
5730  }
5731  default:
5732  return false;
5733  }
5734 }
5736  switch (field_id) {
5737  case 4: {
5738  this->descriptors.push_back(value.as_message<BluetoothGATTDescriptor>());
5739  return true;
5740  }
5741  default:
5742  return false;
5743  }
5744 }
5746  for (auto &it : this->uuid) {
5747  buffer.encode_uint64(1, it, true);
5748  }
5749  buffer.encode_uint32(2, this->handle);
5750  buffer.encode_uint32(3, this->properties);
5751  for (auto &it : this->descriptors) {
5752  buffer.encode_message<BluetoothGATTDescriptor>(4, it, true);
5753  }
5754 }
5755 #ifdef HAS_PROTO_MESSAGE_DUMP
5756 void BluetoothGATTCharacteristic::dump_to(std::string &out) const {
5757  __attribute__((unused)) char buffer[64];
5758  out.append("BluetoothGATTCharacteristic {\n");
5759  for (const auto &it : this->uuid) {
5760  out.append(" uuid: ");
5761  sprintf(buffer, "%llu", it);
5762  out.append(buffer);
5763  out.append("\n");
5764  }
5765 
5766  out.append(" handle: ");
5767  sprintf(buffer, "%" PRIu32, this->handle);
5768  out.append(buffer);
5769  out.append("\n");
5770 
5771  out.append(" properties: ");
5772  sprintf(buffer, "%" PRIu32, this->properties);
5773  out.append(buffer);
5774  out.append("\n");
5775 
5776  for (const auto &it : this->descriptors) {
5777  out.append(" descriptors: ");
5778  it.dump_to(out);
5779  out.append("\n");
5780  }
5781  out.append("}");
5782 }
5783 #endif
5784 bool BluetoothGATTService::decode_varint(uint32_t field_id, ProtoVarInt value) {
5785  switch (field_id) {
5786  case 1: {
5787  this->uuid.push_back(value.as_uint64());
5788  return true;
5789  }
5790  case 2: {
5791  this->handle = value.as_uint32();
5792  return true;
5793  }
5794  default:
5795  return false;
5796  }
5797 }
5799  switch (field_id) {
5800  case 3: {
5801  this->characteristics.push_back(value.as_message<BluetoothGATTCharacteristic>());
5802  return true;
5803  }
5804  default:
5805  return false;
5806  }
5807 }
5809  for (auto &it : this->uuid) {
5810  buffer.encode_uint64(1, it, true);
5811  }
5812  buffer.encode_uint32(2, this->handle);
5813  for (auto &it : this->characteristics) {
5814  buffer.encode_message<BluetoothGATTCharacteristic>(3, it, true);
5815  }
5816 }
5817 #ifdef HAS_PROTO_MESSAGE_DUMP
5818 void BluetoothGATTService::dump_to(std::string &out) const {
5819  __attribute__((unused)) char buffer[64];
5820  out.append("BluetoothGATTService {\n");
5821  for (const auto &it : this->uuid) {
5822  out.append(" uuid: ");
5823  sprintf(buffer, "%llu", it);
5824  out.append(buffer);
5825  out.append("\n");
5826  }
5827 
5828  out.append(" handle: ");
5829  sprintf(buffer, "%" PRIu32, this->handle);
5830  out.append(buffer);
5831  out.append("\n");
5832 
5833  for (const auto &it : this->characteristics) {
5834  out.append(" characteristics: ");
5835  it.dump_to(out);
5836  out.append("\n");
5837  }
5838  out.append("}");
5839 }
5840 #endif
5842  switch (field_id) {
5843  case 1: {
5844  this->address = value.as_uint64();
5845  return true;
5846  }
5847  default:
5848  return false;
5849  }
5850 }
5852  switch (field_id) {
5853  case 2: {
5854  this->services.push_back(value.as_message<BluetoothGATTService>());
5855  return true;
5856  }
5857  default:
5858  return false;
5859  }
5860 }
5862  buffer.encode_uint64(1, this->address);
5863  for (auto &it : this->services) {
5864  buffer.encode_message<BluetoothGATTService>(2, it, true);
5865  }
5866 }
5867 #ifdef HAS_PROTO_MESSAGE_DUMP
5868 void BluetoothGATTGetServicesResponse::dump_to(std::string &out) const {
5869  __attribute__((unused)) char buffer[64];
5870  out.append("BluetoothGATTGetServicesResponse {\n");
5871  out.append(" address: ");
5872  sprintf(buffer, "%llu", this->address);
5873  out.append(buffer);
5874  out.append("\n");
5875 
5876  for (const auto &it : this->services) {
5877  out.append(" services: ");
5878  it.dump_to(out);
5879  out.append("\n");
5880  }
5881  out.append("}");
5882 }
5883 #endif
5885  switch (field_id) {
5886  case 1: {
5887  this->address = value.as_uint64();
5888  return true;
5889  }
5890  default:
5891  return false;
5892  }
5893 }
5895  buffer.encode_uint64(1, this->address);
5896 }
5897 #ifdef HAS_PROTO_MESSAGE_DUMP
5899  __attribute__((unused)) char buffer[64];
5900  out.append("BluetoothGATTGetServicesDoneResponse {\n");
5901  out.append(" address: ");
5902  sprintf(buffer, "%llu", this->address);
5903  out.append(buffer);
5904  out.append("\n");
5905  out.append("}");
5906 }
5907 #endif
5909  switch (field_id) {
5910  case 1: {
5911  this->address = value.as_uint64();
5912  return true;
5913  }
5914  case 2: {
5915  this->handle = value.as_uint32();
5916  return true;
5917  }
5918  default:
5919  return false;
5920  }
5921 }
5923  buffer.encode_uint64(1, this->address);
5924  buffer.encode_uint32(2, this->handle);
5925 }
5926 #ifdef HAS_PROTO_MESSAGE_DUMP
5927 void BluetoothGATTReadRequest::dump_to(std::string &out) const {
5928  __attribute__((unused)) char buffer[64];
5929  out.append("BluetoothGATTReadRequest {\n");
5930  out.append(" address: ");
5931  sprintf(buffer, "%llu", this->address);
5932  out.append(buffer);
5933  out.append("\n");
5934 
5935  out.append(" handle: ");
5936  sprintf(buffer, "%" PRIu32, this->handle);
5937  out.append(buffer);
5938  out.append("\n");
5939  out.append("}");
5940 }
5941 #endif
5943  switch (field_id) {
5944  case 1: {
5945  this->address = value.as_uint64();
5946  return true;
5947  }
5948  case 2: {
5949  this->handle = value.as_uint32();
5950  return true;
5951  }
5952  default:
5953  return false;
5954  }
5955 }
5957  switch (field_id) {
5958  case 3: {
5959  this->data = value.as_string();
5960  return true;
5961  }
5962  default:
5963  return false;
5964  }
5965 }
5967  buffer.encode_uint64(1, this->address);
5968  buffer.encode_uint32(2, this->handle);
5969  buffer.encode_string(3, this->data);
5970 }
5971 #ifdef HAS_PROTO_MESSAGE_DUMP
5972 void BluetoothGATTReadResponse::dump_to(std::string &out) const {
5973  __attribute__((unused)) char buffer[64];
5974  out.append("BluetoothGATTReadResponse {\n");
5975  out.append(" address: ");
5976  sprintf(buffer, "%llu", this->address);
5977  out.append(buffer);
5978  out.append("\n");
5979 
5980  out.append(" handle: ");
5981  sprintf(buffer, "%" PRIu32, this->handle);
5982  out.append(buffer);
5983  out.append("\n");
5984 
5985  out.append(" data: ");
5986  out.append("'").append(this->data).append("'");
5987  out.append("\n");
5988  out.append("}");
5989 }
5990 #endif
5992  switch (field_id) {
5993  case 1: {
5994  this->address = value.as_uint64();
5995  return true;
5996  }
5997  case 2: {
5998  this->handle = value.as_uint32();
5999  return true;
6000  }
6001  case 3: {
6002  this->response = value.as_bool();
6003  return true;
6004  }
6005  default:
6006  return false;
6007  }
6008 }
6010  switch (field_id) {
6011  case 4: {
6012  this->data = value.as_string();
6013  return true;
6014  }
6015  default:
6016  return false;
6017  }
6018 }
6020  buffer.encode_uint64(1, this->address);
6021  buffer.encode_uint32(2, this->handle);
6022  buffer.encode_bool(3, this->response);
6023  buffer.encode_string(4, this->data);
6024 }
6025 #ifdef HAS_PROTO_MESSAGE_DUMP
6026 void BluetoothGATTWriteRequest::dump_to(std::string &out) const {
6027  __attribute__((unused)) char buffer[64];
6028  out.append("BluetoothGATTWriteRequest {\n");
6029  out.append(" address: ");
6030  sprintf(buffer, "%llu", this->address);
6031  out.append(buffer);
6032  out.append("\n");
6033 
6034  out.append(" handle: ");
6035  sprintf(buffer, "%" PRIu32, this->handle);
6036  out.append(buffer);
6037  out.append("\n");
6038 
6039  out.append(" response: ");
6040  out.append(YESNO(this->response));
6041  out.append("\n");
6042 
6043  out.append(" data: ");
6044  out.append("'").append(this->data).append("'");
6045  out.append("\n");
6046  out.append("}");
6047 }
6048 #endif
6050  switch (field_id) {
6051  case 1: {
6052  this->address = value.as_uint64();
6053  return true;
6054  }
6055  case 2: {
6056  this->handle = value.as_uint32();
6057  return true;
6058  }
6059  default:
6060  return false;
6061  }
6062 }
6064  buffer.encode_uint64(1, this->address);
6065  buffer.encode_uint32(2, this->handle);
6066 }
6067 #ifdef HAS_PROTO_MESSAGE_DUMP
6068 void BluetoothGATTReadDescriptorRequest::dump_to(std::string &out) const {
6069  __attribute__((unused)) char buffer[64];
6070  out.append("BluetoothGATTReadDescriptorRequest {\n");
6071  out.append(" address: ");
6072  sprintf(buffer, "%llu", this->address);
6073  out.append(buffer);
6074  out.append("\n");
6075 
6076  out.append(" handle: ");
6077  sprintf(buffer, "%" PRIu32, this->handle);
6078  out.append(buffer);
6079  out.append("\n");
6080  out.append("}");
6081 }
6082 #endif
6084  switch (field_id) {
6085  case 1: {
6086  this->address = value.as_uint64();
6087  return true;
6088  }
6089  case 2: {
6090  this->handle = value.as_uint32();
6091  return true;
6092  }
6093  default:
6094  return false;
6095  }
6096 }
6098  switch (field_id) {
6099  case 3: {
6100  this->data = value.as_string();
6101  return true;
6102  }
6103  default:
6104  return false;
6105  }
6106 }
6108  buffer.encode_uint64(1, this->address);
6109  buffer.encode_uint32(2, this->handle);
6110  buffer.encode_string(3, this->data);
6111 }
6112 #ifdef HAS_PROTO_MESSAGE_DUMP
6113 void BluetoothGATTWriteDescriptorRequest::dump_to(std::string &out) const {
6114  __attribute__((unused)) char buffer[64];
6115  out.append("BluetoothGATTWriteDescriptorRequest {\n");
6116  out.append(" address: ");
6117  sprintf(buffer, "%llu", this->address);
6118  out.append(buffer);
6119  out.append("\n");
6120 
6121  out.append(" handle: ");
6122  sprintf(buffer, "%" PRIu32, this->handle);
6123  out.append(buffer);
6124  out.append("\n");
6125 
6126  out.append(" data: ");
6127  out.append("'").append(this->data).append("'");
6128  out.append("\n");
6129  out.append("}");
6130 }
6131 #endif
6133  switch (field_id) {
6134  case 1: {
6135  this->address = value.as_uint64();
6136  return true;
6137  }
6138  case 2: {
6139  this->handle = value.as_uint32();
6140  return true;
6141  }
6142  case 3: {
6143  this->enable = value.as_bool();
6144  return true;
6145  }
6146  default:
6147  return false;
6148  }
6149 }
6151  buffer.encode_uint64(1, this->address);
6152  buffer.encode_uint32(2, this->handle);
6153  buffer.encode_bool(3, this->enable);
6154 }
6155 #ifdef HAS_PROTO_MESSAGE_DUMP
6156 void BluetoothGATTNotifyRequest::dump_to(std::string &out) const {
6157  __attribute__((unused)) char buffer[64];
6158  out.append("BluetoothGATTNotifyRequest {\n");
6159  out.append(" address: ");
6160  sprintf(buffer, "%llu", this->address);
6161  out.append(buffer);
6162  out.append("\n");
6163 
6164  out.append(" handle: ");
6165  sprintf(buffer, "%" PRIu32, this->handle);
6166  out.append(buffer);
6167  out.append("\n");
6168 
6169  out.append(" enable: ");
6170  out.append(YESNO(this->enable));
6171  out.append("\n");
6172  out.append("}");
6173 }
6174 #endif
6176  switch (field_id) {
6177  case 1: {
6178  this->address = value.as_uint64();
6179  return true;
6180  }
6181  case 2: {
6182  this->handle = value.as_uint32();
6183  return true;
6184  }
6185  default:
6186  return false;
6187  }
6188 }
6190  switch (field_id) {
6191  case 3: {
6192  this->data = value.as_string();
6193  return true;
6194  }
6195  default:
6196  return false;
6197  }
6198 }
6200  buffer.encode_uint64(1, this->address);
6201  buffer.encode_uint32(2, this->handle);
6202  buffer.encode_string(3, this->data);
6203 }
6204 #ifdef HAS_PROTO_MESSAGE_DUMP
6205 void BluetoothGATTNotifyDataResponse::dump_to(std::string &out) const {
6206  __attribute__((unused)) char buffer[64];
6207  out.append("BluetoothGATTNotifyDataResponse {\n");
6208  out.append(" address: ");
6209  sprintf(buffer, "%llu", this->address);
6210  out.append(buffer);
6211  out.append("\n");
6212 
6213  out.append(" handle: ");
6214  sprintf(buffer, "%" PRIu32, this->handle);
6215  out.append(buffer);
6216  out.append("\n");
6217 
6218  out.append(" data: ");
6219  out.append("'").append(this->data).append("'");
6220  out.append("\n");
6221  out.append("}");
6222 }
6223 #endif
6225 #ifdef HAS_PROTO_MESSAGE_DUMP
6227  out.append("SubscribeBluetoothConnectionsFreeRequest {}");
6228 }
6229 #endif
6231  switch (field_id) {
6232  case 1: {
6233  this->free = value.as_uint32();
6234  return true;
6235  }
6236  case 2: {
6237  this->limit = value.as_uint32();
6238  return true;
6239  }
6240  default:
6241  return false;
6242  }
6243 }
6245  buffer.encode_uint32(1, this->free);
6246  buffer.encode_uint32(2, this->limit);
6247 }
6248 #ifdef HAS_PROTO_MESSAGE_DUMP
6249 void BluetoothConnectionsFreeResponse::dump_to(std::string &out) const {
6250  __attribute__((unused)) char buffer[64];
6251  out.append("BluetoothConnectionsFreeResponse {\n");
6252  out.append(" free: ");
6253  sprintf(buffer, "%" PRIu32, this->free);
6254  out.append(buffer);
6255  out.append("\n");
6256 
6257  out.append(" limit: ");
6258  sprintf(buffer, "%" PRIu32, this->limit);
6259  out.append(buffer);
6260  out.append("\n");
6261  out.append("}");
6262 }
6263 #endif
6265  switch (field_id) {
6266  case 1: {
6267  this->address = value.as_uint64();
6268  return true;
6269  }
6270  case 2: {
6271  this->handle = value.as_uint32();
6272  return true;
6273  }
6274  case 3: {
6275  this->error = value.as_int32();
6276  return true;
6277  }
6278  default:
6279  return false;
6280  }
6281 }
6283  buffer.encode_uint64(1, this->address);
6284  buffer.encode_uint32(2, this->handle);
6285  buffer.encode_int32(3, this->error);
6286 }
6287 #ifdef HAS_PROTO_MESSAGE_DUMP
6288 void BluetoothGATTErrorResponse::dump_to(std::string &out) const {
6289  __attribute__((unused)) char buffer[64];
6290  out.append("BluetoothGATTErrorResponse {\n");
6291  out.append(" address: ");
6292  sprintf(buffer, "%llu", this->address);
6293  out.append(buffer);
6294  out.append("\n");
6295 
6296  out.append(" handle: ");
6297  sprintf(buffer, "%" PRIu32, this->handle);
6298  out.append(buffer);
6299  out.append("\n");
6300 
6301  out.append(" error: ");
6302  sprintf(buffer, "%" PRId32, this->error);
6303  out.append(buffer);
6304  out.append("\n");
6305  out.append("}");
6306 }
6307 #endif
6309  switch (field_id) {
6310  case 1: {
6311  this->address = value.as_uint64();
6312  return true;
6313  }
6314  case 2: {
6315  this->handle = value.as_uint32();
6316  return true;
6317  }
6318  default:
6319  return false;
6320  }
6321 }
6323  buffer.encode_uint64(1, this->address);
6324  buffer.encode_uint32(2, this->handle);
6325 }
6326 #ifdef HAS_PROTO_MESSAGE_DUMP
6327 void BluetoothGATTWriteResponse::dump_to(std::string &out) const {
6328  __attribute__((unused)) char buffer[64];
6329  out.append("BluetoothGATTWriteResponse {\n");
6330  out.append(" address: ");
6331  sprintf(buffer, "%llu", this->address);
6332  out.append(buffer);
6333  out.append("\n");
6334 
6335  out.append(" handle: ");
6336  sprintf(buffer, "%" PRIu32, this->handle);
6337  out.append(buffer);
6338  out.append("\n");
6339  out.append("}");
6340 }
6341 #endif
6343  switch (field_id) {
6344  case 1: {
6345  this->address = value.as_uint64();
6346  return true;
6347  }
6348  case 2: {
6349  this->handle = value.as_uint32();
6350  return true;
6351  }
6352  default:
6353  return false;
6354  }
6355 }
6357  buffer.encode_uint64(1, this->address);
6358  buffer.encode_uint32(2, this->handle);
6359 }
6360 #ifdef HAS_PROTO_MESSAGE_DUMP
6361 void BluetoothGATTNotifyResponse::dump_to(std::string &out) const {
6362  __attribute__((unused)) char buffer[64];
6363  out.append("BluetoothGATTNotifyResponse {\n");
6364  out.append(" address: ");
6365  sprintf(buffer, "%llu", this->address);
6366  out.append(buffer);
6367  out.append("\n");
6368 
6369  out.append(" handle: ");
6370  sprintf(buffer, "%" PRIu32, this->handle);
6371  out.append(buffer);
6372  out.append("\n");
6373  out.append("}");
6374 }
6375 #endif
6377  switch (field_id) {
6378  case 1: {
6379  this->address = value.as_uint64();
6380  return true;
6381  }
6382  case 2: {
6383  this->paired = value.as_bool();
6384  return true;
6385  }
6386  case 3: {
6387  this->error = value.as_int32();
6388  return true;
6389  }
6390  default:
6391  return false;
6392  }
6393 }
6395  buffer.encode_uint64(1, this->address);
6396  buffer.encode_bool(2, this->paired);
6397  buffer.encode_int32(3, this->error);
6398 }
6399 #ifdef HAS_PROTO_MESSAGE_DUMP
6400 void BluetoothDevicePairingResponse::dump_to(std::string &out) const {
6401  __attribute__((unused)) char buffer[64];
6402  out.append("BluetoothDevicePairingResponse {\n");
6403  out.append(" address: ");
6404  sprintf(buffer, "%llu", this->address);
6405  out.append(buffer);
6406  out.append("\n");
6407 
6408  out.append(" paired: ");
6409  out.append(YESNO(this->paired));
6410  out.append("\n");
6411 
6412  out.append(" error: ");
6413  sprintf(buffer, "%" PRId32, this->error);
6414  out.append(buffer);
6415  out.append("\n");
6416  out.append("}");
6417 }
6418 #endif
6420  switch (field_id) {
6421  case 1: {
6422  this->address = value.as_uint64();
6423  return true;
6424  }
6425  case 2: {
6426  this->success = value.as_bool();
6427  return true;
6428  }
6429  case 3: {
6430  this->error = value.as_int32();
6431  return true;
6432  }
6433  default:
6434  return false;
6435  }
6436 }
6438  buffer.encode_uint64(1, this->address);
6439  buffer.encode_bool(2, this->success);
6440  buffer.encode_int32(3, this->error);
6441 }
6442 #ifdef HAS_PROTO_MESSAGE_DUMP
6443 void BluetoothDeviceUnpairingResponse::dump_to(std::string &out) const {
6444  __attribute__((unused)) char buffer[64];
6445  out.append("BluetoothDeviceUnpairingResponse {\n");
6446  out.append(" address: ");
6447  sprintf(buffer, "%llu", this->address);
6448  out.append(buffer);
6449  out.append("\n");
6450 
6451  out.append(" success: ");
6452  out.append(YESNO(this->success));
6453  out.append("\n");
6454 
6455  out.append(" error: ");
6456  sprintf(buffer, "%" PRId32, this->error);
6457  out.append(buffer);
6458  out.append("\n");
6459  out.append("}");
6460 }
6461 #endif
6463 #ifdef HAS_PROTO_MESSAGE_DUMP
6465  out.append("UnsubscribeBluetoothLEAdvertisementsRequest {}");
6466 }
6467 #endif
6469  switch (field_id) {
6470  case 1: {
6471  this->address = value.as_uint64();
6472  return true;
6473  }
6474  case 2: {
6475  this->success = value.as_bool();
6476  return true;
6477  }
6478  case 3: {
6479  this->error = value.as_int32();
6480  return true;
6481  }
6482  default:
6483  return false;
6484  }
6485 }
6487  buffer.encode_uint64(1, this->address);
6488  buffer.encode_bool(2, this->success);
6489  buffer.encode_int32(3, this->error);
6490 }
6491 #ifdef HAS_PROTO_MESSAGE_DUMP
6492 void BluetoothDeviceClearCacheResponse::dump_to(std::string &out) const {
6493  __attribute__((unused)) char buffer[64];
6494  out.append("BluetoothDeviceClearCacheResponse {\n");
6495  out.append(" address: ");
6496  sprintf(buffer, "%llu", this->address);
6497  out.append(buffer);
6498  out.append("\n");
6499 
6500  out.append(" success: ");
6501  out.append(YESNO(this->success));
6502  out.append("\n");
6503 
6504  out.append(" error: ");
6505  sprintf(buffer, "%" PRId32, this->error);
6506  out.append(buffer);
6507  out.append("\n");
6508  out.append("}");
6509 }
6510 #endif
6512  switch (field_id) {
6513  case 1: {
6514  this->subscribe = value.as_bool();
6515  return true;
6516  }
6517  default:
6518  return false;
6519  }
6520 }
6521 void SubscribeVoiceAssistantRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->subscribe); }
6522 #ifdef HAS_PROTO_MESSAGE_DUMP
6523 void SubscribeVoiceAssistantRequest::dump_to(std::string &out) const {
6524  __attribute__((unused)) char buffer[64];
6525  out.append("SubscribeVoiceAssistantRequest {\n");
6526  out.append(" subscribe: ");
6527  out.append(YESNO(this->subscribe));
6528  out.append("\n");
6529  out.append("}");
6530 }
6531 #endif
6533  switch (field_id) {
6534  case 1: {
6535  this->noise_suppression_level = value.as_uint32();
6536  return true;
6537  }
6538  case 2: {
6539  this->auto_gain = value.as_uint32();
6540  return true;
6541  }
6542  default:
6543  return false;
6544  }
6545 }
6547  switch (field_id) {
6548  case 3: {
6549  this->volume_multiplier = value.as_float();
6550  return true;
6551  }
6552  default:
6553  return false;
6554  }
6555 }
6557  buffer.encode_uint32(1, this->noise_suppression_level);
6558  buffer.encode_uint32(2, this->auto_gain);
6559  buffer.encode_float(3, this->volume_multiplier);
6560 }
6561 #ifdef HAS_PROTO_MESSAGE_DUMP
6562 void VoiceAssistantAudioSettings::dump_to(std::string &out) const {
6563  __attribute__((unused)) char buffer[64];
6564  out.append("VoiceAssistantAudioSettings {\n");
6565  out.append(" noise_suppression_level: ");
6566  sprintf(buffer, "%" PRIu32, this->noise_suppression_level);
6567  out.append(buffer);
6568  out.append("\n");
6569 
6570  out.append(" auto_gain: ");
6571  sprintf(buffer, "%" PRIu32, this->auto_gain);
6572  out.append(buffer);
6573  out.append("\n");
6574 
6575  out.append(" volume_multiplier: ");
6576  sprintf(buffer, "%g", this->volume_multiplier);
6577  out.append(buffer);
6578  out.append("\n");
6579  out.append("}");
6580 }
6581 #endif
6582 bool VoiceAssistantRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
6583  switch (field_id) {
6584  case 1: {
6585  this->start = value.as_bool();
6586  return true;
6587  }
6588  case 3: {
6589  this->flags = value.as_uint32();
6590  return true;
6591  }
6592  default:
6593  return false;
6594  }
6595 }
6597  switch (field_id) {
6598  case 2: {
6599  this->conversation_id = value.as_string();
6600  return true;
6601  }
6602  case 4: {
6603  this->audio_settings = value.as_message<VoiceAssistantAudioSettings>();
6604  return true;
6605  }
6606  case 5: {
6607  this->wake_word_phrase = value.as_string();
6608  return true;
6609  }
6610  default:
6611  return false;
6612  }
6613 }
6615  buffer.encode_bool(1, this->start);
6616  buffer.encode_string(2, this->conversation_id);
6617  buffer.encode_uint32(3, this->flags);
6618  buffer.encode_message<VoiceAssistantAudioSettings>(4, this->audio_settings);
6619  buffer.encode_string(5, this->wake_word_phrase);
6620 }
6621 #ifdef HAS_PROTO_MESSAGE_DUMP
6622 void VoiceAssistantRequest::dump_to(std::string &out) const {
6623  __attribute__((unused)) char buffer[64];
6624  out.append("VoiceAssistantRequest {\n");
6625  out.append(" start: ");
6626  out.append(YESNO(this->start));
6627  out.append("\n");
6628 
6629  out.append(" conversation_id: ");
6630  out.append("'").append(this->conversation_id).append("'");
6631  out.append("\n");
6632 
6633  out.append(" flags: ");
6634  sprintf(buffer, "%" PRIu32, this->flags);
6635  out.append(buffer);
6636  out.append("\n");
6637 
6638  out.append(" audio_settings: ");
6639  this->audio_settings.dump_to(out);
6640  out.append("\n");
6641 
6642  out.append(" wake_word_phrase: ");
6643  out.append("'").append(this->wake_word_phrase).append("'");
6644  out.append("\n");
6645  out.append("}");
6646 }
6647 #endif
6648 bool VoiceAssistantResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
6649  switch (field_id) {
6650  case 1: {
6651  this->port = value.as_uint32();
6652  return true;
6653  }
6654  case 2: {
6655  this->error = value.as_bool();
6656  return true;
6657  }
6658  default:
6659  return false;
6660  }
6661 }
6663  buffer.encode_uint32(1, this->port);
6664  buffer.encode_bool(2, this->error);
6665 }
6666 #ifdef HAS_PROTO_MESSAGE_DUMP
6667 void VoiceAssistantResponse::dump_to(std::string &out) const {
6668  __attribute__((unused)) char buffer[64];
6669  out.append("VoiceAssistantResponse {\n");
6670  out.append(" port: ");
6671  sprintf(buffer, "%" PRIu32, this->port);
6672  out.append(buffer);
6673  out.append("\n");
6674 
6675  out.append(" error: ");
6676  out.append(YESNO(this->error));
6677  out.append("\n");
6678  out.append("}");
6679 }
6680 #endif
6682  switch (field_id) {
6683  case 1: {
6684  this->name = value.as_string();
6685  return true;
6686  }
6687  case 2: {
6688  this->value = value.as_string();
6689  return true;
6690  }
6691  default:
6692  return false;
6693  }
6694 }
6696  buffer.encode_string(1, this->name);
6697  buffer.encode_string(2, this->value);
6698 }
6699 #ifdef HAS_PROTO_MESSAGE_DUMP
6700 void VoiceAssistantEventData::dump_to(std::string &out) const {
6701  __attribute__((unused)) char buffer[64];
6702  out.append("VoiceAssistantEventData {\n");
6703  out.append(" name: ");
6704  out.append("'").append(this->name).append("'");
6705  out.append("\n");
6706 
6707  out.append(" value: ");
6708  out.append("'").append(this->value).append("'");
6709  out.append("\n");
6710  out.append("}");
6711 }
6712 #endif
6714  switch (field_id) {
6715  case 1: {
6716  this->event_type = value.as_enum<enums::VoiceAssistantEvent>();
6717  return true;
6718  }
6719  default:
6720  return false;
6721  }
6722 }
6724  switch (field_id) {
6725  case 2: {
6726  this->data.push_back(value.as_message<VoiceAssistantEventData>());
6727  return true;
6728  }
6729  default:
6730  return false;
6731  }
6732 }
6734  buffer.encode_enum<enums::VoiceAssistantEvent>(1, this->event_type);
6735  for (auto &it : this->data) {
6736  buffer.encode_message<VoiceAssistantEventData>(2, it, true);
6737  }
6738 }
6739 #ifdef HAS_PROTO_MESSAGE_DUMP
6740 void VoiceAssistantEventResponse::dump_to(std::string &out) const {
6741  __attribute__((unused)) char buffer[64];
6742  out.append("VoiceAssistantEventResponse {\n");
6743  out.append(" event_type: ");
6744  out.append(proto_enum_to_string<enums::VoiceAssistantEvent>(this->event_type));
6745  out.append("\n");
6746 
6747  for (const auto &it : this->data) {
6748  out.append(" data: ");
6749  it.dump_to(out);
6750  out.append("\n");
6751  }
6752  out.append("}");
6753 }
6754 #endif
6756  switch (field_id) {
6757  case 6: {
6758  this->disabled_by_default = value.as_bool();
6759  return true;
6760  }
6761  case 7: {
6762  this->entity_category = value.as_enum<enums::EntityCategory>();
6763  return true;
6764  }
6765  case 8: {
6766  this->supported_features = value.as_uint32();
6767  return true;
6768  }
6769  case 9: {
6770  this->requires_code = value.as_bool();
6771  return true;
6772  }
6773  case 10: {
6774  this->requires_code_to_arm = value.as_bool();
6775  return true;
6776  }
6777  default:
6778  return false;
6779  }
6780 }
6782  switch (field_id) {
6783  case 1: {
6784  this->object_id = value.as_string();
6785  return true;
6786  }
6787  case 3: {
6788  this->name = value.as_string();
6789  return true;
6790  }
6791  case 4: {
6792  this->unique_id = value.as_string();
6793  return true;
6794  }
6795  case 5: {
6796  this->icon = value.as_string();
6797  return true;
6798  }
6799  default:
6800  return false;
6801  }
6802 }
6804  switch (field_id) {
6805  case 2: {
6806  this->key = value.as_fixed32();
6807  return true;
6808  }
6809  default:
6810  return false;
6811  }
6812 }
6814  buffer.encode_string(1, this->object_id);
6815  buffer.encode_fixed32(2, this->key);
6816  buffer.encode_string(3, this->name);
6817  buffer.encode_string(4, this->unique_id);
6818  buffer.encode_string(5, this->icon);
6819  buffer.encode_bool(6, this->disabled_by_default);
6820  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
6821  buffer.encode_uint32(8, this->supported_features);
6822  buffer.encode_bool(9, this->requires_code);
6823  buffer.encode_bool(10, this->requires_code_to_arm);
6824 }
6825 #ifdef HAS_PROTO_MESSAGE_DUMP
6827  __attribute__((unused)) char buffer[64];
6828  out.append("ListEntitiesAlarmControlPanelResponse {\n");
6829  out.append(" object_id: ");
6830  out.append("'").append(this->object_id).append("'");
6831  out.append("\n");
6832 
6833  out.append(" key: ");
6834  sprintf(buffer, "%" PRIu32, this->key);
6835  out.append(buffer);
6836  out.append("\n");
6837 
6838  out.append(" name: ");
6839  out.append("'").append(this->name).append("'");
6840  out.append("\n");
6841 
6842  out.append(" unique_id: ");
6843  out.append("'").append(this->unique_id).append("'");
6844  out.append("\n");
6845 
6846  out.append(" icon: ");
6847  out.append("'").append(this->icon).append("'");
6848  out.append("\n");
6849 
6850  out.append(" disabled_by_default: ");
6851  out.append(YESNO(this->disabled_by_default));
6852  out.append("\n");
6853 
6854  out.append(" entity_category: ");
6855  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
6856  out.append("\n");
6857 
6858  out.append(" supported_features: ");
6859  sprintf(buffer, "%" PRIu32, this->supported_features);
6860  out.append(buffer);
6861  out.append("\n");
6862 
6863  out.append(" requires_code: ");
6864  out.append(YESNO(this->requires_code));
6865  out.append("\n");
6866 
6867  out.append(" requires_code_to_arm: ");
6868  out.append(YESNO(this->requires_code_to_arm));
6869  out.append("\n");
6870  out.append("}");
6871 }
6872 #endif
6874  switch (field_id) {
6875  case 2: {
6876  this->state = value.as_enum<enums::AlarmControlPanelState>();
6877  return true;
6878  }
6879  default:
6880  return false;
6881  }
6882 }
6884  switch (field_id) {
6885  case 1: {
6886  this->key = value.as_fixed32();
6887  return true;
6888  }
6889  default:
6890  return false;
6891  }
6892 }
6894  buffer.encode_fixed32(1, this->key);
6896 }
6897 #ifdef HAS_PROTO_MESSAGE_DUMP
6898 void AlarmControlPanelStateResponse::dump_to(std::string &out) const {
6899  __attribute__((unused)) char buffer[64];
6900  out.append("AlarmControlPanelStateResponse {\n");
6901  out.append(" key: ");
6902  sprintf(buffer, "%" PRIu32, this->key);
6903  out.append(buffer);
6904  out.append("\n");
6905 
6906  out.append(" state: ");
6907  out.append(proto_enum_to_string<enums::AlarmControlPanelState>(this->state));
6908  out.append("\n");
6909  out.append("}");
6910 }
6911 #endif
6913  switch (field_id) {
6914  case 2: {
6915  this->command = value.as_enum<enums::AlarmControlPanelStateCommand>();
6916  return true;
6917  }
6918  default:
6919  return false;
6920  }
6921 }
6923  switch (field_id) {
6924  case 3: {
6925  this->code = value.as_string();
6926  return true;
6927  }
6928  default:
6929  return false;
6930  }
6931 }
6933  switch (field_id) {
6934  case 1: {
6935  this->key = value.as_fixed32();
6936  return true;
6937  }
6938  default:
6939  return false;
6940  }
6941 }
6943  buffer.encode_fixed32(1, this->key);
6944  buffer.encode_enum<enums::AlarmControlPanelStateCommand>(2, this->command);
6945  buffer.encode_string(3, this->code);
6946 }
6947 #ifdef HAS_PROTO_MESSAGE_DUMP
6948 void AlarmControlPanelCommandRequest::dump_to(std::string &out) const {
6949  __attribute__((unused)) char buffer[64];
6950  out.append("AlarmControlPanelCommandRequest {\n");
6951  out.append(" key: ");
6952  sprintf(buffer, "%" PRIu32, this->key);
6953  out.append(buffer);
6954  out.append("\n");
6955 
6956  out.append(" command: ");
6957  out.append(proto_enum_to_string<enums::AlarmControlPanelStateCommand>(this->command));
6958  out.append("\n");
6959 
6960  out.append(" code: ");
6961  out.append("'").append(this->code).append("'");
6962  out.append("\n");
6963  out.append("}");
6964 }
6965 #endif
6967  switch (field_id) {
6968  case 6: {
6969  this->disabled_by_default = value.as_bool();
6970  return true;
6971  }
6972  case 7: {
6973  this->entity_category = value.as_enum<enums::EntityCategory>();
6974  return true;
6975  }
6976  case 8: {
6977  this->min_length = value.as_uint32();
6978  return true;
6979  }
6980  case 9: {
6981  this->max_length = value.as_uint32();
6982  return true;
6983  }
6984  case 11: {
6985  this->mode = value.as_enum<enums::TextMode>();
6986  return true;
6987  }
6988  default:
6989  return false;
6990  }
6991 }
6993  switch (field_id) {
6994  case 1: {
6995  this->object_id = value.as_string();
6996  return true;
6997  }
6998  case 3: {
6999  this->name = value.as_string();
7000  return true;
7001  }
7002  case 4: {
7003  this->unique_id = value.as_string();
7004  return true;
7005  }
7006  case 5: {
7007  this->icon = value.as_string();
7008  return true;
7009  }
7010  case 10: {
7011  this->pattern = value.as_string();
7012  return true;
7013  }
7014  default:
7015  return false;
7016  }
7017 }
7018 bool ListEntitiesTextResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
7019  switch (field_id) {
7020  case 2: {
7021  this->key = value.as_fixed32();
7022  return true;
7023  }
7024  default:
7025  return false;
7026  }
7027 }
7029  buffer.encode_string(1, this->object_id);
7030  buffer.encode_fixed32(2, this->key);
7031  buffer.encode_string(3, this->name);
7032  buffer.encode_string(4, this->unique_id);
7033  buffer.encode_string(5, this->icon);
7034  buffer.encode_bool(6, this->disabled_by_default);
7035  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
7036  buffer.encode_uint32(8, this->min_length);
7037  buffer.encode_uint32(9, this->max_length);
7038  buffer.encode_string(10, this->pattern);
7039  buffer.encode_enum<enums::TextMode>(11, this->mode);
7040 }
7041 #ifdef HAS_PROTO_MESSAGE_DUMP
7042 void ListEntitiesTextResponse::dump_to(std::string &out) const {
7043  __attribute__((unused)) char buffer[64];
7044  out.append("ListEntitiesTextResponse {\n");
7045  out.append(" object_id: ");
7046  out.append("'").append(this->object_id).append("'");
7047  out.append("\n");
7048 
7049  out.append(" key: ");
7050  sprintf(buffer, "%" PRIu32, this->key);
7051  out.append(buffer);
7052  out.append("\n");
7053 
7054  out.append(" name: ");
7055  out.append("'").append(this->name).append("'");
7056  out.append("\n");
7057 
7058  out.append(" unique_id: ");
7059  out.append("'").append(this->unique_id).append("'");
7060  out.append("\n");
7061 
7062  out.append(" icon: ");
7063  out.append("'").append(this->icon).append("'");
7064  out.append("\n");
7065 
7066  out.append(" disabled_by_default: ");
7067  out.append(YESNO(this->disabled_by_default));
7068  out.append("\n");
7069 
7070  out.append(" entity_category: ");
7071  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
7072  out.append("\n");
7073 
7074  out.append(" min_length: ");
7075  sprintf(buffer, "%" PRIu32, this->min_length);
7076  out.append(buffer);
7077  out.append("\n");
7078 
7079  out.append(" max_length: ");
7080  sprintf(buffer, "%" PRIu32, this->max_length);
7081  out.append(buffer);
7082  out.append("\n");
7083 
7084  out.append(" pattern: ");
7085  out.append("'").append(this->pattern).append("'");
7086  out.append("\n");
7087 
7088  out.append(" mode: ");
7089  out.append(proto_enum_to_string<enums::TextMode>(this->mode));
7090  out.append("\n");
7091  out.append("}");
7092 }
7093 #endif
7094 bool TextStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
7095  switch (field_id) {
7096  case 3: {
7097  this->missing_state = value.as_bool();
7098  return true;
7099  }
7100  default:
7101  return false;
7102  }
7103 }
7105  switch (field_id) {
7106  case 2: {
7107  this->state = value.as_string();
7108  return true;
7109  }
7110  default:
7111  return false;
7112  }
7113 }
7114 bool TextStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
7115  switch (field_id) {
7116  case 1: {
7117  this->key = value.as_fixed32();
7118  return true;
7119  }
7120  default:
7121  return false;
7122  }
7123 }
7125  buffer.encode_fixed32(1, this->key);
7126  buffer.encode_string(2, this->state);
7127  buffer.encode_bool(3, this->missing_state);
7128 }
7129 #ifdef HAS_PROTO_MESSAGE_DUMP
7130 void TextStateResponse::dump_to(std::string &out) const {
7131  __attribute__((unused)) char buffer[64];
7132  out.append("TextStateResponse {\n");
7133  out.append(" key: ");
7134  sprintf(buffer, "%" PRIu32, this->key);
7135  out.append(buffer);
7136  out.append("\n");
7137 
7138  out.append(" state: ");
7139  out.append("'").append(this->state).append("'");
7140  out.append("\n");
7141 
7142  out.append(" missing_state: ");
7143  out.append(YESNO(this->missing_state));
7144  out.append("\n");
7145  out.append("}");
7146 }
7147 #endif
7149  switch (field_id) {
7150  case 2: {
7151  this->state = value.as_string();
7152  return true;
7153  }
7154  default:
7155  return false;
7156  }
7157 }
7158 bool TextCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
7159  switch (field_id) {
7160  case 1: {
7161  this->key = value.as_fixed32();
7162  return true;
7163  }
7164  default:
7165  return false;
7166  }
7167 }
7169  buffer.encode_fixed32(1, this->key);
7170  buffer.encode_string(2, this->state);
7171 }
7172 #ifdef HAS_PROTO_MESSAGE_DUMP
7173 void TextCommandRequest::dump_to(std::string &out) const {
7174  __attribute__((unused)) char buffer[64];
7175  out.append("TextCommandRequest {\n");
7176  out.append(" key: ");
7177  sprintf(buffer, "%" PRIu32, this->key);
7178  out.append(buffer);
7179  out.append("\n");
7180 
7181  out.append(" state: ");
7182  out.append("'").append(this->state).append("'");
7183  out.append("\n");
7184  out.append("}");
7185 }
7186 #endif
7188  switch (field_id) {
7189  case 6: {
7190  this->disabled_by_default = value.as_bool();
7191  return true;
7192  }
7193  case 7: {
7194  this->entity_category = value.as_enum<enums::EntityCategory>();
7195  return true;
7196  }
7197  default:
7198  return false;
7199  }
7200 }
7202  switch (field_id) {
7203  case 1: {
7204  this->object_id = value.as_string();
7205  return true;
7206  }
7207  case 3: {
7208  this->name = value.as_string();
7209  return true;
7210  }
7211  case 4: {
7212  this->unique_id = value.as_string();
7213  return true;
7214  }
7215  case 5: {
7216  this->icon = value.as_string();
7217  return true;
7218  }
7219  default:
7220  return false;
7221  }
7222 }
7223 bool ListEntitiesDateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
7224  switch (field_id) {
7225  case 2: {
7226  this->key = value.as_fixed32();
7227  return true;
7228  }
7229  default:
7230  return false;
7231  }
7232 }
7234  buffer.encode_string(1, this->object_id);
7235  buffer.encode_fixed32(2, this->key);
7236  buffer.encode_string(3, this->name);
7237  buffer.encode_string(4, this->unique_id);
7238  buffer.encode_string(5, this->icon);
7239  buffer.encode_bool(6, this->disabled_by_default);
7240  buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
7241 }
7242 #ifdef HAS_PROTO_MESSAGE_DUMP
7243 void ListEntitiesDateResponse::dump_to(std::string &out) const {
7244  __attribute__((unused)) char buffer[64];
7245  out.append("ListEntitiesDateResponse {\n");
7246  out.append(" object_id: ");
7247  out.append("'").append(this->object_id).append("'");
7248  out.append("\n");
7249 
7250  out.append(" key: ");
7251  sprintf(buffer, "%" PRIu32, this->key);
7252  out.append(buffer);
7253  out.append("\n");
7254 
7255  out.append(" name: ");
7256  out.append("'").append(this->name).append("'");
7257  out.append("\n");
7258 
7259  out.append(" unique_id: ");
7260  out.append("'").append(this->unique_id).append("'");
7261  out.append("\n");
7262 
7263  out.append(" icon: ");
7264  out.append("'").append(this->icon).append("'");
7265  out.append("\n");
7266 
7267  out.append(" disabled_by_default: ");
7268  out.append(YESNO(this->disabled_by_default));
7269  out.append("\n");
7270 
7271  out.append(" entity_category: ");
7272  out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
7273  out.append("\n");
7274  out.append("}");
7275 }
7276 #endif
7277 bool DateStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
7278  switch (field_id) {
7279  case 2: {
7280  this->missing_state = value.as_bool();
7281  return true;
7282  }
7283  case 3: {
7284  this->year = value.as_uint32();
7285  return true;
7286  }
7287  case 4: {
7288  this->month = value.as_uint32();
7289  return true;
7290  }
7291  case 5: {
7292  this->day = value.as_uint32();
7293  return true;
7294  }
7295  default:
7296  return false;
7297  }
7298 }
7299 bool DateStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
7300  switch (field_id) {
7301  case 1: {
7302  this->key = value.as_fixed32();
7303  return true;
7304  }
7305  default:
7306  return false;
7307  }
7308 }
7310  buffer.encode_fixed32(1, this->key);
7311  buffer.encode_bool(2, this->missing_state);
7312  buffer.encode_uint32(3, this->year);
7313  buffer.encode_uint32(4, this->month);
7314  buffer.encode_uint32(5, this->day);
7315 }
7316 #ifdef HAS_PROTO_MESSAGE_DUMP
7317 void DateStateResponse::dump_to(std::string &out) const {
7318  __attribute__((unused)) char buffer[64];
7319  out.append("DateStateResponse {\n");
7320  out.append(" key: ");
7321  sprintf(buffer, "%" PRIu32, this->key);
7322  out.append(buffer);
7323  out.append("\n");
7324 
7325  out.append(" missing_state: ");
7326  out.append(YESNO(this->missing_state));
7327  out.append("\n");
7328 
7329  out.append(" year: ");
7330  sprintf(buffer, "%" PRIu32, this->year);
7331  out.append(buffer);
7332  out.append("\n");
7333 
7334  out.append(" month: ");
7335  sprintf(buffer, "%" PRIu32, this->month);
7336  out.append(buffer);
7337  out.append("\n");
7338 
7339  out.append(" day: ");
7340  sprintf(buffer, "%" PRIu32, this->day);
7341  out.append(buffer);
7342  out.append("\n");
7343  out.append("}");
7344 }
7345 #endif
7346 bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
7347  switch (field_id) {
7348  case 2: {
7349  this->year = value.as_uint32();
7350  return true;
7351  }
7352  case 3: {
7353  this->month = value.as_uint32();
7354  return true;
7355  }
7356  case 4: {
7357  this->day = value.as_uint32();
7358  return true;
7359  }
7360  default:
7361  return false;
7362  }
7363 }
7364 bool DateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
7365  switch (field_id) {
7366  case 1: {
7367  this->key = value.as_fixed32();
7368  return true;
7369  }
7370  default:
7371  return false;
7372  }
7373 }
7375  buffer.encode_fixed32(1, this->key);
7376  buffer.encode_uint32(2, this->year);
7377  buffer.encode_uint32(3, this->month);
7378  buffer.encode_uint32(4, this->day);
7379 }
7380 #ifdef HAS_PROTO_MESSAGE_DUMP
7381 void DateCommandRequest::dump_to(std::string &out) const {
7382  __attribute__((unused)) char buffer[64];
7383  out.append("DateCommandRequest {\n");
7384  out.append(" key: ");
7385  sprintf(buffer, "%" PRIu32, this->key);
7386  out.append(buffer);
7387  out.append("\n");
7388 
7389  out.append(" year: ");
7390  sprintf(buffer, "%" PRIu32, this->year);
7391  out.append(buffer);
7392  out.append("\n");
7393 
7394  out.append(" month: ");
7395  sprintf(buffer, "%" PRIu32, this->month);
7396  out.append(buffer);
7397  out.append("\n");
7398 
7399  out.append(" day: ");
7400  sprintf(buffer, "%" PRIu32, this->day);
7401  out.append(buffer);
7402  out.append("\n");
7403  out.append("}");
7404 }
7405 #endif
7406 
7407 } // namespace api
7408 } // namespace esphome
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:1098
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3041
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5247
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:1279
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6462
void encode_fixed32(uint32_t field_id, uint32_t value, bool force=false)
Definition: proto.h:189
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:4513
float target_temperature_low
Definition: climate.h:585
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4440
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:4821
const char * name
Definition: stm32flash.h:78
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2692
uint16_t year
Definition: date_entity.h:108
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:998
int32_t as_sint32() const
Definition: proto.h:58
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6107
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5972
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5178
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6049
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6400
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:1506
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4638
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5552
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:665
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5851
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:1199
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:6803
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:7299
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5633
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:682
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3893
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:7148
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5942
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5818
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6175
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6873
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:1386
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:7104
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:7201
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:2624
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:4612
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:678
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4963
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:1561
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4484
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5756
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4339
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:5233
Representation of a VarInt - in ProtoBuf should be 64bit but we only use 32bit.
Definition: proto.h:17
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:1235
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:7042
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6948
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5735
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4841
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:1631
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3260
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:6992
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2864
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2673
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:7223
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:984
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:6883
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5368
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3505
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:7158
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:7317
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6327
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4446
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:690
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:868
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2821
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:7364
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6562
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:3495
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:1088
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:1113
void encode_float(uint32_t field_id, float value, bool force=false)
Definition: proto.h:216
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6648
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3461
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:6546
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3451
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4831
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:6189
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:2111
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:4695
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:694
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6893
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:872
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5841
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2031
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4115
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6394
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2157
std::string as_string() const
Definition: proto.h:98
int speed
Definition: fan.h:35
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4549
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:7114
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2962
void encode_uint64(uint32_t field_id, uint64_t value, bool force=false)
Definition: proto.h:177
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5861
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2907
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:942
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2506
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4681
float tilt
Definition: cover.h:15
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6068
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6826
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:4923
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3308
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3635
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:4499
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6249
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:611
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:2524
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:1330
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6230
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:3372
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5574
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:6009
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6582
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4426
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:2732
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6132
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:1290
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4973
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4771
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3182
float target_temperature_high
Definition: climate.h:586
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:676
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:3196
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5868
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:7309
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5302
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5894
float as_float() const
Definition: proto.h:115
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:4416
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:1261
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:726
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:791
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:2801
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:541
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:6596
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3525
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3154
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6622
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2791
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6361
float target_humidity
Definition: climate.h:589
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6308
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6813
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:4101
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6700
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6523
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6912
ClimateSwingMode swing_mode
Definition: climate.h:581
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5466
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3699
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6019
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5306
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:634
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5898
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2398
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5094
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:646
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:3549
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3214
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5808
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2877
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6556
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5927
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3134
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6662
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:692
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6713
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3120
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6464
void encode_sint32(uint32_t field_id, int32_t value, bool force=false)
Definition: proto.h:238
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:1032
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:557
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3077
int32_t as_int32() const
Definition: proto.h:50
uint32_t as_fixed32() const
Definition: proto.h:113
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6511
uint8_t day
Definition: date_entity.h:110
FanDirection direction
Definition: fan.h:37
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5922
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:7168
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2678
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:4656
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5956
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2457
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5062
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:7173
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3095
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:1611
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6342
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4167
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:864
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4676
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:688
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:4269
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:1396
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:1014
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5908
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6156
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4465
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:5022
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5424
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3045
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3206
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3064
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:2550
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5292
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:2663
uint64_t as_uint64() const
Definition: proto.h:47
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4666
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:527
uint8_t custom_preset
Definition: climate.h:579
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6356
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:4874
void encode_bool(uint32_t field_id, bool value, bool force=false)
Definition: proto.h:183
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3389
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:7124
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6264
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:7233
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3563
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3039
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4894
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:644
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5484
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2944
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:876
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4562
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3382
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5535
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:3515
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6437
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3164
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6376
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3288
BedjetMode mode
BedJet operating mode.
Definition: bedjet_codec.h:151
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:2372
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:874
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5340
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6667
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:7277
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4539
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6966
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2753
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5700
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6224
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:1062
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4747
uint8_t type
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2926
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:772
void encode_uint32(uint32_t field_id, uint32_t value, bool force=false)
Definition: proto.h:171
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6755
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6733
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:1526
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:6723
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5386
void encode_int32(uint32_t field_id, int32_t value, bool force=false)
Definition: proto.h:227
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:604
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:7187
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5143
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5784
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:2811
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6486
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:1892
enum esphome::EntityCategory __attribute__
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:1207
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2572
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3059
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2487
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:1181
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5657
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5501
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5326
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:2101
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2639
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5541
const uint32_t flags
Definition: stm32flash.h:85
uint8_t options
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:590
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6419
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5717
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:6922
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2949
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:7018
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:7346
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6205
ClimateFanMode fan_mode
Definition: climate.h:573
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2312
bool as_bool() const
Definition: proto.h:48
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4622
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:1516
std::string client_info
Definition: api_pb2.h:220
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6740
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3941
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3008
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:1008
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:4287
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6521
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:684
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:1360
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:1902
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4479
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:3441
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4884
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6150
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:2930
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:4031
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5032
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:1413
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:576
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:1740
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3101
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2560
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5494
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:870
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6468
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:3122
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6532
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:7381
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5581
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6898
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3419
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:4602
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2924
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2901
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:3665
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2994
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6199
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5604
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5171
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5105
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4141
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2481
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3739
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:1167
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5525
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:1948
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6282
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5223
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4901
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:1496
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3531
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:4937
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:4317
bool oscillating
Definition: fan.h:36
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:3274
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:866
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5667
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:5798
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5669
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:2342
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6113
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6063
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2653
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:686
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6322
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4632
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:4860
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:4757
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3118
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5257
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5626
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:3581
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:6097
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2845
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:1964
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6695
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:3863
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:667
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:696
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5044
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:2972
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6492
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6288
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5348
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5745
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5408
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6026
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:3144
uint8_t preset_mode
Definition: fan.h:38
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:3405
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5693
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:6681
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:1470
float position
Definition: cover.h:14
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:3362
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2187
void encode_string(uint32_t field_id, const char *string, size_t len, bool force=false)
Definition: proto.h:156
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:1784
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6226
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:2827
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2859
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:680
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:551
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:3907
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:6781
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4984
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:5966
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5991
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5679
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:7374
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4355
uint32_t as_uint32() const
Definition: proto.h:46
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6244
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:1647
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:1706
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:1806
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5884
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:7028
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:7243
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:5157
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3959
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2382
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:920
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:1766
uint8_t custom_fan_mode
Definition: climate.h:574
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6942
float target_temperature
Definition: climate.h:583
void encode_enum(uint32_t field_id, T value, bool force=false)
Definition: proto.h:213
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5316
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:3234
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:930
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:6614
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:4846
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:2891
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:6083
uint8_t month
Definition: date_entity.h:109
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:2467
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:2706
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:655
ClimatePreset preset
Definition: climate.h:578
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2742
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:1878
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3169
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:3132
void encode_message(uint32_t field_id, const C &value, bool force=false)
Definition: proto.h:256
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:4721
bool state
Definition: fan.h:34
void encode(ProtoWriteBuffer buffer) const override
Definition: api_pb2.cpp:2634
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:7094
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:7130
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:5034
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:1621
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition: api_pb2.cpp:6932
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:6443
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:5201
void dump_to(std::string &out) const override
Definition: api_pb2.cpp:3568
bool decode_varint(uint32_t field_id, ProtoVarInt value) override
Definition: api_pb2.cpp:2614
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition: api_pb2.cpp:894