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