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