ESPHome 2026.10.0-dev
Loading...
Searching...
No Matches
api_pb2.cpp
Go to the documentation of this file.
1// This file was automatically generated with a tool.
2// See script/api_protobuf/api_protobuf.py
3#include "api_pb2.h"
4#include "esphome/core/log.h"
6#include <cstring>
7
8namespace esphome::api {
9
11 switch (field_id) {
12 case 2:
13 this->api_version_major = value;
14 break;
15 case 3:
16 this->api_version_minor = value;
17 break;
18 default:
19 return false;
20 }
21 return true;
22}
24 switch (field_id) {
25 case 1: {
26 this->client_info = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
27 break;
28 }
29 default:
30 return false;
31 }
32 return true;
33}
34uint8_t *HelloResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
35 uint8_t *__restrict__ pos = buffer.get_pos();
36 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->api_version_major);
37 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->api_version_minor);
38 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->server_info);
39 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 34, this->name);
40 return pos;
41}
43 uint32_t size = 0;
46 size += 2 + this->server_info.size();
47 size += 2 + this->name.size();
48 return size;
49}
51 switch (field_id) {
52 case 1:
53 this->reason = static_cast<enums::DisconnectReason>(value);
54 break;
55 default:
56 return false;
57 }
58 return true;
59}
60uint8_t *DisconnectRequest::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
61 uint8_t *__restrict__ pos = buffer.get_pos();
62 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, static_cast<uint32_t>(this->reason));
63 return pos;
64}
66 uint32_t size = 0;
67 size += this->reason ? 2 : 0;
68 return size;
69}
70#ifdef USE_AREAS
71uint8_t *AreaInfo::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
72 uint8_t *__restrict__ pos = buffer.get_pos();
73 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->area_id);
74 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 18, this->name);
75 return pos;
76}
78 uint32_t size = 0;
79 size += ProtoSize::calc_uint32(1, this->area_id);
80 size += 2 + this->name.size();
81 return size;
82}
83#endif
84#ifdef USE_DEVICES
85uint8_t *DeviceInfo::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
86 uint8_t *__restrict__ pos = buffer.get_pos();
87 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->device_id);
88 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 18, this->name);
89 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->area_id);
90 return pos;
91}
93 uint32_t size = 0;
94 size += ProtoSize::calc_uint32(1, this->device_id);
95 size += 2 + this->name.size();
96 size += ProtoSize::calc_uint32(1, this->area_id);
97 return size;
98}
99#endif
100#ifdef USE_SERIAL_PROXY
101uint8_t *SerialProxyInfo::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
102 uint8_t *__restrict__ pos = buffer.get_pos();
103 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->name);
104 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->port_type));
105 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->configured_line_states);
106 return pos;
107}
109 uint32_t size = 0;
110 size += ProtoSize::calc_length(1, this->name.size());
111 size += this->port_type ? 2 : 0;
113 return size;
114}
115#endif
116uint8_t *DeviceInfoResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
117 uint8_t *__restrict__ pos = buffer.get_pos();
118 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 18, this->name);
119 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->mac_address);
120 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 34, this->esphome_version);
121 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 42, this->compilation_time);
122 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 50, this->model);
123#ifdef USE_DEEP_SLEEP
124 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 7, this->has_deep_sleep);
125#endif
126#ifdef ESPHOME_PROJECT_NAME
127 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 66, this->project_name);
128#endif
129#ifdef ESPHOME_PROJECT_NAME
130 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 74, this->project_version);
131#endif
132#ifdef USE_WEBSERVER
133 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, this->webserver_port);
134#endif
135#ifdef USE_BLUETOOTH_PROXY
136 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 15, this->bluetooth_proxy_feature_flags);
137#endif
138 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 98, this->manufacturer);
139 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 106, this->friendly_name);
140#ifdef USE_VOICE_ASSISTANT
141 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 17, this->voice_assistant_feature_flags);
142#endif
143#ifdef USE_AREAS
144 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 16, this->suggested_area, true);
145#endif
146#ifdef USE_BLUETOOTH_PROXY
147 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 18, this->bluetooth_mac_address, true);
148#endif
149#ifdef USE_API_NOISE
150 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 19, this->api_encryption_supported);
151#endif
152#ifdef USE_DEVICES
153 for (const auto &it : this->devices) {
154 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 20, it);
155 }
156#endif
157#ifdef USE_AREAS
158 for (const auto &it : this->areas) {
159 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 21, it);
160 }
161#endif
162#ifdef USE_AREAS
163 ProtoEncode::encode_optional_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 22, this->area);
164#endif
165#ifdef USE_ZWAVE_PROXY
166 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 23, this->zwave_proxy_feature_flags);
167#endif
168#ifdef USE_ZWAVE_PROXY
169 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 24, this->zwave_home_id);
170#endif
171#ifdef USE_SERIAL_PROXY
172 for (const auto &it : this->serial_proxies) {
173 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 25, it);
174 }
175#endif
176#ifdef USE_API_NOISE
177 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 26, this->api_encryption_provisionable);
178#endif
179 return pos;
180}
182 uint32_t size = 0;
183 size += 2 + this->name.size();
184 size += 2 + this->mac_address.size();
185 size += 2 + this->esphome_version.size();
186 size += 2 + this->compilation_time.size();
187 size += 2 + this->model.size();
188#ifdef USE_DEEP_SLEEP
189 size += ProtoSize::calc_bool(1, this->has_deep_sleep);
190#endif
191#ifdef ESPHOME_PROJECT_NAME
192 size += 2 + this->project_name.size();
193#endif
194#ifdef ESPHOME_PROJECT_NAME
195 size += 2 + this->project_version.size();
196#endif
197#ifdef USE_WEBSERVER
198 size += ProtoSize::calc_uint32(1, this->webserver_port);
199#endif
200#ifdef USE_BLUETOOTH_PROXY
202#endif
203 size += 2 + this->manufacturer.size();
204 size += 2 + this->friendly_name.size();
205#ifdef USE_VOICE_ASSISTANT
207#endif
208#ifdef USE_AREAS
209 size += 3 + this->suggested_area.size();
210#endif
211#ifdef USE_BLUETOOTH_PROXY
212 size += 3 + this->bluetooth_mac_address.size();
213#endif
214#ifdef USE_API_NOISE
216#endif
217#ifdef USE_DEVICES
218 for (const auto &it : this->devices) {
219 size += ProtoSize::calc_message_force(2, it.calculate_size());
220 }
221#endif
222#ifdef USE_AREAS
223 for (const auto &it : this->areas) {
224 size += ProtoSize::calc_message_force(2, it.calculate_size());
225 }
226#endif
227#ifdef USE_AREAS
229#endif
230#ifdef USE_ZWAVE_PROXY
232#endif
233#ifdef USE_ZWAVE_PROXY
234 size += ProtoSize::calc_uint32(2, this->zwave_home_id);
235#endif
236#ifdef USE_SERIAL_PROXY
237 for (const auto &it : this->serial_proxies) {
238 size += ProtoSize::calc_message_force(2, it.calculate_size());
239 }
240#endif
241#ifdef USE_API_NOISE
243#endif
244 return size;
245}
246#ifdef USE_BLUETOOTH_PROXY
247uint8_t *BluetoothProxyCapabilities::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
248 uint8_t *__restrict__ pos = buffer.get_pos();
249 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->feature_flags);
250 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 18, this->mac_address);
251 return pos;
252}
254 uint32_t size = 0;
255 size += ProtoSize::calc_uint32(1, this->feature_flags);
256 size += 2 + this->mac_address.size();
257 return size;
258}
259#endif
260#ifdef USE_VOICE_ASSISTANT
261uint8_t *VoiceAssistantCapabilities::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
262 uint8_t *__restrict__ pos = buffer.get_pos();
263 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->feature_flags);
264 return pos;
265}
271#endif
272#ifdef USE_ZWAVE_PROXY
273uint8_t *ZWaveProxyCapabilities::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
274 uint8_t *__restrict__ pos = buffer.get_pos();
275 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->feature_flags);
276 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->home_id);
277 return pos;
278}
280 uint32_t size = 0;
281 size += ProtoSize::calc_uint32(1, this->feature_flags);
282 size += ProtoSize::calc_uint32(1, this->home_id);
283 return size;
284}
285#endif
286uint8_t *DeviceCapabilitiesResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
287 uint8_t *__restrict__ pos = buffer.get_pos();
288#ifdef USE_BLUETOOTH_PROXY
289 ProtoEncode::encode_optional_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 1, this->bluetooth_proxy);
290#endif
291#ifdef USE_VOICE_ASSISTANT
292 ProtoEncode::encode_optional_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 2, this->voice_assistant);
293#endif
294#ifdef USE_ZWAVE_PROXY
295 ProtoEncode::encode_optional_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 3, this->zwave_proxy);
296#endif
297#ifdef USE_SERIAL_PROXY
298 for (const auto &it : this->serial_proxies) {
299 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 4, it);
300 }
301#endif
302 return pos;
303}
305 uint32_t size = 0;
306#ifdef USE_BLUETOOTH_PROXY
308#endif
309#ifdef USE_VOICE_ASSISTANT
311#endif
312#ifdef USE_ZWAVE_PROXY
314#endif
315#ifdef USE_SERIAL_PROXY
316 for (const auto &it : this->serial_proxies) {
317 size += ProtoSize::calc_message_force(1, it.calculate_size());
318 }
319#endif
320 return size;
321}
322#ifdef USE_BINARY_SENSOR
323uint8_t *ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
324 uint8_t *__restrict__ pos = buffer.get_pos();
325 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
326 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
327 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
328 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->device_class);
329 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->is_status_binary_sensor);
330 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 7, this->disabled_by_default);
331#ifdef USE_ENTITY_ICON
332 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->icon);
333#endif
334 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, static_cast<uint32_t>(this->entity_category));
335#ifdef USE_DEVICES
336 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, this->device_id);
337#endif
338 return pos;
339}
341 uint32_t size = 0;
342 size += 2 + this->object_id.size();
343 size += 5;
344 size += 2 + this->name.size();
345 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
348#ifdef USE_ENTITY_ICON
349 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
350#endif
351 size += this->entity_category ? 2 : 0;
352#ifdef USE_DEVICES
353 size += ProtoSize::calc_uint32(1, this->device_id);
354#endif
355 return size;
356}
357uint8_t *BinarySensorStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
358 uint8_t *__restrict__ pos = buffer.get_pos();
359 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
360 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
361 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->missing_state);
362#ifdef USE_DEVICES
363 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
364#endif
365 return pos;
366}
368 uint32_t size = 0;
369 size += 5;
370 size += ProtoSize::calc_bool(1, this->state);
371 size += ProtoSize::calc_bool(1, this->missing_state);
372#ifdef USE_DEVICES
373 size += ProtoSize::calc_uint32(1, this->device_id);
374#endif
375 return size;
376}
377#endif
378#ifdef USE_COVER
379uint8_t *ListEntitiesCoverResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
380 uint8_t *__restrict__ pos = buffer.get_pos();
381 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
382 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
383 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
384 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->assumed_state);
385 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->supports_position);
386 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 7, this->supports_tilt);
387 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
388 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->disabled_by_default);
389#ifdef USE_ENTITY_ICON
390 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 10, this->icon);
391#endif
392 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, static_cast<uint32_t>(this->entity_category));
393 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 12, this->supports_stop);
394#ifdef USE_DEVICES
395 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->device_id);
396#endif
397 return pos;
398}
400 uint32_t size = 0;
401 size += 2 + this->object_id.size();
402 size += 5;
403 size += 2 + this->name.size();
404 size += ProtoSize::calc_bool(1, this->assumed_state);
405 size += ProtoSize::calc_bool(1, this->supports_position);
406 size += ProtoSize::calc_bool(1, this->supports_tilt);
407 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
409#ifdef USE_ENTITY_ICON
410 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
411#endif
412 size += this->entity_category ? 2 : 0;
413 size += ProtoSize::calc_bool(1, this->supports_stop);
414#ifdef USE_DEVICES
415 size += ProtoSize::calc_uint32(1, this->device_id);
416#endif
417 return size;
418}
419uint8_t *CoverStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
420 uint8_t *__restrict__ pos = buffer.get_pos();
421 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
422 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->position);
423 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 4, this->tilt);
424 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, static_cast<uint32_t>(this->current_operation));
425#ifdef USE_DEVICES
426 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, this->device_id);
427#endif
428 return pos;
429}
431 uint32_t size = 0;
432 size += 5;
434 size += ProtoSize::calc_float(1, this->tilt);
435 size += this->current_operation ? 2 : 0;
436#ifdef USE_DEVICES
437 size += ProtoSize::calc_uint32(1, this->device_id);
438#endif
439 return size;
440}
442 switch (field_id) {
443 case 4:
444 this->has_position = value != 0;
445 break;
446 case 6:
447 this->has_tilt = value != 0;
448 break;
449 case 8:
450 this->stop = value != 0;
451 break;
452#ifdef USE_DEVICES
453 case 9:
454 this->device_id = value;
455 break;
456#endif
457 default:
458 return false;
459 }
460 return true;
461}
463 switch (field_id) {
464 case 1:
465 this->key = value.as_fixed32();
466 break;
467 case 5:
468 this->position = value.as_float();
469 break;
470 case 7:
471 this->tilt = value.as_float();
472 break;
473 default:
474 return false;
475 }
476 return true;
477}
478#endif
479#ifdef USE_FAN
480uint8_t *ListEntitiesFanResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
481 uint8_t *__restrict__ pos = buffer.get_pos();
482 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
483 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
484 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
485 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->supports_oscillation);
486 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->supports_speed);
487 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 7, this->supports_direction);
488 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->supported_speed_count);
489 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->disabled_by_default);
490#ifdef USE_ENTITY_ICON
491 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 10, this->icon);
492#endif
493 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, static_cast<uint32_t>(this->entity_category));
494 for (const char *it : *this->supported_preset_modes) {
495 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 12, it, strlen(it), true);
496 }
497#ifdef USE_DEVICES
498 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->device_id);
499#endif
500 return pos;
501}
503 uint32_t size = 0;
504 size += 2 + this->object_id.size();
505 size += 5;
506 size += 2 + this->name.size();
508 size += ProtoSize::calc_bool(1, this->supports_speed);
512#ifdef USE_ENTITY_ICON
513 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
514#endif
515 size += this->entity_category ? 2 : 0;
516 if (!this->supported_preset_modes->empty()) {
517 for (const char *it : *this->supported_preset_modes) {
518 size += ProtoSize::calc_length_force(1, strlen(it));
519 }
520 }
521#ifdef USE_DEVICES
523#endif
524 return size;
525}
526uint8_t *FanStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
527 uint8_t *__restrict__ pos = buffer.get_pos();
528 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
529 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
530 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->oscillating);
531 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, static_cast<uint32_t>(this->direction));
532 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 6, this->speed_level);
533 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 7, this->preset_mode);
534#ifdef USE_DEVICES
535 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_id);
536#endif
537 return pos;
538}
540 uint32_t size = 0;
541 size += 5;
542 size += ProtoSize::calc_bool(1, this->state);
543 size += ProtoSize::calc_bool(1, this->oscillating);
544 size += this->direction ? 2 : 0;
545 size += ProtoSize::calc_int32(1, this->speed_level);
546 size += ProtoSize::calc_length(1, this->preset_mode.size());
547#ifdef USE_DEVICES
548 size += ProtoSize::calc_uint32(1, this->device_id);
549#endif
550 return size;
551}
553 switch (field_id) {
554 case 2:
555 this->has_state = value != 0;
556 break;
557 case 3:
558 this->state = value != 0;
559 break;
560 case 6:
561 this->has_oscillating = value != 0;
562 break;
563 case 7:
564 this->oscillating = value != 0;
565 break;
566 case 8:
567 this->has_direction = value != 0;
568 break;
569 case 9:
570 this->direction = static_cast<enums::FanDirection>(value);
571 break;
572 case 10:
573 this->has_speed_level = value != 0;
574 break;
575 case 11:
576 this->speed_level = static_cast<int32_t>(value);
577 break;
578 case 12:
579 this->has_preset_mode = value != 0;
580 break;
581#ifdef USE_DEVICES
582 case 14:
583 this->device_id = value;
584 break;
585#endif
586 default:
587 return false;
588 }
589 return true;
590}
592 switch (field_id) {
593 case 13: {
594 this->preset_mode = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
595 break;
596 }
597 default:
598 return false;
599 }
600 return true;
601}
603 switch (field_id) {
604 case 1:
605 this->key = value.as_fixed32();
606 break;
607 default:
608 return false;
609 }
610 return true;
611}
612#endif
613#ifdef USE_LIGHT
614uint8_t *ListEntitiesLightResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
615 uint8_t *__restrict__ pos = buffer.get_pos();
616 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
617 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
618 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
619 for (const auto &it : *this->supported_color_modes) {
620 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, static_cast<uint32_t>(it), true);
621 }
622 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 9, this->min_mireds);
623 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 10, this->max_mireds);
624 for (const char *it : *this->effects) {
625 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 11, it, strlen(it), true);
626 }
627 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 13, this->disabled_by_default);
628#ifdef USE_ENTITY_ICON
629 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 14, this->icon);
630#endif
631 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 15, static_cast<uint32_t>(this->entity_category));
632#ifdef USE_DEVICES
633 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 16, this->device_id);
634#endif
635 return pos;
636}
638 uint32_t size = 0;
639 size += 2 + this->object_id.size();
640 size += 5;
641 size += 2 + this->name.size();
642 if (!this->supported_color_modes->empty()) {
643 size += this->supported_color_modes->size() * 2;
644 }
645 size += ProtoSize::calc_float(1, this->min_mireds);
646 size += ProtoSize::calc_float(1, this->max_mireds);
647 if (!this->effects->empty()) {
648 for (const char *it : *this->effects) {
649 size += ProtoSize::calc_length_force(1, strlen(it));
650 }
651 }
653#ifdef USE_ENTITY_ICON
654 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
655#endif
656 size += this->entity_category ? 2 : 0;
657#ifdef USE_DEVICES
658 size += ProtoSize::calc_uint32(2, this->device_id);
659#endif
660 return size;
661}
662uint8_t *LightStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
663 uint8_t *__restrict__ pos = buffer.get_pos();
664 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
665 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
666 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->brightness);
667 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, static_cast<uint32_t>(this->color_mode));
668 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 10, this->color_brightness);
669 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 4, this->red);
670 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 5, this->green);
671 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 6, this->blue);
672 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 7, this->white);
673 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 8, this->color_temperature);
674 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 12, this->cold_white);
675 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 13, this->warm_white);
676 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 9, this->effect);
677#ifdef USE_DEVICES
678 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 14, this->device_id);
679#endif
680 return pos;
681}
683 uint32_t size = 0;
684 size += 5;
685 size += ProtoSize::calc_bool(1, this->state);
686 size += ProtoSize::calc_float(1, this->brightness);
687 size += this->color_mode ? 2 : 0;
688 size += ProtoSize::calc_float(1, this->color_brightness);
689 size += ProtoSize::calc_float(1, this->red);
690 size += ProtoSize::calc_float(1, this->green);
691 size += ProtoSize::calc_float(1, this->blue);
692 size += ProtoSize::calc_float(1, this->white);
694 size += ProtoSize::calc_float(1, this->cold_white);
695 size += ProtoSize::calc_float(1, this->warm_white);
696 size += ProtoSize::calc_length(1, this->effect.size());
697#ifdef USE_DEVICES
698 size += ProtoSize::calc_uint32(1, this->device_id);
699#endif
700 return size;
701}
703 switch (field_id) {
704 case 2:
705 this->has_state = value != 0;
706 break;
707 case 3:
708 this->state = value != 0;
709 break;
710 case 4:
711 this->has_brightness = value != 0;
712 break;
713 case 22:
714 this->has_color_mode = value != 0;
715 break;
716 case 23:
717 this->color_mode = static_cast<enums::ColorMode>(value);
718 break;
719 case 20:
720 this->has_color_brightness = value != 0;
721 break;
722 case 6:
723 this->has_rgb = value != 0;
724 break;
725 case 10:
726 this->has_white = value != 0;
727 break;
728 case 12:
729 this->has_color_temperature = value != 0;
730 break;
731 case 24:
732 this->has_cold_white = value != 0;
733 break;
734 case 26:
735 this->has_warm_white = value != 0;
736 break;
737 case 14:
738 this->has_transition_length = value != 0;
739 break;
740 case 15:
741 this->transition_length = value;
742 break;
743 case 16:
744 this->has_flash_length = value != 0;
745 break;
746 case 17:
747 this->flash_length = value;
748 break;
749 case 18:
750 this->has_effect = value != 0;
751 break;
752#ifdef USE_DEVICES
753 case 28:
754 this->device_id = value;
755 break;
756#endif
757 default:
758 return false;
759 }
760 return true;
761}
763 switch (field_id) {
764 case 19: {
765 this->effect = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
766 break;
767 }
768 default:
769 return false;
770 }
771 return true;
772}
774 switch (field_id) {
775 case 1:
776 this->key = value.as_fixed32();
777 break;
778 case 5:
779 this->brightness = value.as_float();
780 break;
781 case 21:
782 this->color_brightness = value.as_float();
783 break;
784 case 7:
785 this->red = value.as_float();
786 break;
787 case 8:
788 this->green = value.as_float();
789 break;
790 case 9:
791 this->blue = value.as_float();
792 break;
793 case 11:
794 this->white = value.as_float();
795 break;
796 case 13:
797 this->color_temperature = value.as_float();
798 break;
799 case 25:
800 this->cold_white = value.as_float();
801 break;
802 case 27:
803 this->warm_white = value.as_float();
804 break;
805 default:
806 return false;
807 }
808 return true;
809}
810#endif
811#ifdef USE_SENSOR
812uint8_t *ListEntitiesSensorResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
813 uint8_t *__restrict__ pos = buffer.get_pos();
814 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
815 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
816 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
817#ifdef USE_ENTITY_ICON
818 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
819#endif
820 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 6, this->unit_of_measurement);
821 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 7, this->accuracy_decimals);
822 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 8, this->force_update);
823 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 9, this->device_class);
824 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, static_cast<uint32_t>(this->state_class));
825 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 12, this->disabled_by_default);
826 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 13, static_cast<uint32_t>(this->entity_category));
827#ifdef USE_DEVICES
828 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 14, this->device_id);
829#endif
830 return pos;
831}
833 uint32_t size = 0;
834 size += 2 + this->object_id.size();
835 size += 5;
836 size += 2 + this->name.size();
837#ifdef USE_ENTITY_ICON
838 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
839#endif
840 size += !this->unit_of_measurement.empty() ? 2 + this->unit_of_measurement.size() : 0;
842 size += ProtoSize::calc_bool(1, this->force_update);
843 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
844 size += this->state_class ? 2 : 0;
846 size += this->entity_category ? 2 : 0;
847#ifdef USE_DEVICES
848 size += ProtoSize::calc_uint32(1, this->device_id);
849#endif
850 return size;
851}
852__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
853uint8_t *
854SensorStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
855 uint8_t *__restrict__ pos = buffer.get_pos();
856 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
857 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
858 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->missing_state);
859#ifdef USE_DEVICES
860 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
861#endif
862 return pos;
863}
864__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
866SensorStateResponse::calculate_size() const {
867 uint32_t size = 0;
868 size += 5;
869 size += ProtoSize::calc_float(1, this->state);
870 size += ProtoSize::calc_bool(1, this->missing_state);
871#ifdef USE_DEVICES
872 size += ProtoSize::calc_uint32(1, this->device_id);
873#endif
874 return size;
875}
876#endif
877#ifdef USE_SWITCH
878uint8_t *ListEntitiesSwitchResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
879 uint8_t *__restrict__ pos = buffer.get_pos();
880 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
881 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
882 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
883#ifdef USE_ENTITY_ICON
884 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
885#endif
886 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->assumed_state);
887 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 7, this->disabled_by_default);
888 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, static_cast<uint32_t>(this->entity_category));
889 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 9, this->device_class);
890#ifdef USE_DEVICES
891 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, this->device_id);
892#endif
893 return pos;
894}
896 uint32_t size = 0;
897 size += 2 + this->object_id.size();
898 size += 5;
899 size += 2 + this->name.size();
900#ifdef USE_ENTITY_ICON
901 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
902#endif
903 size += ProtoSize::calc_bool(1, this->assumed_state);
905 size += this->entity_category ? 2 : 0;
906 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
907#ifdef USE_DEVICES
908 size += ProtoSize::calc_uint32(1, this->device_id);
909#endif
910 return size;
911}
912uint8_t *SwitchStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
913 uint8_t *__restrict__ pos = buffer.get_pos();
914 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
915 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
916#ifdef USE_DEVICES
917 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->device_id);
918#endif
919 return pos;
920}
922 uint32_t size = 0;
923 size += 5;
924 size += ProtoSize::calc_bool(1, this->state);
925#ifdef USE_DEVICES
926 size += ProtoSize::calc_uint32(1, this->device_id);
927#endif
928 return size;
929}
931 switch (field_id) {
932 case 2:
933 this->state = value != 0;
934 break;
935#ifdef USE_DEVICES
936 case 3:
937 this->device_id = value;
938 break;
939#endif
940 default:
941 return false;
942 }
943 return true;
944}
946 switch (field_id) {
947 case 1:
948 this->key = value.as_fixed32();
949 break;
950 default:
951 return false;
952 }
953 return true;
954}
955#endif
956#ifdef USE_TEXT_SENSOR
957uint8_t *ListEntitiesTextSensorResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
958 uint8_t *__restrict__ pos = buffer.get_pos();
959 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
960 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
961 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
962#ifdef USE_ENTITY_ICON
963 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
964#endif
965 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
966 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
967 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
968#ifdef USE_DEVICES
969 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->device_id);
970#endif
971 return pos;
972}
974 uint32_t size = 0;
975 size += 2 + this->object_id.size();
976 size += 5;
977 size += 2 + this->name.size();
978#ifdef USE_ENTITY_ICON
979 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
980#endif
982 size += this->entity_category ? 2 : 0;
983 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
984#ifdef USE_DEVICES
985 size += ProtoSize::calc_uint32(1, this->device_id);
986#endif
987 return size;
988}
989uint8_t *TextSensorStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
990 uint8_t *__restrict__ pos = buffer.get_pos();
991 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
992 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
993 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->missing_state);
994#ifdef USE_DEVICES
995 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
996#endif
997 return pos;
998}
1000 uint32_t size = 0;
1001 size += 5;
1002 size += ProtoSize::calc_length(1, this->state.size());
1003 size += ProtoSize::calc_bool(1, this->missing_state);
1004#ifdef USE_DEVICES
1005 size += ProtoSize::calc_uint32(1, this->device_id);
1006#endif
1007 return size;
1008}
1009#endif
1011 switch (field_id) {
1012 case 1:
1013 this->level = static_cast<enums::LogLevel>(value);
1014 break;
1015 case 2:
1016 this->dump_config = value != 0;
1017 break;
1018 default:
1019 return false;
1020 }
1021 return true;
1022}
1023__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
1024uint8_t *
1025SubscribeLogsResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1026 uint8_t *__restrict__ pos = buffer.get_pos();
1027 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, static_cast<uint32_t>(this->level), true);
1028 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 26);
1029 ProtoEncode::encode_varint_raw(pos PROTO_ENCODE_DEBUG_ARG, this->message_len_);
1030 ProtoEncode::encode_raw(pos PROTO_ENCODE_DEBUG_ARG, this->message_ptr_, this->message_len_);
1031 return pos;
1032}
1033__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
1035SubscribeLogsResponse::calculate_size() const {
1036 uint32_t size = 0;
1037 size += 2;
1038 size += ProtoSize::calc_length_force(1, this->message_len_);
1039 return size;
1040}
1041#ifdef USE_API_NOISE
1042bool NoiseEncryptionSetKeyRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
1043 switch (field_id) {
1044 case 1: {
1045 this->key = value.data();
1046 this->key_len = value.size();
1047 break;
1048 }
1049 default:
1050 return false;
1051 }
1052 return true;
1053}
1054uint8_t *NoiseEncryptionSetKeyResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1055 uint8_t *__restrict__ pos = buffer.get_pos();
1056 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 1, this->success);
1057 return pos;
1058}
1060 uint32_t size = 0;
1061 size += ProtoSize::calc_bool(1, this->success);
1062 return size;
1063}
1064#endif
1065#ifdef USE_API_HOMEASSISTANT_SERVICES
1066uint8_t *HomeassistantServiceMap::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1067 uint8_t *__restrict__ pos = buffer.get_pos();
1068 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->key);
1069 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->value);
1070 return pos;
1071}
1073 uint32_t size = 0;
1074 size += ProtoSize::calc_length(1, this->key.size());
1075 size += ProtoSize::calc_length(1, this->value.size());
1076 return size;
1077}
1078uint8_t *HomeassistantActionRequest::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1079 uint8_t *__restrict__ pos = buffer.get_pos();
1080 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->service);
1081 for (auto &it : this->data) {
1082 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 2, it);
1083 }
1084 for (auto &it : this->data_template) {
1085 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 3, it);
1086 }
1087 for (auto &it : this->variables) {
1088 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 4, it);
1089 }
1090 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->is_event);
1091#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES
1092 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, this->call_id);
1093#endif
1094#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
1095 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 7, this->wants_response);
1096#endif
1097#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
1098 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->response_template);
1099#endif
1100 return pos;
1101}
1103 uint32_t size = 0;
1104 size += ProtoSize::calc_length(1, this->service.size());
1105 if (!this->data.empty()) {
1106 for (const auto &it : this->data) {
1107 size += ProtoSize::calc_message_force(1, it.calculate_size());
1108 }
1109 }
1110 if (!this->data_template.empty()) {
1111 for (const auto &it : this->data_template) {
1112 size += ProtoSize::calc_message_force(1, it.calculate_size());
1113 }
1114 }
1115 if (!this->variables.empty()) {
1116 for (const auto &it : this->variables) {
1117 size += ProtoSize::calc_message_force(1, it.calculate_size());
1118 }
1119 }
1120 size += ProtoSize::calc_bool(1, this->is_event);
1121#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES
1122 size += ProtoSize::calc_uint32(1, this->call_id);
1123#endif
1124#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
1125 size += ProtoSize::calc_bool(1, this->wants_response);
1126#endif
1127#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
1128 size += ProtoSize::calc_length(1, this->response_template.size());
1129#endif
1130 return size;
1131}
1132#endif
1133#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES
1135 switch (field_id) {
1136 case 1:
1137 this->call_id = value;
1138 break;
1139 case 2:
1140 this->success = value != 0;
1141 break;
1142 default:
1143 return false;
1144 }
1145 return true;
1146}
1148 switch (field_id) {
1149 case 3: {
1150 this->error_message = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1151 break;
1152 }
1153#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON
1154 case 4: {
1155 this->response_data = value.data();
1156 this->response_data_len = value.size();
1157 break;
1158 }
1159#endif
1160 default:
1161 return false;
1162 }
1163 return true;
1164}
1165#endif
1166#ifdef USE_API_HOMEASSISTANT_STATES
1167uint8_t *SubscribeHomeAssistantStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1168 uint8_t *__restrict__ pos = buffer.get_pos();
1169 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->entity_id);
1170 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->attribute);
1171 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->once);
1172 return pos;
1173}
1175 uint32_t size = 0;
1177 size += ProtoSize::calc_length(1, this->attribute.size());
1178 size += ProtoSize::calc_bool(1, this->once);
1179 return size;
1180}
1182 switch (field_id) {
1183 case 1: {
1184 this->entity_id = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1185 break;
1186 }
1187 case 2: {
1188 this->state = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1189 break;
1190 }
1191 case 3: {
1192 this->attribute = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1193 break;
1194 }
1195 default:
1196 return false;
1197 }
1198 return true;
1199}
1200#endif
1202 switch (field_id) {
1203 case 1:
1204 this->time_seconds = decode_zigzag32(static_cast<uint32_t>(value));
1205 break;
1206 case 2:
1207 this->day = value;
1208 break;
1209 case 3:
1210 this->type = static_cast<enums::DSTRuleType>(value);
1211 break;
1212 case 4:
1213 this->month = value;
1214 break;
1215 case 5:
1216 this->week = value;
1217 break;
1218 case 6:
1219 this->day_of_week = value;
1220 break;
1221 default:
1222 return false;
1223 }
1224 return true;
1225}
1227 switch (field_id) {
1228 case 1:
1229 this->std_offset_seconds = decode_zigzag32(static_cast<uint32_t>(value));
1230 break;
1231 case 2:
1232 this->dst_offset_seconds = decode_zigzag32(static_cast<uint32_t>(value));
1233 break;
1234 default:
1235 return false;
1236 }
1237 return true;
1238}
1240 switch (field_id) {
1241 case 3:
1242 value.decode_to_message(this->dst_start);
1243 break;
1244 case 4:
1245 value.decode_to_message(this->dst_end);
1246 break;
1247 default:
1248 return false;
1249 }
1250 return true;
1251}
1253 switch (field_id) {
1254 case 3:
1256 this->has_parsed_timezone = true;
1257 break;
1258 default:
1259 return false;
1260 }
1261 return true;
1262}
1264 switch (field_id) {
1265 case 1:
1266 this->epoch_seconds = value.as_fixed32();
1267 break;
1268 default:
1269 return false;
1270 }
1271 return true;
1272}
1273#ifdef USE_API_USER_DEFINED_ACTIONS
1274uint8_t *ListEntitiesServicesArgument::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1275 uint8_t *__restrict__ pos = buffer.get_pos();
1276 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->name);
1277 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->type));
1278#ifdef USE_API_USER_DEFINED_ACTION_METADATA
1279 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 3, this->description);
1280#endif
1281#ifdef USE_API_USER_DEFINED_ACTION_METADATA
1282 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 4, this->example);
1283#endif
1284 return pos;
1285}
1287 uint32_t size = 0;
1288 size += ProtoSize::calc_length(1, this->name.size());
1289 size += this->type ? 2 : 0;
1290#ifdef USE_API_USER_DEFINED_ACTION_METADATA
1291 size += ProtoSize::calc_length(1, this->description.size());
1292#endif
1293#ifdef USE_API_USER_DEFINED_ACTION_METADATA
1294 size += ProtoSize::calc_length(1, this->example.size());
1295#endif
1296 return size;
1297}
1298uint8_t *ListEntitiesServicesResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1299 uint8_t *__restrict__ pos = buffer.get_pos();
1300 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->name);
1301 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1302 for (auto &it : this->args) {
1303 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 3, it);
1304 }
1305 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, static_cast<uint32_t>(this->supports_response));
1306#ifdef USE_API_USER_DEFINED_ACTION_METADATA
1307 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->description);
1308#endif
1309 return pos;
1310}
1312 uint32_t size = 0;
1313 size += ProtoSize::calc_length(1, this->name.size());
1314 size += 5;
1315 if (!this->args.empty()) {
1316 for (const auto &it : this->args) {
1317 size += ProtoSize::calc_message_force(1, it.calculate_size());
1318 }
1319 }
1320 size += this->supports_response ? 2 : 0;
1321#ifdef USE_API_USER_DEFINED_ACTION_METADATA
1322 size += ProtoSize::calc_length(1, this->description.size());
1323#endif
1324 return size;
1325}
1327 switch (field_id) {
1328 case 1:
1329 this->bool_ = value != 0;
1330 break;
1331 case 2:
1332 this->legacy_int = static_cast<int32_t>(value);
1333 break;
1334 case 5:
1335 this->int_ = decode_zigzag32(static_cast<uint32_t>(value));
1336 break;
1337 case 6:
1338 this->bool_array.push_back(value != 0);
1339 break;
1340 case 7:
1341 this->int_array.push_back(decode_zigzag32(static_cast<uint32_t>(value)));
1342 break;
1343 default:
1344 return false;
1345 }
1346 return true;
1347}
1349 switch (field_id) {
1350 case 4: {
1351 this->string_ = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1352 break;
1353 }
1354 case 9:
1355 this->string_array.push_back(value.as_string());
1356 break;
1357 default:
1358 return false;
1359 }
1360 return true;
1361}
1363 switch (field_id) {
1364 case 3:
1365 this->float_ = value.as_float();
1366 break;
1367 case 8:
1368 this->float_array.push_back(value.as_float());
1369 break;
1370 default:
1371 return false;
1372 }
1373 return true;
1374}
1375void ExecuteServiceArgument::decode(const uint8_t *buffer, size_t length) {
1376 uint32_t count_bool_array = ProtoDecodableMessage::count_repeated_field(buffer, length, 6);
1377 this->bool_array.init(count_bool_array);
1378 uint32_t count_int_array = ProtoDecodableMessage::count_repeated_field(buffer, length, 7);
1379 this->int_array.init(count_int_array);
1380 uint32_t count_float_array = ProtoDecodableMessage::count_repeated_field(buffer, length, 8);
1381 this->float_array.init(count_float_array);
1382 uint32_t count_string_array = ProtoDecodableMessage::count_repeated_field(buffer, length, 9);
1383 this->string_array.init(count_string_array);
1385}
1387 switch (field_id) {
1388#ifdef USE_API_USER_DEFINED_ACTION_RESPONSES
1389 case 3:
1390 this->call_id = value;
1391 break;
1392#endif
1393#ifdef USE_API_USER_DEFINED_ACTION_RESPONSES
1394 case 4:
1395 this->return_response = value != 0;
1396 break;
1397#endif
1398 default:
1399 return false;
1400 }
1401 return true;
1402}
1404 switch (field_id) {
1405 case 2:
1406 this->args.emplace_back();
1407 value.decode_to_message(this->args.back());
1408 break;
1409 default:
1410 return false;
1411 }
1412 return true;
1413}
1415 switch (field_id) {
1416 case 1:
1417 this->key = value.as_fixed32();
1418 break;
1419 default:
1420 return false;
1421 }
1422 return true;
1423}
1424void ExecuteServiceRequest::decode(const uint8_t *buffer, size_t length) {
1426 this->args.init(count_args);
1428}
1429#endif
1430#ifdef USE_API_USER_DEFINED_ACTION_RESPONSES
1431uint8_t *ExecuteServiceResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1432 uint8_t *__restrict__ pos = buffer.get_pos();
1433 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->call_id);
1434 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->success);
1435 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 3, this->error_message);
1436#ifdef USE_API_USER_DEFINED_ACTION_RESPONSES_JSON
1437 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 4, this->response_data, this->response_data_len);
1438#endif
1439 return pos;
1440}
1442 uint32_t size = 0;
1443 size += ProtoSize::calc_uint32(1, this->call_id);
1444 size += ProtoSize::calc_bool(1, this->success);
1445 size += ProtoSize::calc_length(1, this->error_message.size());
1446#ifdef USE_API_USER_DEFINED_ACTION_RESPONSES_JSON
1447 size += ProtoSize::calc_length(1, this->response_data_len);
1448#endif
1449 return size;
1450}
1451#endif
1452#ifdef USE_CAMERA
1453uint8_t *ListEntitiesCameraResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1454 uint8_t *__restrict__ pos = buffer.get_pos();
1455 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
1456 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1457 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
1458 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->disabled_by_default);
1459#ifdef USE_ENTITY_ICON
1460 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 6, this->icon);
1461#endif
1462 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
1463#ifdef USE_DEVICES
1464 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_id);
1465#endif
1466 return pos;
1467}
1469 uint32_t size = 0;
1470 size += 2 + this->object_id.size();
1471 size += 5;
1472 size += 2 + this->name.size();
1473 size += ProtoSize::calc_bool(1, this->disabled_by_default);
1474#ifdef USE_ENTITY_ICON
1475 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
1476#endif
1477 size += this->entity_category ? 2 : 0;
1478#ifdef USE_DEVICES
1479 size += ProtoSize::calc_uint32(1, this->device_id);
1480#endif
1481 return size;
1482}
1483uint8_t *CameraImageResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1484 uint8_t *__restrict__ pos = buffer.get_pos();
1485 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1486 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 2, this->data_ptr_, this->data_len_);
1487 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->done);
1488#ifdef USE_DEVICES
1489 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
1490#endif
1491 return pos;
1492}
1494 uint32_t size = 0;
1495 size += 5;
1497 size += ProtoSize::calc_bool(1, this->done);
1498#ifdef USE_DEVICES
1499 size += ProtoSize::calc_uint32(1, this->device_id);
1500#endif
1501 return size;
1502}
1504 switch (field_id) {
1505 case 1:
1506 this->single = value != 0;
1507 break;
1508 case 2:
1509 this->stream = value != 0;
1510 break;
1511 default:
1512 return false;
1513 }
1514 return true;
1515}
1516#endif
1517#ifdef USE_CLIMATE
1518uint8_t *ListEntitiesClimateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1519 uint8_t *__restrict__ pos = buffer.get_pos();
1520 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
1521 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1522 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
1523 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->supports_current_temperature);
1524 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->supports_two_point_target_temperature);
1525 for (const auto &it : *this->supported_modes) {
1526 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(it), true);
1527 }
1528 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 8, this->visual_min_temperature);
1529 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 9, this->visual_max_temperature);
1530 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 10, this->visual_target_temperature_step);
1531 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 12, this->supports_action);
1532 for (const auto &it : *this->supported_fan_modes) {
1533 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 13, static_cast<uint32_t>(it), true);
1534 }
1535 for (const auto &it : *this->supported_swing_modes) {
1536 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 14, static_cast<uint32_t>(it), true);
1537 }
1538 for (const char *it : *this->supported_custom_fan_modes) {
1539 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 15, it, strlen(it), true);
1540 }
1541 for (const auto &it : *this->supported_presets) {
1542 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 16, static_cast<uint32_t>(it), true);
1543 }
1544 for (const char *it : *this->supported_custom_presets) {
1545 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 17, it, strlen(it), true);
1546 }
1547 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 18, this->disabled_by_default);
1548#ifdef USE_ENTITY_ICON
1549 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 19, this->icon);
1550#endif
1551 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 20, static_cast<uint32_t>(this->entity_category));
1552 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 21, this->visual_current_temperature_step);
1553 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 22, this->supports_current_humidity);
1554 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 23, this->supports_target_humidity);
1555 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 24, this->visual_min_humidity);
1556 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 25, this->visual_max_humidity);
1557#ifdef USE_DEVICES
1558 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 26, this->device_id);
1559#endif
1560 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 27, this->feature_flags);
1561 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 28, static_cast<uint32_t>(this->temperature_unit));
1562 return pos;
1563}
1565 uint32_t size = 0;
1566 size += 2 + this->object_id.size();
1567 size += 5;
1568 size += 2 + this->name.size();
1571 if (!this->supported_modes->empty()) {
1572 size += this->supported_modes->size() * 2;
1573 }
1577 size += ProtoSize::calc_bool(1, this->supports_action);
1578 if (!this->supported_fan_modes->empty()) {
1579 size += this->supported_fan_modes->size() * 2;
1580 }
1581 if (!this->supported_swing_modes->empty()) {
1582 size += this->supported_swing_modes->size() * 2;
1583 }
1584 if (!this->supported_custom_fan_modes->empty()) {
1585 for (const char *it : *this->supported_custom_fan_modes) {
1586 size += ProtoSize::calc_length_force(1, strlen(it));
1587 }
1588 }
1589 if (!this->supported_presets->empty()) {
1590 size += this->supported_presets->size() * 3;
1591 }
1592 if (!this->supported_custom_presets->empty()) {
1593 for (const char *it : *this->supported_custom_presets) {
1594 size += ProtoSize::calc_length_force(2, strlen(it));
1595 }
1596 }
1598#ifdef USE_ENTITY_ICON
1599 size += !this->icon.empty() ? 3 + this->icon.size() : 0;
1600#endif
1601 size += this->entity_category ? 3 : 0;
1607#ifdef USE_DEVICES
1608 size += ProtoSize::calc_uint32(2, this->device_id);
1609#endif
1610 size += ProtoSize::calc_uint32(2, this->feature_flags);
1611 size += this->temperature_unit ? 3 : 0;
1612 return size;
1613}
1614uint8_t *ClimateStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1615 uint8_t *__restrict__ pos = buffer.get_pos();
1616 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1617 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->mode));
1618 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->current_temperature);
1619 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 4, this->target_temperature);
1620 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 5, this->target_temperature_low);
1621 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 6, this->target_temperature_high);
1622 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, static_cast<uint32_t>(this->action));
1623 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, static_cast<uint32_t>(this->fan_mode));
1624 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, static_cast<uint32_t>(this->swing_mode));
1625 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 11, this->custom_fan_mode);
1626 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, static_cast<uint32_t>(this->preset));
1627 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 13, this->custom_preset);
1628 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 14, this->current_humidity);
1629 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 15, this->target_humidity);
1630#ifdef USE_DEVICES
1631 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 16, this->device_id);
1632#endif
1633 return pos;
1634}
1636 uint32_t size = 0;
1637 size += 5;
1638 size += this->mode ? 2 : 0;
1640 size += ProtoSize::calc_float(1, this->target_temperature);
1643 size += this->action ? 2 : 0;
1644 size += this->fan_mode ? 2 : 0;
1645 size += this->swing_mode ? 2 : 0;
1646 size += ProtoSize::calc_length(1, this->custom_fan_mode.size());
1647 size += this->preset ? 2 : 0;
1648 size += ProtoSize::calc_length(1, this->custom_preset.size());
1649 size += ProtoSize::calc_float(1, this->current_humidity);
1650 size += ProtoSize::calc_float(1, this->target_humidity);
1651#ifdef USE_DEVICES
1652 size += ProtoSize::calc_uint32(2, this->device_id);
1653#endif
1654 return size;
1655}
1657 switch (field_id) {
1658 case 2:
1659 this->has_mode = value != 0;
1660 break;
1661 case 3:
1662 this->mode = static_cast<enums::ClimateMode>(value);
1663 break;
1664 case 4:
1665 this->has_target_temperature = value != 0;
1666 break;
1667 case 6:
1668 this->has_target_temperature_low = value != 0;
1669 break;
1670 case 8:
1671 this->has_target_temperature_high = value != 0;
1672 break;
1673 case 12:
1674 this->has_fan_mode = value != 0;
1675 break;
1676 case 13:
1677 this->fan_mode = static_cast<enums::ClimateFanMode>(value);
1678 break;
1679 case 14:
1680 this->has_swing_mode = value != 0;
1681 break;
1682 case 15:
1683 this->swing_mode = static_cast<enums::ClimateSwingMode>(value);
1684 break;
1685 case 16:
1686 this->has_custom_fan_mode = value != 0;
1687 break;
1688 case 18:
1689 this->has_preset = value != 0;
1690 break;
1691 case 19:
1692 this->preset = static_cast<enums::ClimatePreset>(value);
1693 break;
1694 case 20:
1695 this->has_custom_preset = value != 0;
1696 break;
1697 case 22:
1698 this->has_target_humidity = value != 0;
1699 break;
1700#ifdef USE_DEVICES
1701 case 24:
1702 this->device_id = value;
1703 break;
1704#endif
1705 default:
1706 return false;
1707 }
1708 return true;
1709}
1711 switch (field_id) {
1712 case 17: {
1713 this->custom_fan_mode = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1714 break;
1715 }
1716 case 21: {
1717 this->custom_preset = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1718 break;
1719 }
1720 default:
1721 return false;
1722 }
1723 return true;
1724}
1726 switch (field_id) {
1727 case 1:
1728 this->key = value.as_fixed32();
1729 break;
1730 case 5:
1731 this->target_temperature = value.as_float();
1732 break;
1733 case 7:
1734 this->target_temperature_low = value.as_float();
1735 break;
1736 case 9:
1737 this->target_temperature_high = value.as_float();
1738 break;
1739 case 23:
1740 this->target_humidity = value.as_float();
1741 break;
1742 default:
1743 return false;
1744 }
1745 return true;
1746}
1747#endif
1748#ifdef USE_WATER_HEATER
1749uint8_t *ListEntitiesWaterHeaterResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1750 uint8_t *__restrict__ pos = buffer.get_pos();
1751 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
1752 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1753 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
1754#ifdef USE_ENTITY_ICON
1755 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 4, this->icon);
1756#endif
1757 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->disabled_by_default);
1758 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, static_cast<uint32_t>(this->entity_category));
1759#ifdef USE_DEVICES
1760 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, this->device_id);
1761#endif
1762 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 8, this->min_temperature);
1763 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 9, this->max_temperature);
1764 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 10, this->target_temperature_step);
1765 for (const auto &it : *this->supported_modes) {
1766 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, static_cast<uint32_t>(it), true);
1767 }
1768 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, this->supported_features);
1769 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 13, static_cast<uint32_t>(this->temperature_unit));
1770 return pos;
1771}
1773 uint32_t size = 0;
1774 size += 2 + this->object_id.size();
1775 size += 5;
1776 size += 2 + this->name.size();
1777#ifdef USE_ENTITY_ICON
1778 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
1779#endif
1780 size += ProtoSize::calc_bool(1, this->disabled_by_default);
1781 size += this->entity_category ? 2 : 0;
1782#ifdef USE_DEVICES
1783 size += ProtoSize::calc_uint32(1, this->device_id);
1784#endif
1785 size += ProtoSize::calc_float(1, this->min_temperature);
1786 size += ProtoSize::calc_float(1, this->max_temperature);
1788 if (!this->supported_modes->empty()) {
1789 size += this->supported_modes->size() * 2;
1790 }
1792 size += this->temperature_unit ? 2 : 0;
1793 return size;
1794}
1795uint8_t *WaterHeaterStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1796 uint8_t *__restrict__ pos = buffer.get_pos();
1797 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1798 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 2, this->current_temperature);
1799 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->target_temperature);
1800 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, static_cast<uint32_t>(this->mode));
1801#ifdef USE_DEVICES
1802 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->device_id);
1803#endif
1804 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, this->state);
1805 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 7, this->target_temperature_low);
1806 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 8, this->target_temperature_high);
1807 return pos;
1808}
1810 uint32_t size = 0;
1811 size += 5;
1813 size += ProtoSize::calc_float(1, this->target_temperature);
1814 size += this->mode ? 2 : 0;
1815#ifdef USE_DEVICES
1816 size += ProtoSize::calc_uint32(1, this->device_id);
1817#endif
1818 size += ProtoSize::calc_uint32(1, this->state);
1821 return size;
1822}
1824 switch (field_id) {
1825 case 2:
1826 this->has_fields = value;
1827 break;
1828 case 3:
1829 this->mode = static_cast<enums::WaterHeaterMode>(value);
1830 break;
1831#ifdef USE_DEVICES
1832 case 5:
1833 this->device_id = value;
1834 break;
1835#endif
1836 case 6:
1837 this->state = value;
1838 break;
1839 default:
1840 return false;
1841 }
1842 return true;
1843}
1845 switch (field_id) {
1846 case 1:
1847 this->key = value.as_fixed32();
1848 break;
1849 case 4:
1850 this->target_temperature = value.as_float();
1851 break;
1852 case 7:
1853 this->target_temperature_low = value.as_float();
1854 break;
1855 case 8:
1856 this->target_temperature_high = value.as_float();
1857 break;
1858 default:
1859 return false;
1860 }
1861 return true;
1862}
1863#endif
1864#ifdef USE_NUMBER
1865uint8_t *ListEntitiesNumberResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1866 uint8_t *__restrict__ pos = buffer.get_pos();
1867 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
1868 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1869 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
1870#ifdef USE_ENTITY_ICON
1871 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
1872#endif
1873 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 6, this->min_value);
1874 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 7, this->max_value);
1875 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 8, this->step);
1876 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->disabled_by_default);
1877 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, static_cast<uint32_t>(this->entity_category));
1878 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 11, this->unit_of_measurement);
1879 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, static_cast<uint32_t>(this->mode));
1880 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 13, this->device_class);
1881#ifdef USE_DEVICES
1882 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 14, this->device_id);
1883#endif
1884 return pos;
1885}
1887 uint32_t size = 0;
1888 size += 2 + this->object_id.size();
1889 size += 5;
1890 size += 2 + this->name.size();
1891#ifdef USE_ENTITY_ICON
1892 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
1893#endif
1894 size += ProtoSize::calc_float(1, this->min_value);
1895 size += ProtoSize::calc_float(1, this->max_value);
1896 size += ProtoSize::calc_float(1, this->step);
1897 size += ProtoSize::calc_bool(1, this->disabled_by_default);
1898 size += this->entity_category ? 2 : 0;
1899 size += !this->unit_of_measurement.empty() ? 2 + this->unit_of_measurement.size() : 0;
1900 size += this->mode ? 2 : 0;
1901 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
1902#ifdef USE_DEVICES
1903 size += ProtoSize::calc_uint32(1, this->device_id);
1904#endif
1905 return size;
1906}
1907uint8_t *NumberStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1908 uint8_t *__restrict__ pos = buffer.get_pos();
1909 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1910 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
1911 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->missing_state);
1912#ifdef USE_DEVICES
1913 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
1914#endif
1915 return pos;
1916}
1918 uint32_t size = 0;
1919 size += 5;
1920 size += ProtoSize::calc_float(1, this->state);
1921 size += ProtoSize::calc_bool(1, this->missing_state);
1922#ifdef USE_DEVICES
1923 size += ProtoSize::calc_uint32(1, this->device_id);
1924#endif
1925 return size;
1926}
1928 switch (field_id) {
1929#ifdef USE_DEVICES
1930 case 3:
1931 this->device_id = value;
1932 break;
1933#endif
1934 default:
1935 return false;
1936 }
1937 return true;
1938}
1940 switch (field_id) {
1941 case 1:
1942 this->key = value.as_fixed32();
1943 break;
1944 case 2:
1945 this->state = value.as_float();
1946 break;
1947 default:
1948 return false;
1949 }
1950 return true;
1951}
1952#endif
1953#ifdef USE_SELECT
1954uint8_t *ListEntitiesSelectResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1955 uint8_t *__restrict__ pos = buffer.get_pos();
1956 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
1957 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1958 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
1959#ifdef USE_ENTITY_ICON
1960 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
1961#endif
1962 for (const char *it : *this->options) {
1963 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 6, it, strlen(it), true);
1964 }
1965 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 7, this->disabled_by_default);
1966 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, static_cast<uint32_t>(this->entity_category));
1967#ifdef USE_DEVICES
1968 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->device_id);
1969#endif
1970 return pos;
1971}
1973 uint32_t size = 0;
1974 size += 2 + this->object_id.size();
1975 size += 5;
1976 size += 2 + this->name.size();
1977#ifdef USE_ENTITY_ICON
1978 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
1979#endif
1980 if (!this->options->empty()) {
1981 for (const char *it : *this->options) {
1982 size += ProtoSize::calc_length_force(1, strlen(it));
1983 }
1984 }
1986 size += this->entity_category ? 2 : 0;
1987#ifdef USE_DEVICES
1988 size += ProtoSize::calc_uint32(1, this->device_id);
1989#endif
1990 return size;
1991}
1992uint8_t *SelectStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1993 uint8_t *__restrict__ pos = buffer.get_pos();
1994 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1995 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
1996 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->missing_state);
1997#ifdef USE_DEVICES
1998 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
1999#endif
2000 return pos;
2001}
2003 uint32_t size = 0;
2004 size += 5;
2005 size += ProtoSize::calc_length(1, this->state.size());
2006 size += ProtoSize::calc_bool(1, this->missing_state);
2007#ifdef USE_DEVICES
2008 size += ProtoSize::calc_uint32(1, this->device_id);
2009#endif
2010 return size;
2011}
2013 switch (field_id) {
2014#ifdef USE_DEVICES
2015 case 3:
2016 this->device_id = value;
2017 break;
2018#endif
2019 default:
2020 return false;
2021 }
2022 return true;
2023}
2025 switch (field_id) {
2026 case 2: {
2027 this->state = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2028 break;
2029 }
2030 default:
2031 return false;
2032 }
2033 return true;
2034}
2036 switch (field_id) {
2037 case 1:
2038 this->key = value.as_fixed32();
2039 break;
2040 default:
2041 return false;
2042 }
2043 return true;
2044}
2045#endif
2046#ifdef USE_SIREN
2047uint8_t *ListEntitiesSirenResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2048 uint8_t *__restrict__ pos = buffer.get_pos();
2049 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
2050 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
2051 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
2052#ifdef USE_ENTITY_ICON
2053 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
2054#endif
2055 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
2056 for (const char *it : *this->tones) {
2057 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 7, it, strlen(it), true);
2058 }
2059 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 8, this->supports_duration);
2060 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->supports_volume);
2061 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, static_cast<uint32_t>(this->entity_category));
2062#ifdef USE_DEVICES
2063 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, this->device_id);
2064#endif
2065 return pos;
2066}
2068 uint32_t size = 0;
2069 size += 2 + this->object_id.size();
2070 size += 5;
2071 size += 2 + this->name.size();
2072#ifdef USE_ENTITY_ICON
2073 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
2074#endif
2075 size += ProtoSize::calc_bool(1, this->disabled_by_default);
2076 if (!this->tones->empty()) {
2077 for (const char *it : *this->tones) {
2078 size += ProtoSize::calc_length_force(1, strlen(it));
2079 }
2080 }
2082 size += ProtoSize::calc_bool(1, this->supports_volume);
2083 size += this->entity_category ? 2 : 0;
2084#ifdef USE_DEVICES
2085 size += ProtoSize::calc_uint32(1, this->device_id);
2086#endif
2087 return size;
2088}
2089uint8_t *SirenStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2090 uint8_t *__restrict__ pos = buffer.get_pos();
2091 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
2092 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
2093#ifdef USE_DEVICES
2094 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->device_id);
2095#endif
2096 return pos;
2097}
2099 uint32_t size = 0;
2100 size += 5;
2101 size += ProtoSize::calc_bool(1, this->state);
2102#ifdef USE_DEVICES
2103 size += ProtoSize::calc_uint32(1, this->device_id);
2104#endif
2105 return size;
2106}
2108 switch (field_id) {
2109 case 2:
2110 this->has_state = value != 0;
2111 break;
2112 case 3:
2113 this->state = value != 0;
2114 break;
2115 case 4:
2116 this->has_tone = value != 0;
2117 break;
2118 case 6:
2119 this->has_duration = value != 0;
2120 break;
2121 case 7:
2122 this->duration = value;
2123 break;
2124 case 8:
2125 this->has_volume = value != 0;
2126 break;
2127#ifdef USE_DEVICES
2128 case 10:
2129 this->device_id = value;
2130 break;
2131#endif
2132 default:
2133 return false;
2134 }
2135 return true;
2136}
2138 switch (field_id) {
2139 case 5: {
2140 this->tone = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2141 break;
2142 }
2143 default:
2144 return false;
2145 }
2146 return true;
2147}
2149 switch (field_id) {
2150 case 1:
2151 this->key = value.as_fixed32();
2152 break;
2153 case 9:
2154 this->volume = value.as_float();
2155 break;
2156 default:
2157 return false;
2158 }
2159 return true;
2160}
2161#endif
2162#ifdef USE_LOCK
2163uint8_t *ListEntitiesLockResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2164 uint8_t *__restrict__ pos = buffer.get_pos();
2165 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
2166 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
2167 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
2168#ifdef USE_ENTITY_ICON
2169 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
2170#endif
2171 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
2172 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
2173 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 8, this->assumed_state);
2174 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->supports_open);
2175 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 10, this->requires_code);
2176 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 11, this->code_format);
2177#ifdef USE_DEVICES
2178 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, this->device_id);
2179#endif
2180 return pos;
2181}
2183 uint32_t size = 0;
2184 size += 2 + this->object_id.size();
2185 size += 5;
2186 size += 2 + this->name.size();
2187#ifdef USE_ENTITY_ICON
2188 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
2189#endif
2190 size += ProtoSize::calc_bool(1, this->disabled_by_default);
2191 size += this->entity_category ? 2 : 0;
2192 size += ProtoSize::calc_bool(1, this->assumed_state);
2193 size += ProtoSize::calc_bool(1, this->supports_open);
2194 size += ProtoSize::calc_bool(1, this->requires_code);
2195 size += ProtoSize::calc_length(1, this->code_format.size());
2196#ifdef USE_DEVICES
2197 size += ProtoSize::calc_uint32(1, this->device_id);
2198#endif
2199 return size;
2200}
2201uint8_t *LockStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2202 uint8_t *__restrict__ pos = buffer.get_pos();
2203 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
2204 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->state));
2205#ifdef USE_DEVICES
2206 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->device_id);
2207#endif
2208 return pos;
2209}
2211 uint32_t size = 0;
2212 size += 5;
2213 size += this->state ? 2 : 0;
2214#ifdef USE_DEVICES
2215 size += ProtoSize::calc_uint32(1, this->device_id);
2216#endif
2217 return size;
2218}
2220 switch (field_id) {
2221 case 2:
2222 this->command = static_cast<enums::LockCommand>(value);
2223 break;
2224 case 3:
2225 this->has_code = value != 0;
2226 break;
2227#ifdef USE_DEVICES
2228 case 5:
2229 this->device_id = value;
2230 break;
2231#endif
2232 default:
2233 return false;
2234 }
2235 return true;
2236}
2238 switch (field_id) {
2239 case 4: {
2240 this->code = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2241 break;
2242 }
2243 default:
2244 return false;
2245 }
2246 return true;
2247}
2249 switch (field_id) {
2250 case 1:
2251 this->key = value.as_fixed32();
2252 break;
2253 default:
2254 return false;
2255 }
2256 return true;
2257}
2258#endif
2259#ifdef USE_BUTTON
2260uint8_t *ListEntitiesButtonResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2261 uint8_t *__restrict__ pos = buffer.get_pos();
2262 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
2263 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
2264 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
2265#ifdef USE_ENTITY_ICON
2266 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
2267#endif
2268 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
2269 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
2270 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
2271#ifdef USE_DEVICES
2272 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->device_id);
2273#endif
2274 return pos;
2275}
2277 uint32_t size = 0;
2278 size += 2 + this->object_id.size();
2279 size += 5;
2280 size += 2 + this->name.size();
2281#ifdef USE_ENTITY_ICON
2282 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
2283#endif
2284 size += ProtoSize::calc_bool(1, this->disabled_by_default);
2285 size += this->entity_category ? 2 : 0;
2286 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
2287#ifdef USE_DEVICES
2288 size += ProtoSize::calc_uint32(1, this->device_id);
2289#endif
2290 return size;
2291}
2293 switch (field_id) {
2294#ifdef USE_DEVICES
2295 case 2:
2296 this->device_id = value;
2297 break;
2298#endif
2299 default:
2300 return false;
2301 }
2302 return true;
2303}
2305 switch (field_id) {
2306 case 1:
2307 this->key = value.as_fixed32();
2308 break;
2309 default:
2310 return false;
2311 }
2312 return true;
2313}
2314#endif
2315#ifdef USE_MEDIA_PLAYER
2316uint8_t *MediaPlayerSupportedFormat::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2317 uint8_t *__restrict__ pos = buffer.get_pos();
2318 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->format);
2319 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->sample_rate);
2320 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->num_channels);
2321 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, static_cast<uint32_t>(this->purpose));
2322 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->sample_bytes);
2323 return pos;
2324}
2326 uint32_t size = 0;
2327 size += ProtoSize::calc_length(1, this->format.size());
2328 size += ProtoSize::calc_uint32(1, this->sample_rate);
2329 size += ProtoSize::calc_uint32(1, this->num_channels);
2330 size += this->purpose ? 2 : 0;
2331 size += ProtoSize::calc_uint32(1, this->sample_bytes);
2332 return size;
2333}
2334uint8_t *ListEntitiesMediaPlayerResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2335 uint8_t *__restrict__ pos = buffer.get_pos();
2336 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
2337 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
2338 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
2339#ifdef USE_ENTITY_ICON
2340 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
2341#endif
2342 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
2343 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
2344 for (auto &it : this->supported_formats) {
2345 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 9, it);
2346 }
2347#ifdef USE_DEVICES
2348 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, this->device_id);
2349#endif
2350 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, this->feature_flags);
2351 return pos;
2352}
2354 uint32_t size = 0;
2355 size += 2 + this->object_id.size();
2356 size += 5;
2357 size += 2 + this->name.size();
2358#ifdef USE_ENTITY_ICON
2359 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
2360#endif
2361 size += ProtoSize::calc_bool(1, this->disabled_by_default);
2362 size += this->entity_category ? 2 : 0;
2363 if (!this->supported_formats.empty()) {
2364 for (const auto &it : this->supported_formats) {
2365 size += ProtoSize::calc_message_force(1, it.calculate_size());
2366 }
2367 }
2368#ifdef USE_DEVICES
2370#endif
2371 size += ProtoSize::calc_uint32(1, this->feature_flags);
2372 return size;
2373}
2374uint8_t *MediaPlayerStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2375 uint8_t *__restrict__ pos = buffer.get_pos();
2376 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
2377 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->state));
2378 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->volume);
2379 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 4, this->muted);
2380#ifdef USE_DEVICES
2381 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->device_id);
2382#endif
2383 return pos;
2384}
2386 uint32_t size = 0;
2387 size += 5;
2388 size += this->state ? 2 : 0;
2389 size += ProtoSize::calc_float(1, this->volume);
2390 size += ProtoSize::calc_bool(1, this->muted);
2391#ifdef USE_DEVICES
2392 size += ProtoSize::calc_uint32(1, this->device_id);
2393#endif
2394 return size;
2395}
2397 switch (field_id) {
2398 case 2:
2399 this->has_command = value != 0;
2400 break;
2401 case 3:
2402 this->command = static_cast<enums::MediaPlayerCommand>(value);
2403 break;
2404 case 4:
2405 this->has_volume = value != 0;
2406 break;
2407 case 6:
2408 this->has_media_url = value != 0;
2409 break;
2410 case 8:
2411 this->has_announcement = value != 0;
2412 break;
2413 case 9:
2414 this->announcement = value != 0;
2415 break;
2416#ifdef USE_DEVICES
2417 case 10:
2418 this->device_id = value;
2419 break;
2420#endif
2421 default:
2422 return false;
2423 }
2424 return true;
2425}
2427 switch (field_id) {
2428 case 7: {
2429 this->media_url = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2430 break;
2431 }
2432 default:
2433 return false;
2434 }
2435 return true;
2436}
2438 switch (field_id) {
2439 case 1:
2440 this->key = value.as_fixed32();
2441 break;
2442 case 5:
2443 this->volume = value.as_float();
2444 break;
2445 default:
2446 return false;
2447 }
2448 return true;
2449}
2450#endif
2451#ifdef USE_BLUETOOTH_PROXY
2453 switch (field_id) {
2454 case 1:
2455 this->flags = value;
2456 break;
2457 default:
2458 return false;
2459 }
2460 return true;
2461}
2462__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
2463uint8_t *
2464BluetoothLERawAdvertisementsResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2465 uint8_t *__restrict__ pos = buffer.get_pos();
2466 for (uint16_t i = 0; i < this->advertisements_len; i++) {
2467 auto &sub_msg = this->advertisements[i];
2468 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 10);
2469 uint8_t *len_pos = pos;
2470 ProtoEncode::reserve_byte(pos PROTO_ENCODE_DEBUG_ARG);
2471 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 8);
2472 ProtoEncode::encode_varint_raw_48bit(pos PROTO_ENCODE_DEBUG_ARG, sub_msg.address);
2473 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 16);
2474 ProtoEncode::encode_varint_raw_short(pos PROTO_ENCODE_DEBUG_ARG, encode_zigzag32(sub_msg.rssi));
2475 if (sub_msg.address_type) {
2476 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 24);
2477 ProtoEncode::encode_varint_raw(pos PROTO_ENCODE_DEBUG_ARG, sub_msg.address_type);
2478 }
2479 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 34);
2480 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, static_cast<uint8_t>(sub_msg.data_len));
2481 ProtoEncode::encode_raw(pos PROTO_ENCODE_DEBUG_ARG, sub_msg.data, sub_msg.data_len);
2482 *len_pos = static_cast<uint8_t>(pos - len_pos - 1);
2483 }
2484 return pos;
2485}
2486__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
2488BluetoothLERawAdvertisementsResponse::calculate_size() const {
2489 uint32_t size = 0;
2490 for (uint16_t i = 0; i < this->advertisements_len; i++) {
2491 auto &sub_msg = this->advertisements[i];
2492 size += 2;
2493 size += ProtoSize::calc_uint64_48bit_force(1, sub_msg.address);
2494 size += ProtoSize::calc_sint32_force(1, sub_msg.rssi);
2495 size += sub_msg.address_type ? 2 : 0;
2496 size += 2 + sub_msg.data_len;
2497 }
2498 return size;
2499}
2500#endif
2501#ifdef USE_BLUETOOTH_PROXY_CONNECTIONS
2503 switch (field_id) {
2504 case 1:
2505 this->address = value;
2506 break;
2507 case 2:
2508 this->request_type = static_cast<enums::BluetoothDeviceRequestType>(value);
2509 break;
2510 case 3:
2511 this->has_address_type = value != 0;
2512 break;
2513 case 4:
2514 this->address_type = value;
2515 break;
2516 default:
2517 return false;
2518 }
2519 return true;
2520}
2521uint8_t *BluetoothDeviceConnectionResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2522 uint8_t *__restrict__ pos = buffer.get_pos();
2523 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2524 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->connected);
2525 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->mtu);
2526 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->error);
2527 return pos;
2528}
2530 uint32_t size = 0;
2531 size += ProtoSize::calc_uint64(1, this->address);
2532 size += ProtoSize::calc_bool(1, this->connected);
2533 size += ProtoSize::calc_uint32(1, this->mtu);
2534 size += ProtoSize::calc_int32(1, this->error);
2535 return size;
2536}
2538 switch (field_id) {
2539 case 1:
2540 this->address = value;
2541 break;
2542 default:
2543 return false;
2544 }
2545 return true;
2546}
2547uint8_t *BluetoothGATTDescriptor::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2548 uint8_t *__restrict__ pos = buffer.get_pos();
2549 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2550 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[0], true);
2551 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[1], true);
2552 }
2553 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2554 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->short_uuid);
2555 return pos;
2556}
2558 uint32_t size = 0;
2559 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2560 size += ProtoSize::calc_uint64_force(1, this->uuid[0]);
2561 size += ProtoSize::calc_uint64_force(1, this->uuid[1]);
2562 }
2563 size += ProtoSize::calc_uint32(1, this->handle);
2564 size += ProtoSize::calc_uint32(1, this->short_uuid);
2565 return size;
2566}
2567uint8_t *BluetoothGATTCharacteristic::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2568 uint8_t *__restrict__ pos = buffer.get_pos();
2569 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2570 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[0], true);
2571 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[1], true);
2572 }
2573 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2574 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->properties);
2575 for (auto &it : this->descriptors) {
2576 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 4, it);
2577 }
2578 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->short_uuid);
2579 return pos;
2580}
2582 uint32_t size = 0;
2583 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2584 size += ProtoSize::calc_uint64_force(1, this->uuid[0]);
2585 size += ProtoSize::calc_uint64_force(1, this->uuid[1]);
2586 }
2587 size += ProtoSize::calc_uint32(1, this->handle);
2588 size += ProtoSize::calc_uint32(1, this->properties);
2589 if (!this->descriptors.empty()) {
2590 for (const auto &it : this->descriptors) {
2591 size += ProtoSize::calc_message_force(1, it.calculate_size());
2592 }
2593 }
2595 return size;
2596}
2597uint8_t *BluetoothGATTService::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2598 uint8_t *__restrict__ pos = buffer.get_pos();
2599 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2600 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[0], true);
2601 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[1], true);
2602 }
2603 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2604 for (auto &it : this->characteristics) {
2605 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 3, it);
2606 }
2607 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->short_uuid);
2608 return pos;
2609}
2611 uint32_t size = 0;
2612 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2613 size += ProtoSize::calc_uint64_force(1, this->uuid[0]);
2614 size += ProtoSize::calc_uint64_force(1, this->uuid[1]);
2615 }
2616 size += ProtoSize::calc_uint32(1, this->handle);
2617 if (!this->characteristics.empty()) {
2618 for (const auto &it : this->characteristics) {
2619 size += ProtoSize::calc_message_force(1, it.calculate_size());
2620 }
2621 }
2623 return size;
2624}
2625uint8_t *BluetoothGATTGetServicesResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2626 uint8_t *__restrict__ pos = buffer.get_pos();
2627 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2628 for (auto &it : this->services) {
2629 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 2, it);
2630 }
2631 return pos;
2632}
2634 uint32_t size = 0;
2635 size += ProtoSize::calc_uint64(1, this->address);
2636 if (!this->services.empty()) {
2637 for (const auto &it : this->services) {
2638 size += ProtoSize::calc_message_force(1, it.calculate_size());
2639 }
2640 }
2641 return size;
2642}
2643uint8_t *BluetoothGATTGetServicesDoneResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2644 uint8_t *__restrict__ pos = buffer.get_pos();
2645 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2646 return pos;
2647}
2654 switch (field_id) {
2655 case 1:
2656 this->address = value;
2657 break;
2658 case 2:
2659 this->handle = value;
2660 break;
2661 default:
2662 return false;
2663 }
2664 return true;
2665}
2666uint8_t *BluetoothGATTReadResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2667 uint8_t *__restrict__ pos = buffer.get_pos();
2668 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2669 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2670 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 3, this->data_ptr_, this->data_len_);
2671 return pos;
2672}
2674 uint32_t size = 0;
2675 size += ProtoSize::calc_uint64(1, this->address);
2676 size += ProtoSize::calc_uint32(1, this->handle);
2677 size += ProtoSize::calc_length(1, this->data_len_);
2678 return size;
2679}
2681 switch (field_id) {
2682 case 1:
2683 this->address = value;
2684 break;
2685 case 2:
2686 this->handle = value;
2687 break;
2688 case 3:
2689 this->response = value != 0;
2690 break;
2691 default:
2692 return false;
2693 }
2694 return true;
2695}
2697 switch (field_id) {
2698 case 4: {
2699 this->data = value.data();
2700 this->data_len = value.size();
2701 break;
2702 }
2703 default:
2704 return false;
2705 }
2706 return true;
2707}
2709 switch (field_id) {
2710 case 1:
2711 this->address = value;
2712 break;
2713 case 2:
2714 this->handle = value;
2715 break;
2716 default:
2717 return false;
2718 }
2719 return true;
2720}
2722 switch (field_id) {
2723 case 1:
2724 this->address = value;
2725 break;
2726 case 2:
2727 this->handle = value;
2728 break;
2729 default:
2730 return false;
2731 }
2732 return true;
2733}
2735 switch (field_id) {
2736 case 3: {
2737 this->data = value.data();
2738 this->data_len = value.size();
2739 break;
2740 }
2741 default:
2742 return false;
2743 }
2744 return true;
2745}
2747 switch (field_id) {
2748 case 1:
2749 this->address = value;
2750 break;
2751 case 2:
2752 this->handle = value;
2753 break;
2754 case 3:
2755 this->enable = value != 0;
2756 break;
2757 default:
2758 return false;
2759 }
2760 return true;
2761}
2762uint8_t *BluetoothGATTNotifyDataResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2763 uint8_t *__restrict__ pos = buffer.get_pos();
2764 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2765 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2766 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 3, this->data_ptr_, this->data_len_);
2767 return pos;
2768}
2770 uint32_t size = 0;
2771 size += ProtoSize::calc_uint64(1, this->address);
2772 size += ProtoSize::calc_uint32(1, this->handle);
2773 size += ProtoSize::calc_length(1, this->data_len_);
2774 return size;
2775}
2776uint8_t *BluetoothConnectionsFreeResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2777 uint8_t *__restrict__ pos = buffer.get_pos();
2778 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->free);
2779 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->limit);
2780 for (const auto &it : this->allocated) {
2781 if (it != 0) {
2782 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 3, it, true);
2783 }
2784 }
2785 return pos;
2786}
2788 uint32_t size = 0;
2789 size += ProtoSize::calc_uint32(1, this->free);
2790 size += ProtoSize::calc_uint32(1, this->limit);
2791 for (const auto &it : this->allocated) {
2792 if (it != 0) {
2794 }
2795 }
2796 return size;
2797}
2798uint8_t *BluetoothGATTErrorResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2799 uint8_t *__restrict__ pos = buffer.get_pos();
2800 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2801 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2802 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->error);
2803 return pos;
2804}
2806 uint32_t size = 0;
2807 size += ProtoSize::calc_uint64(1, this->address);
2808 size += ProtoSize::calc_uint32(1, this->handle);
2809 size += ProtoSize::calc_int32(1, this->error);
2810 return size;
2811}
2812uint8_t *BluetoothGATTWriteResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2813 uint8_t *__restrict__ pos = buffer.get_pos();
2814 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2815 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2816 return pos;
2817}
2819 uint32_t size = 0;
2820 size += ProtoSize::calc_uint64(1, this->address);
2821 size += ProtoSize::calc_uint32(1, this->handle);
2822 return size;
2823}
2824uint8_t *BluetoothGATTNotifyResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2825 uint8_t *__restrict__ pos = buffer.get_pos();
2826 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2827 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2828 return pos;
2829}
2831 uint32_t size = 0;
2832 size += ProtoSize::calc_uint64(1, this->address);
2833 size += ProtoSize::calc_uint32(1, this->handle);
2834 return size;
2835}
2836uint8_t *BluetoothDevicePairingResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2837 uint8_t *__restrict__ pos = buffer.get_pos();
2838 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2839 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->paired);
2840 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->error);
2841 return pos;
2842}
2844 uint32_t size = 0;
2845 size += ProtoSize::calc_uint64(1, this->address);
2846 size += ProtoSize::calc_bool(1, this->paired);
2847 size += ProtoSize::calc_int32(1, this->error);
2848 return size;
2849}
2850uint8_t *BluetoothDeviceUnpairingResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2851 uint8_t *__restrict__ pos = buffer.get_pos();
2852 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2853 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->success);
2854 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->error);
2855 return pos;
2856}
2858 uint32_t size = 0;
2859 size += ProtoSize::calc_uint64(1, this->address);
2860 size += ProtoSize::calc_bool(1, this->success);
2861 size += ProtoSize::calc_int32(1, this->error);
2862 return size;
2863}
2864uint8_t *BluetoothDeviceClearCacheResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2865 uint8_t *__restrict__ pos = buffer.get_pos();
2866 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2867 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->success);
2868 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->error);
2869 return pos;
2870}
2872 uint32_t size = 0;
2873 size += ProtoSize::calc_uint64(1, this->address);
2874 size += ProtoSize::calc_bool(1, this->success);
2875 size += ProtoSize::calc_int32(1, this->error);
2876 return size;
2877}
2878#endif
2879#ifdef USE_BLUETOOTH_PROXY
2880uint8_t *BluetoothScannerStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2881 uint8_t *__restrict__ pos = buffer.get_pos();
2882 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, static_cast<uint32_t>(this->state));
2883 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->mode));
2884 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, static_cast<uint32_t>(this->configured_mode));
2885 return pos;
2886}
2888 uint32_t size = 0;
2889 size += this->state ? 2 : 0;
2890 size += this->mode ? 2 : 0;
2891 size += this->configured_mode ? 2 : 0;
2892 return size;
2893}
2895 switch (field_id) {
2896 case 1:
2897 this->mode = static_cast<enums::BluetoothScannerMode>(value);
2898 break;
2899 default:
2900 return false;
2901 }
2902 return true;
2903}
2904#endif
2905#ifdef USE_VOICE_ASSISTANT
2907 switch (field_id) {
2908 case 1:
2909 this->subscribe = value != 0;
2910 break;
2911 case 2:
2912 this->flags = value;
2913 break;
2914 default:
2915 return false;
2916 }
2917 return true;
2918}
2919uint8_t *VoiceAssistantAudioSettings::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2920 uint8_t *__restrict__ pos = buffer.get_pos();
2921 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->noise_suppression_level);
2922 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->auto_gain);
2923 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->volume_multiplier);
2924 return pos;
2925}
2933uint8_t *VoiceAssistantRequest::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2934 uint8_t *__restrict__ pos = buffer.get_pos();
2935 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 1, this->start);
2936 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->conversation_id);
2937 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->flags);
2938 ProtoEncode::encode_optional_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 4, this->audio_settings);
2939 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->wake_word_phrase);
2940 return pos;
2941}
2943 uint32_t size = 0;
2944 size += ProtoSize::calc_bool(1, this->start);
2945 size += ProtoSize::calc_length(1, this->conversation_id.size());
2946 size += ProtoSize::calc_uint32(1, this->flags);
2948 size += ProtoSize::calc_length(1, this->wake_word_phrase.size());
2949 return size;
2950}
2952 switch (field_id) {
2953 case 1:
2954 this->port = value;
2955 break;
2956 case 2:
2957 this->error = value != 0;
2958 break;
2959 default:
2960 return false;
2961 }
2962 return true;
2963}
2965 switch (field_id) {
2966 case 1: {
2967 this->name = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2968 break;
2969 }
2970 case 2: {
2971 this->value = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2972 break;
2973 }
2974 default:
2975 return false;
2976 }
2977 return true;
2978}
2980 switch (field_id) {
2981 case 1:
2982 this->event_type = static_cast<enums::VoiceAssistantEvent>(value);
2983 break;
2984 default:
2985 return false;
2986 }
2987 return true;
2988}
2990 switch (field_id) {
2991 case 2:
2992 this->data.emplace_back();
2993 value.decode_to_message(this->data.back());
2994 break;
2995 default:
2996 return false;
2997 }
2998 return true;
2999}
3001 switch (field_id) {
3002 case 2:
3003 this->end = value != 0;
3004 break;
3005 default:
3006 return false;
3007 }
3008 return true;
3009}
3011 switch (field_id) {
3012 case 1: {
3013 this->data = value.data();
3014 this->data_len = value.size();
3015 break;
3016 }
3017 case 3: {
3018 this->data2 = value.data();
3019 this->data2_len = value.size();
3020 break;
3021 }
3022 default:
3023 return false;
3024 }
3025 return true;
3026}
3027uint8_t *VoiceAssistantAudio::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3028 uint8_t *__restrict__ pos = buffer.get_pos();
3029 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 1, this->data, this->data_len);
3030 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->end);
3031 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 3, this->data2, this->data2_len);
3032 return pos;
3033}
3035 uint32_t size = 0;
3037 size += ProtoSize::calc_bool(1, this->end);
3038 size += ProtoSize::calc_length(1, this->data2_len);
3039 return size;
3040}
3042 switch (field_id) {
3043 case 1:
3044 this->event_type = static_cast<enums::VoiceAssistantTimerEvent>(value);
3045 break;
3046 case 4:
3047 this->total_seconds = value;
3048 break;
3049 case 5:
3050 this->seconds_left = value;
3051 break;
3052 case 6:
3053 this->is_active = value != 0;
3054 break;
3055 default:
3056 return false;
3057 }
3058 return true;
3059}
3061 switch (field_id) {
3062 case 2: {
3063 this->timer_id = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3064 break;
3065 }
3066 case 3: {
3067 this->name = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3068 break;
3069 }
3070 default:
3071 return false;
3072 }
3073 return true;
3074}
3076 switch (field_id) {
3077 case 4:
3078 this->start_conversation = value != 0;
3079 break;
3080 default:
3081 return false;
3082 }
3083 return true;
3084}
3086 switch (field_id) {
3087 case 1: {
3088 this->media_id = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3089 break;
3090 }
3091 case 2: {
3092 this->text = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3093 break;
3094 }
3095 case 3: {
3096 this->preannounce_media_id = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3097 break;
3098 }
3099 default:
3100 return false;
3101 }
3102 return true;
3103}
3104uint8_t *VoiceAssistantAnnounceFinished::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3105 uint8_t *__restrict__ pos = buffer.get_pos();
3106 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 1, this->success);
3107 return pos;
3108}
3110 uint32_t size = 0;
3111 size += ProtoSize::calc_bool(1, this->success);
3112 return size;
3113}
3114uint8_t *VoiceAssistantWakeWord::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3115 uint8_t *__restrict__ pos = buffer.get_pos();
3116 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->id);
3117 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->wake_word);
3118 for (auto &it : this->trained_languages) {
3119 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 3, it, true);
3120 }
3121 return pos;
3122}
3124 uint32_t size = 0;
3125 size += ProtoSize::calc_length(1, this->id.size());
3126 size += ProtoSize::calc_length(1, this->wake_word.size());
3127 if (!this->trained_languages.empty()) {
3128 for (const auto &it : this->trained_languages) {
3129 size += ProtoSize::calc_length_force(1, it.size());
3130 }
3131 }
3132 return size;
3133}
3135 switch (field_id) {
3136 case 5:
3137 this->model_size = value;
3138 break;
3139 default:
3140 return false;
3141 }
3142 return true;
3143}
3145 switch (field_id) {
3146 case 1: {
3147 this->id = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3148 break;
3149 }
3150 case 2: {
3151 this->wake_word = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3152 break;
3153 }
3154 case 3:
3155 this->trained_languages.push_back(value.as_string());
3156 break;
3157 case 4: {
3158 this->model_type = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3159 break;
3160 }
3161 case 6: {
3162 this->model_hash = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3163 break;
3164 }
3165 case 7: {
3166 this->url = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3167 break;
3168 }
3169 default:
3170 return false;
3171 }
3172 return true;
3173}
3175 switch (field_id) {
3176 case 1:
3177 this->external_wake_words.emplace_back();
3178 value.decode_to_message(this->external_wake_words.back());
3179 break;
3180 default:
3181 return false;
3182 }
3183 return true;
3184}
3185uint8_t *VoiceAssistantConfigurationResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3186 uint8_t *__restrict__ pos = buffer.get_pos();
3187 for (auto &it : this->available_wake_words) {
3188 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 1, it);
3189 }
3190 for (const auto &it : *this->active_wake_words) {
3191 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, it, true);
3192 }
3193 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->max_active_wake_words);
3194 return pos;
3195}
3197 uint32_t size = 0;
3198 if (!this->available_wake_words.empty()) {
3199 for (const auto &it : this->available_wake_words) {
3200 size += ProtoSize::calc_message_force(1, it.calculate_size());
3201 }
3202 }
3203 if (!this->active_wake_words->empty()) {
3204 for (const auto &it : *this->active_wake_words) {
3205 size += ProtoSize::calc_length_force(1, it.size());
3206 }
3207 }
3209 return size;
3210}
3212 switch (field_id) {
3213 case 1:
3214 this->active_wake_words.push_back(value.as_string());
3215 break;
3216 default:
3217 return false;
3218 }
3219 return true;
3220}
3221#endif
3222#ifdef USE_ALARM_CONTROL_PANEL
3223uint8_t *ListEntitiesAlarmControlPanelResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3224 uint8_t *__restrict__ pos = buffer.get_pos();
3225 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3226 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3227 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3228#ifdef USE_ENTITY_ICON
3229 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3230#endif
3231 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3232 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3233 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->supported_features);
3234 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->requires_code);
3235 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 10, this->requires_code_to_arm);
3236#ifdef USE_DEVICES
3237 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, this->device_id);
3238#endif
3239 return pos;
3240}
3242 uint32_t size = 0;
3243 size += 2 + this->object_id.size();
3244 size += 5;
3245 size += 2 + this->name.size();
3246#ifdef USE_ENTITY_ICON
3247 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3248#endif
3249 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3250 size += this->entity_category ? 2 : 0;
3252 size += ProtoSize::calc_bool(1, this->requires_code);
3254#ifdef USE_DEVICES
3255 size += ProtoSize::calc_uint32(1, this->device_id);
3256#endif
3257 return size;
3258}
3259uint8_t *AlarmControlPanelStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3260 uint8_t *__restrict__ pos = buffer.get_pos();
3261 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3262 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->state));
3263#ifdef USE_DEVICES
3264 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->device_id);
3265#endif
3266 return pos;
3267}
3269 uint32_t size = 0;
3270 size += 5;
3271 size += this->state ? 2 : 0;
3272#ifdef USE_DEVICES
3273 size += ProtoSize::calc_uint32(1, this->device_id);
3274#endif
3275 return size;
3276}
3278 switch (field_id) {
3279 case 2:
3280 this->command = static_cast<enums::AlarmControlPanelStateCommand>(value);
3281 break;
3282#ifdef USE_DEVICES
3283 case 4:
3284 this->device_id = value;
3285 break;
3286#endif
3287 default:
3288 return false;
3289 }
3290 return true;
3291}
3293 switch (field_id) {
3294 case 3: {
3295 this->code = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3296 break;
3297 }
3298 default:
3299 return false;
3300 }
3301 return true;
3302}
3304 switch (field_id) {
3305 case 1:
3306 this->key = value.as_fixed32();
3307 break;
3308 default:
3309 return false;
3310 }
3311 return true;
3312}
3313#endif
3314#ifdef USE_TEXT
3315uint8_t *ListEntitiesTextResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3316 uint8_t *__restrict__ pos = buffer.get_pos();
3317 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3318 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3319 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3320#ifdef USE_ENTITY_ICON
3321 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3322#endif
3323 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3324 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3325 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->min_length);
3326 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->max_length);
3327 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 10, this->pattern);
3328 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, static_cast<uint32_t>(this->mode));
3329#ifdef USE_DEVICES
3330 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, this->device_id);
3331#endif
3332 return pos;
3333}
3335 uint32_t size = 0;
3336 size += 2 + this->object_id.size();
3337 size += 5;
3338 size += 2 + this->name.size();
3339#ifdef USE_ENTITY_ICON
3340 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3341#endif
3342 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3343 size += this->entity_category ? 2 : 0;
3344 size += ProtoSize::calc_uint32(1, this->min_length);
3345 size += ProtoSize::calc_uint32(1, this->max_length);
3346 size += ProtoSize::calc_length(1, this->pattern.size());
3347 size += this->mode ? 2 : 0;
3348#ifdef USE_DEVICES
3349 size += ProtoSize::calc_uint32(1, this->device_id);
3350#endif
3351 return size;
3352}
3353uint8_t *TextStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3354 uint8_t *__restrict__ pos = buffer.get_pos();
3355 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3356 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
3357 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->missing_state);
3358#ifdef USE_DEVICES
3359 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
3360#endif
3361 return pos;
3362}
3364 uint32_t size = 0;
3365 size += 5;
3366 size += ProtoSize::calc_length(1, this->state.size());
3367 size += ProtoSize::calc_bool(1, this->missing_state);
3368#ifdef USE_DEVICES
3369 size += ProtoSize::calc_uint32(1, this->device_id);
3370#endif
3371 return size;
3372}
3374 switch (field_id) {
3375#ifdef USE_DEVICES
3376 case 3:
3377 this->device_id = value;
3378 break;
3379#endif
3380 default:
3381 return false;
3382 }
3383 return true;
3384}
3386 switch (field_id) {
3387 case 2: {
3388 this->state = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3389 break;
3390 }
3391 default:
3392 return false;
3393 }
3394 return true;
3395}
3397 switch (field_id) {
3398 case 1:
3399 this->key = value.as_fixed32();
3400 break;
3401 default:
3402 return false;
3403 }
3404 return true;
3405}
3406#endif
3407#ifdef USE_DATETIME_DATE
3408uint8_t *ListEntitiesDateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3409 uint8_t *__restrict__ pos = buffer.get_pos();
3410 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3411 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3412 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3413#ifdef USE_ENTITY_ICON
3414 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3415#endif
3416 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3417 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3418#ifdef USE_DEVICES
3419 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_id);
3420#endif
3421 return pos;
3422}
3424 uint32_t size = 0;
3425 size += 2 + this->object_id.size();
3426 size += 5;
3427 size += 2 + this->name.size();
3428#ifdef USE_ENTITY_ICON
3429 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3430#endif
3431 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3432 size += this->entity_category ? 2 : 0;
3433#ifdef USE_DEVICES
3434 size += ProtoSize::calc_uint32(1, this->device_id);
3435#endif
3436 return size;
3437}
3438uint8_t *DateStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3439 uint8_t *__restrict__ pos = buffer.get_pos();
3440 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3441 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->missing_state);
3442 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->year);
3443 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->month);
3444 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->day);
3445#ifdef USE_DEVICES
3446 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, this->device_id);
3447#endif
3448 return pos;
3449}
3451 uint32_t size = 0;
3452 size += 5;
3454 size += ProtoSize::calc_uint32(1, this->year);
3455 size += ProtoSize::calc_uint32(1, this->month);
3456 size += ProtoSize::calc_uint32(1, this->day);
3457#ifdef USE_DEVICES
3458 size += ProtoSize::calc_uint32(1, this->device_id);
3459#endif
3460 return size;
3461}
3463 switch (field_id) {
3464 case 2:
3465 this->year = value;
3466 break;
3467 case 3:
3468 this->month = value;
3469 break;
3470 case 4:
3471 this->day = value;
3472 break;
3473#ifdef USE_DEVICES
3474 case 5:
3475 this->device_id = value;
3476 break;
3477#endif
3478 default:
3479 return false;
3480 }
3481 return true;
3482}
3484 switch (field_id) {
3485 case 1:
3486 this->key = value.as_fixed32();
3487 break;
3488 default:
3489 return false;
3490 }
3491 return true;
3492}
3493#endif
3494#ifdef USE_DATETIME_TIME
3495uint8_t *ListEntitiesTimeResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3496 uint8_t *__restrict__ pos = buffer.get_pos();
3497 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3498 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3499 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3500#ifdef USE_ENTITY_ICON
3501 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3502#endif
3503 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3504 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3505#ifdef USE_DEVICES
3506 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_id);
3507#endif
3508 return pos;
3509}
3511 uint32_t size = 0;
3512 size += 2 + this->object_id.size();
3513 size += 5;
3514 size += 2 + this->name.size();
3515#ifdef USE_ENTITY_ICON
3516 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3517#endif
3518 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3519 size += this->entity_category ? 2 : 0;
3520#ifdef USE_DEVICES
3521 size += ProtoSize::calc_uint32(1, this->device_id);
3522#endif
3523 return size;
3524}
3525uint8_t *TimeStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3526 uint8_t *__restrict__ pos = buffer.get_pos();
3527 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3528 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->missing_state);
3529 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->hour);
3530 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->minute);
3531 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->second);
3532#ifdef USE_DEVICES
3533 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, this->device_id);
3534#endif
3535 return pos;
3536}
3538 uint32_t size = 0;
3539 size += 5;
3541 size += ProtoSize::calc_uint32(1, this->hour);
3542 size += ProtoSize::calc_uint32(1, this->minute);
3543 size += ProtoSize::calc_uint32(1, this->second);
3544#ifdef USE_DEVICES
3545 size += ProtoSize::calc_uint32(1, this->device_id);
3546#endif
3547 return size;
3548}
3550 switch (field_id) {
3551 case 2:
3552 this->hour = value;
3553 break;
3554 case 3:
3555 this->minute = value;
3556 break;
3557 case 4:
3558 this->second = value;
3559 break;
3560#ifdef USE_DEVICES
3561 case 5:
3562 this->device_id = value;
3563 break;
3564#endif
3565 default:
3566 return false;
3567 }
3568 return true;
3569}
3571 switch (field_id) {
3572 case 1:
3573 this->key = value.as_fixed32();
3574 break;
3575 default:
3576 return false;
3577 }
3578 return true;
3579}
3580#endif
3581#ifdef USE_EVENT
3582uint8_t *ListEntitiesEventResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3583 uint8_t *__restrict__ pos = buffer.get_pos();
3584 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3585 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3586 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3587#ifdef USE_ENTITY_ICON
3588 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3589#endif
3590 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3591 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3592 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
3593 for (const char *it : *this->event_types) {
3594 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 9, it, strlen(it), true);
3595 }
3596#ifdef USE_DEVICES
3597 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, this->device_id);
3598#endif
3599 return pos;
3600}
3602 uint32_t size = 0;
3603 size += 2 + this->object_id.size();
3604 size += 5;
3605 size += 2 + this->name.size();
3606#ifdef USE_ENTITY_ICON
3607 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3608#endif
3609 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3610 size += this->entity_category ? 2 : 0;
3611 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
3612 if (!this->event_types->empty()) {
3613 for (const char *it : *this->event_types) {
3614 size += ProtoSize::calc_length_force(1, strlen(it));
3615 }
3616 }
3617#ifdef USE_DEVICES
3619#endif
3620 return size;
3621}
3622uint8_t *EventResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3623 uint8_t *__restrict__ pos = buffer.get_pos();
3624 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3625 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->event_type);
3626#ifdef USE_DEVICES
3627 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->device_id);
3628#endif
3629 return pos;
3630}
3632 uint32_t size = 0;
3633 size += 5;
3635#ifdef USE_DEVICES
3636 size += ProtoSize::calc_uint32(1, this->device_id);
3637#endif
3638 return size;
3639}
3640#endif
3641#ifdef USE_VALVE
3642uint8_t *ListEntitiesValveResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3643 uint8_t *__restrict__ pos = buffer.get_pos();
3644 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3645 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3646 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3647#ifdef USE_ENTITY_ICON
3648 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3649#endif
3650 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3651 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3652 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
3653 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->assumed_state);
3654 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 10, this->supports_position);
3655 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 11, this->supports_stop);
3656#ifdef USE_DEVICES
3657 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, this->device_id);
3658#endif
3659 return pos;
3660}
3662 uint32_t size = 0;
3663 size += 2 + this->object_id.size();
3664 size += 5;
3665 size += 2 + this->name.size();
3666#ifdef USE_ENTITY_ICON
3667 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3668#endif
3669 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3670 size += this->entity_category ? 2 : 0;
3671 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
3672 size += ProtoSize::calc_bool(1, this->assumed_state);
3673 size += ProtoSize::calc_bool(1, this->supports_position);
3674 size += ProtoSize::calc_bool(1, this->supports_stop);
3675#ifdef USE_DEVICES
3676 size += ProtoSize::calc_uint32(1, this->device_id);
3677#endif
3678 return size;
3679}
3680uint8_t *ValveStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3681 uint8_t *__restrict__ pos = buffer.get_pos();
3682 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3683 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 2, this->position);
3684 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, static_cast<uint32_t>(this->current_operation));
3685#ifdef USE_DEVICES
3686 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
3687#endif
3688 return pos;
3689}
3691 uint32_t size = 0;
3692 size += 5;
3693 size += ProtoSize::calc_float(1, this->position);
3694 size += this->current_operation ? 2 : 0;
3695#ifdef USE_DEVICES
3696 size += ProtoSize::calc_uint32(1, this->device_id);
3697#endif
3698 return size;
3699}
3701 switch (field_id) {
3702 case 2:
3703 this->has_position = value != 0;
3704 break;
3705 case 4:
3706 this->stop = value != 0;
3707 break;
3708#ifdef USE_DEVICES
3709 case 5:
3710 this->device_id = value;
3711 break;
3712#endif
3713 default:
3714 return false;
3715 }
3716 return true;
3717}
3719 switch (field_id) {
3720 case 1:
3721 this->key = value.as_fixed32();
3722 break;
3723 case 3:
3724 this->position = value.as_float();
3725 break;
3726 default:
3727 return false;
3728 }
3729 return true;
3730}
3731#endif
3732#ifdef USE_DATETIME_DATETIME
3733uint8_t *ListEntitiesDateTimeResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3734 uint8_t *__restrict__ pos = buffer.get_pos();
3735 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3736 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3737 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3738#ifdef USE_ENTITY_ICON
3739 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3740#endif
3741 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3742 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3743#ifdef USE_DEVICES
3744 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_id);
3745#endif
3746 return pos;
3747}
3749 uint32_t size = 0;
3750 size += 2 + this->object_id.size();
3751 size += 5;
3752 size += 2 + this->name.size();
3753#ifdef USE_ENTITY_ICON
3754 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3755#endif
3756 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3757 size += this->entity_category ? 2 : 0;
3758#ifdef USE_DEVICES
3759 size += ProtoSize::calc_uint32(1, this->device_id);
3760#endif
3761 return size;
3762}
3763uint8_t *DateTimeStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3764 uint8_t *__restrict__ pos = buffer.get_pos();
3765 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3766 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->missing_state);
3767 ProtoEncode::encode_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->epoch_seconds);
3768#ifdef USE_DEVICES
3769 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
3770#endif
3771 return pos;
3772}
3774 uint32_t size = 0;
3775 size += 5;
3777 size += ProtoSize::calc_fixed32(1, this->epoch_seconds);
3778#ifdef USE_DEVICES
3779 size += ProtoSize::calc_uint32(1, this->device_id);
3780#endif
3781 return size;
3782}
3784 switch (field_id) {
3785#ifdef USE_DEVICES
3786 case 3:
3787 this->device_id = value;
3788 break;
3789#endif
3790 default:
3791 return false;
3792 }
3793 return true;
3794}
3796 switch (field_id) {
3797 case 1:
3798 this->key = value.as_fixed32();
3799 break;
3800 case 2:
3801 this->epoch_seconds = value.as_fixed32();
3802 break;
3803 default:
3804 return false;
3805 }
3806 return true;
3807}
3808#endif
3809#ifdef USE_UPDATE
3810uint8_t *ListEntitiesUpdateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3811 uint8_t *__restrict__ pos = buffer.get_pos();
3812 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3813 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3814 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3815#ifdef USE_ENTITY_ICON
3816 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3817#endif
3818 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3819 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3820 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
3821#ifdef USE_DEVICES
3822 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->device_id);
3823#endif
3824 return pos;
3825}
3827 uint32_t size = 0;
3828 size += 2 + this->object_id.size();
3829 size += 5;
3830 size += 2 + this->name.size();
3831#ifdef USE_ENTITY_ICON
3832 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3833#endif
3834 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3835 size += this->entity_category ? 2 : 0;
3836 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
3837#ifdef USE_DEVICES
3838 size += ProtoSize::calc_uint32(1, this->device_id);
3839#endif
3840 return size;
3841}
3842uint8_t *UpdateStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3843 uint8_t *__restrict__ pos = buffer.get_pos();
3844 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3845 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->missing_state);
3846 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->in_progress);
3847 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 4, this->has_progress);
3848 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 5, this->progress);
3849 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 6, this->current_version);
3850 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 7, this->latest_version);
3851 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->title);
3852 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 9, this->release_summary);
3853 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 10, this->release_url);
3854#ifdef USE_DEVICES
3855 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, this->device_id);
3856#endif
3857 return pos;
3858}
3860 uint32_t size = 0;
3861 size += 5;
3863 size += ProtoSize::calc_bool(1, this->in_progress);
3864 size += ProtoSize::calc_bool(1, this->has_progress);
3865 size += ProtoSize::calc_float(1, this->progress);
3866 size += ProtoSize::calc_length(1, this->current_version.size());
3867 size += ProtoSize::calc_length(1, this->latest_version.size());
3868 size += ProtoSize::calc_length(1, this->title.size());
3869 size += ProtoSize::calc_length(1, this->release_summary.size());
3870 size += ProtoSize::calc_length(1, this->release_url.size());
3871#ifdef USE_DEVICES
3872 size += ProtoSize::calc_uint32(1, this->device_id);
3873#endif
3874 return size;
3875}
3877 switch (field_id) {
3878 case 2:
3879 this->command = static_cast<enums::UpdateCommand>(value);
3880 break;
3881#ifdef USE_DEVICES
3882 case 3:
3883 this->device_id = value;
3884 break;
3885#endif
3886 default:
3887 return false;
3888 }
3889 return true;
3890}
3892 switch (field_id) {
3893 case 1:
3894 this->key = value.as_fixed32();
3895 break;
3896 default:
3897 return false;
3898 }
3899 return true;
3900}
3901#endif
3902#ifdef USE_ZWAVE_PROXY
3904 switch (field_id) {
3905 case 1: {
3906 this->data = value.data();
3907 this->data_len = value.size();
3908 break;
3909 }
3910 default:
3911 return false;
3912 }
3913 return true;
3914}
3915__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
3916uint8_t *
3917ZWaveProxyFrame::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3918 uint8_t *__restrict__ pos = buffer.get_pos();
3919 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 1, this->data, this->data_len);
3920 return pos;
3921}
3922__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
3924ZWaveProxyFrame::calculate_size() const {
3925 uint32_t size = 0;
3926 size += ProtoSize::calc_length(1, this->data_len);
3927 return size;
3928}
3930 switch (field_id) {
3931 case 1:
3932 this->type = static_cast<enums::ZWaveProxyRequestType>(value);
3933 break;
3934 default:
3935 return false;
3936 }
3937 return true;
3938}
3940 switch (field_id) {
3941 case 2: {
3942 this->data = value.data();
3943 this->data_len = value.size();
3944 break;
3945 }
3946 default:
3947 return false;
3948 }
3949 return true;
3950}
3951uint8_t *ZWaveProxyRequest::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3952 uint8_t *__restrict__ pos = buffer.get_pos();
3953 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, static_cast<uint32_t>(this->type));
3954 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 2, this->data, this->data_len);
3955 return pos;
3956}
3958 uint32_t size = 0;
3959 size += this->type ? 2 : 0;
3960 size += ProtoSize::calc_length(1, this->data_len);
3961 return size;
3962}
3963uint8_t *ZWaveProxyRequestResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3964 uint8_t *__restrict__ pos = buffer.get_pos();
3965 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, static_cast<uint32_t>(this->type));
3966 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->status));
3967 return pos;
3968}
3970 uint32_t size = 0;
3971 size += this->type ? 2 : 0;
3972 size += this->status ? 2 : 0;
3973 return size;
3974}
3975#endif
3976#ifdef USE_INFRARED
3977uint8_t *ListEntitiesInfraredResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3978 uint8_t *__restrict__ pos = buffer.get_pos();
3979 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3980 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3981 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3982#ifdef USE_ENTITY_ICON
3983 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 4, this->icon);
3984#endif
3985 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->disabled_by_default);
3986 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, static_cast<uint32_t>(this->entity_category));
3987#ifdef USE_DEVICES
3988 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, this->device_id);
3989#endif
3990 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->capabilities);
3991 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->receiver_frequency);
3992 return pos;
3993}
3995 uint32_t size = 0;
3996 size += 2 + this->object_id.size();
3997 size += 5;
3998 size += 2 + this->name.size();
3999#ifdef USE_ENTITY_ICON
4000 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
4001#endif
4002 size += ProtoSize::calc_bool(1, this->disabled_by_default);
4003 size += this->entity_category ? 2 : 0;
4004#ifdef USE_DEVICES
4005 size += ProtoSize::calc_uint32(1, this->device_id);
4006#endif
4007 size += ProtoSize::calc_uint32(1, this->capabilities);
4009 return size;
4010}
4011#endif
4012#if defined(USE_IR_RF) || defined(USE_RADIO_FREQUENCY)
4014 switch (field_id) {
4015#ifdef USE_DEVICES
4016 case 1:
4017 this->device_id = value;
4018 break;
4019#endif
4020 case 3:
4021 this->carrier_frequency = value;
4022 break;
4023 case 4:
4024 this->repeat_count = value;
4025 break;
4026 case 6:
4027 this->modulation = value;
4028 break;
4029 default:
4030 return false;
4031 }
4032 return true;
4033}
4035 switch (field_id) {
4036 case 5: {
4037 this->timings_data_ = value.data();
4038 this->timings_length_ = value.size();
4039 this->timings_count_ = count_packed_varints(value.data(), value.size());
4040 break;
4041 }
4042 default:
4043 return false;
4044 }
4045 return true;
4046}
4048 switch (field_id) {
4049 case 2:
4050 this->key = value.as_fixed32();
4051 break;
4052 default:
4053 return false;
4054 }
4055 return true;
4056}
4057__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
4058uint8_t *
4059InfraredRFReceiveEvent::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
4060 uint8_t *__restrict__ pos = buffer.get_pos();
4061#ifdef USE_DEVICES
4062 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->device_id);
4063#endif
4064 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
4065 for (const auto &it : *this->timings) {
4066 ProtoEncode::encode_sint32(pos PROTO_ENCODE_DEBUG_ARG, 3, it, true);
4067 }
4068 return pos;
4069}
4070__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
4072InfraredRFReceiveEvent::calculate_size() const {
4073 uint32_t size = 0;
4074#ifdef USE_DEVICES
4075 size += ProtoSize::calc_uint32(1, this->device_id);
4076#endif
4077 size += 5;
4078 if (!this->timings->empty()) {
4079 for (const auto &it : *this->timings) {
4081 }
4082 }
4083 return size;
4084}
4085#endif
4086#ifdef USE_RADIO_FREQUENCY
4087uint8_t *ListEntitiesRadioFrequencyResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
4088 uint8_t *__restrict__ pos = buffer.get_pos();
4089 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
4090 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
4091 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
4092#ifdef USE_ENTITY_ICON
4093 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 4, this->icon);
4094#endif
4095 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->disabled_by_default);
4096 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, static_cast<uint32_t>(this->entity_category));
4097#ifdef USE_DEVICES
4098 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, this->device_id);
4099#endif
4100 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->capabilities);
4101 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->frequency_min);
4102 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, this->frequency_max);
4103 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, this->supported_modulations);
4104 return pos;
4105}
4107 uint32_t size = 0;
4108 size += 2 + this->object_id.size();
4109 size += 5;
4110 size += 2 + this->name.size();
4111#ifdef USE_ENTITY_ICON
4112 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
4113#endif
4114 size += ProtoSize::calc_bool(1, this->disabled_by_default);
4115 size += this->entity_category ? 2 : 0;
4116#ifdef USE_DEVICES
4117 size += ProtoSize::calc_uint32(1, this->device_id);
4118#endif
4119 size += ProtoSize::calc_uint32(1, this->capabilities);
4120 size += ProtoSize::calc_uint32(1, this->frequency_min);
4121 size += ProtoSize::calc_uint32(1, this->frequency_max);
4123 return size;
4124}
4125#endif
4126#ifdef USE_SERIAL_PROXY
4128 switch (field_id) {
4129 case 1:
4130 this->instance = value;
4131 break;
4132 case 2:
4133 this->baudrate = value;
4134 break;
4135 case 3:
4136 this->flow_control = value != 0;
4137 break;
4138 case 4:
4139 this->parity = static_cast<enums::SerialProxyParity>(value);
4140 break;
4141 case 5:
4142 this->stop_bits = value;
4143 break;
4144 case 6:
4145 this->data_size = value;
4146 break;
4147 default:
4148 return false;
4149 }
4150 return true;
4151}
4152__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
4153uint8_t *
4154SerialProxyDataReceived::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
4155 uint8_t *__restrict__ pos = buffer.get_pos();
4156 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->instance);
4157 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 2, this->data_ptr_, this->data_len_);
4158 return pos;
4159}
4160__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
4162SerialProxyDataReceived::calculate_size() const {
4163 uint32_t size = 0;
4164 size += ProtoSize::calc_uint32(1, this->instance);
4165 size += ProtoSize::calc_length(1, this->data_len_);
4166 return size;
4167}
4169 switch (field_id) {
4170 case 1:
4171 this->instance = value;
4172 break;
4173 default:
4174 return false;
4175 }
4176 return true;
4177}
4179 switch (field_id) {
4180 case 2: {
4181 this->data = value.data();
4182 this->data_len = value.size();
4183 break;
4184 }
4185 default:
4186 return false;
4187 }
4188 return true;
4189}
4191 switch (field_id) {
4192 case 1:
4193 this->instance = value;
4194 break;
4195 case 2:
4196 this->line_states = value;
4197 break;
4198 default:
4199 return false;
4200 }
4201 return true;
4202}
4204 switch (field_id) {
4205 case 1:
4206 this->instance = value;
4207 break;
4208 default:
4209 return false;
4210 }
4211 return true;
4212}
4213uint8_t *SerialProxyGetModemPinsResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
4214 uint8_t *__restrict__ pos = buffer.get_pos();
4215 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->instance);
4216 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->line_states);
4217 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, static_cast<uint32_t>(this->status));
4218 return pos;
4219}
4221 uint32_t size = 0;
4223 size += ProtoSize::calc_uint32(1, this->line_states);
4224 size += this->status ? 2 : 0;
4225 return size;
4226}
4228 switch (field_id) {
4229 case 1:
4230 this->instance = value;
4231 break;
4232 case 2:
4233 this->type = static_cast<enums::SerialProxyRequestType>(value);
4234 break;
4235 default:
4236 return false;
4237 }
4238 return true;
4239}
4240uint8_t *SerialProxyRequestResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
4241 uint8_t *__restrict__ pos = buffer.get_pos();
4242 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->instance);
4243 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->type));
4244 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, static_cast<uint32_t>(this->status));
4245 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 4, this->error_message);
4246 return pos;
4247}
4249 uint32_t size = 0;
4251 size += this->type ? 2 : 0;
4252 size += this->status ? 2 : 0;
4253 size += ProtoSize::calc_length(1, this->error_message.size());
4254 return size;
4255}
4256#endif
4257#ifdef USE_BLUETOOTH_PROXY_CONNECTIONS
4259 switch (field_id) {
4260 case 1:
4261 this->address = value;
4262 break;
4263 case 2:
4264 this->min_interval = value;
4265 break;
4266 case 3:
4267 this->max_interval = value;
4268 break;
4269 case 4:
4270 this->latency = value;
4271 break;
4272 case 5:
4273 this->timeout = value;
4274 break;
4275 default:
4276 return false;
4277 }
4278 return true;
4279}
4280uint8_t *BluetoothSetConnectionParamsResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
4281 uint8_t *__restrict__ pos = buffer.get_pos();
4282 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
4283 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->error);
4284 return pos;
4285}
4287 uint32_t size = 0;
4288 size += ProtoSize::calc_uint64(1, this->address);
4289 size += ProtoSize::calc_int32(1, this->error);
4290 return size;
4291}
4292#endif
4293
4294} // namespace esphome::api
constexpr bool empty() const
Check if the set is empty.
constexpr size_t size() const
Count the number of values in the set.
bool empty() const
Definition helpers.h:712
void push_back(const T &value)
Add element without bounds checking Caller must ensure sufficient capacity was allocated via init() S...
Definition helpers.h:662
void init(size_t n)
Definition helpers.h:635
StringRef is a reference to a string owned by something else.
Definition string_ref.h:26
constexpr bool empty() const
Definition string_ref.h:76
constexpr size_type size() const
Definition string_ref.h:74
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3303
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3277
enums::AlarmControlPanelStateCommand command
Definition api_pb2.h:2742
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3292
enums::AlarmControlPanelState state
Definition api_pb2.h:2726
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3259
uint32_t calculate_size() const
Definition api_pb2.cpp:77
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:71
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:357
std::array< uint64_t, BLUETOOTH_PROXY_MAX_CONNECTIONS > allocated
Definition api_pb2.h:2298
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2776
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2864
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2521
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2836
enums::BluetoothDeviceRequestType request_type
Definition api_pb2.h:2036
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2850
FixedVector< BluetoothGATTDescriptor > descriptors
Definition api_pb2.h:2098
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:2095
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2567
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2547
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:2082
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2798
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2643
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2537
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2625
std::vector< BluetoothGATTService > services
Definition api_pb2.h:2130
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2762
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2746
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2824
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2708
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2653
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2666
FixedVector< BluetoothGATTCharacteristic > characteristics
Definition api_pb2.h:2112
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2597
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:2110
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2721
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2734
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2696
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2680
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2812
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:247
enums::BluetoothScannerMode mode
Definition api_pb2.h:2440
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2894
enums::BluetoothScannerMode mode
Definition api_pb2.h:2423
enums::BluetoothScannerState state
Definition api_pb2.h:2422
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2880
enums::BluetoothScannerMode configured_mode
Definition api_pb2.h:2424
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:4258
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:4280
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2292
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2304
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1503
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1483
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1725
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1563
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1561
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1656
enums::ClimatePreset preset
Definition api_pb2.h:1567
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1710
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1530
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1531
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1614
enums::ClimateAction action
Definition api_pb2.h:1529
enums::ClimatePreset preset
Definition api_pb2.h:1533
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:462
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:441
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:419
enums::CoverOperation current_operation
Definition api_pb2.h:766
uint32_t calculate_size() const
Definition api_pb2.cpp:430
enums::DSTRuleType type
Definition api_pb2.h:1272
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1201
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3483
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3462
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3438
uint32_t calculate_size() const
Definition api_pb2.cpp:3450
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3783
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3795
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3763
std::array< SerialProxyInfo, SERIAL_PROXY_COUNT > serial_proxies
Definition api_pb2.h:677
VoiceAssistantCapabilities voice_assistant
Definition api_pb2.h:671
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:286
ZWaveProxyCapabilities zwave_proxy
Definition api_pb2.h:674
BluetoothProxyCapabilities bluetooth_proxy
Definition api_pb2.h:668
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:85
uint32_t calculate_size() const
Definition api_pb2.cpp:92
uint32_t calculate_size() const
Definition api_pb2.cpp:181
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:116
std::array< AreaInfo, ESPHOME_AREA_COUNT > areas
Definition api_pb2.h:594
std::array< SerialProxyInfo, SERIAL_PROXY_COUNT > serial_proxies
Definition api_pb2.h:606
std::array< DeviceInfo, ESPHOME_DEVICE_COUNT > devices
Definition api_pb2.h:591
uint32_t calculate_size() const
Definition api_pb2.cpp:65
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:50
enums::DisconnectReason reason
Definition api_pb2.h:456
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:60
uint32_t calculate_size() const
Definition api_pb2.cpp:3631
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3622
FixedVector< float > float_array
Definition api_pb2.h:1365
FixedVector< std::string > string_array
Definition api_pb2.h:1366
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1326
void decode(const uint8_t *buffer, size_t length)
Definition api_pb2.cpp:1375
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1348
FixedVector< int32_t > int_array
Definition api_pb2.h:1364
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1362
FixedVector< ExecuteServiceArgument > args
Definition api_pb2.h:1385
void decode(const uint8_t *buffer, size_t length)
Definition api_pb2.cpp:1424
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1386
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1414
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1403
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1431
enums::FanDirection direction
Definition api_pb2.h:849
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:591
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:552
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:602
enums::FanDirection direction
Definition api_pb2.h:826
uint32_t calculate_size() const
Definition api_pb2.cpp:539
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:526
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1263
ParsedTimezone parsed_timezone
Definition api_pb2.h:1305
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1252
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:10
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:23
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:34
uint32_t calculate_size() const
Definition api_pb2.cpp:42
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1181
FixedVector< HomeassistantServiceMap > variables
Definition api_pb2.h:1174
FixedVector< HomeassistantServiceMap > data
Definition api_pb2.h:1172
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1078
FixedVector< HomeassistantServiceMap > data_template
Definition api_pb2.h:1173
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1147
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1134
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1066
enums::EntityCategory entity_category
Definition api_pb2.h:382
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:4047
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:4013
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:4034
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:762
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:773
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:702
uint32_t calculate_size() const
Definition api_pb2.cpp:682
enums::ColorMode color_mode
Definition api_pb2.h:893
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:662
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3223
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:323
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2260
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1453
const std::vector< const char * > * supported_custom_presets
Definition api_pb2.h:1501
const climate::ClimateSwingModeMask * supported_swing_modes
Definition api_pb2.h:1498
enums::TemperatureUnit temperature_unit
Definition api_pb2.h:1508
const std::vector< const char * > * supported_custom_fan_modes
Definition api_pb2.h:1499
const climate::ClimatePresetMask * supported_presets
Definition api_pb2.h:1500
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1518
const climate::ClimateFanModeMask * supported_fan_modes
Definition api_pb2.h:1497
const climate::ClimateModeMask * supported_modes
Definition api_pb2.h:1492
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:379
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3408
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3733
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3582
const FixedVector< const char * > * event_types
Definition api_pb2.h:2926
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:480
const std::vector< const char * > * supported_preset_modes
Definition api_pb2.h:808
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3977
const FixedVector< const char * > * effects
Definition api_pb2.h:875
const light::ColorModeMask * supported_color_modes
Definition api_pb2.h:872
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:614
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2163
std::vector< MediaPlayerSupportedFormat > supported_formats
Definition api_pb2.h:1927
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2334
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1865
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
const FixedVector< const char * > * options
Definition api_pb2.h:1711
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1954
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:812
enums::SensorStateClass state_class
Definition api_pb2.h:966
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1274
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1298
enums::SupportsResponseType supports_response
Definition api_pb2.h:1344
FixedVector< ListEntitiesServicesArgument > args
Definition api_pb2.h:1343
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2047
const FixedVector< const char * > * tones
Definition api_pb2.h:1763
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3315
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:957
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3495
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3810
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3642
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1749
const water_heater::WaterHeaterModeMask * supported_modes
Definition api_pb2.h:1593
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2219
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2248
enums::LockCommand command
Definition api_pb2.h:1858
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2237
uint32_t calculate_size() const
Definition api_pb2.cpp:2210
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2201
enums::MediaPlayerCommand command
Definition api_pb2.h:1963
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2437
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2426
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2396
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2374
enums::MediaPlayerState state
Definition api_pb2.h:1944
enums::MediaPlayerFormatPurpose purpose
Definition api_pb2.h:1910
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2316
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1054
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1939
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1927
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1907
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1239
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1226
uint32_t as_fixed32() const
Definition proto.h:194
float as_float() const
Definition proto.h:196
void decode(const uint8_t *buffer, size_t length)
Definition proto.cpp:213
static uint32_t count_repeated_field(const uint8_t *buffer, size_t length, uint32_t target_field_id)
Count occurrences of a repeated field in a protobuf buffer.
Definition proto.cpp:60
static void encode_bool(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, bool value, bool force=false)
Definition proto.h:464
static void encode_string(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const char *string, size_t len, bool force=false)
Definition proto.h:422
static void encode_sint32(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int32_t value, bool force=false)
Definition proto.h:512
static void ESPHOME_ALWAYS_INLINE encode_varint_raw_short(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t value)
Encode a varint that is expected to be 1-2 bytes (e.g. zigzag RSSI, small lengths).
Definition proto.h:321
static void ESPHOME_ALWAYS_INLINE write_raw_byte(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint8_t b)
Write a single precomputed tag byte. Tag must be < 128.
Definition proto.h:376
static void encode_float(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, float value, bool force=false)
Definition proto.h:492
static void encode_short_string_force(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint8_t tag, const StringRef &ref)
Encode tag + 1-byte length + raw string data.
Definition proto.h:396
static void ESPHOME_ALWAYS_INLINE write_tag_and_fixed32(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint8_t tag, uint32_t value)
Write a precomputed tag byte + 32-bit value in one operation.
Definition proto.h:408
static void encode_optional_sub_message(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, ProtoWriteBuffer &buffer, uint32_t field_id, const T &value)
Definition proto.h:529
static void encode_sub_message(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, ProtoWriteBuffer &buffer, uint32_t field_id, const T &value)
Sub-message encoding: sync pos to buffer, delegate, get pos from return value.
Definition proto.h:522
static void ESPHOME_ALWAYS_INLINE encode_varint_raw_48bit(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint64_t value)
Encode a 48-bit MAC address (stored in a uint64) as varint.
Definition proto.h:350
static void ESPHOME_ALWAYS_INLINE reserve_byte(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM)
Reserve one byte for later backpatch (e.g., sub-message length).
Definition proto.h:383
static void ESPHOME_ALWAYS_INLINE encode_raw(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, const void *data, size_t len)
Write raw bytes to the buffer (no tag, no length prefix).
Definition proto.h:388
static void encode_fixed32(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t value, bool force=false)
Definition proto.h:472
static void ESPHOME_ALWAYS_INLINE encode_varint_raw(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t value)
Definition proto.h:311
static void encode_uint64(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint64_t value, bool force=false)
Definition proto.h:457
static void encode_int32(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int32_t value, bool force=false)
Definition proto.h:499
static void encode_bytes(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const uint8_t *data, size_t len, bool force=false)
Definition proto.h:446
static void encode_uint32(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t value, bool force=false)
Definition proto.h:450
void decode_to_message(T &msg) const
Decode the length-delimited data into a message instance.
Definition proto.h:895
const uint8_t * data() const
Definition proto.h:179
std::string as_string() const
Definition proto.h:176
static constexpr uint32_t calc_uint64(uint32_t field_id_size, uint64_t value)
Definition proto.h:836
static constexpr uint32_t calc_bool(uint32_t field_id_size, bool value)
Definition proto.h:813
static constexpr uint32_t calc_message(uint32_t field_id_size, uint32_t nested_size)
Definition proto.h:868
static constexpr uint32_t ESPHOME_ALWAYS_INLINE calc_uint64_force(uint32_t field_id_size, uint64_t value)
Definition proto.h:839
static constexpr uint32_t ESPHOME_ALWAYS_INLINE calc_uint64_48bit_force(uint32_t field_id_size, uint64_t value)
48-bit MAC address variant: matches encode_varint_raw_48bit's fast path.
Definition proto.h:846
static constexpr uint32_t calc_uint32(uint32_t field_id_size, uint32_t value)
Definition proto.h:807
static constexpr uint32_t calc_length(uint32_t field_id_size, size_t len)
Definition proto.h:850
static constexpr uint32_t calc_int32(uint32_t field_id_size, int32_t value)
Definition proto.h:801
static constexpr uint32_t ESPHOME_ALWAYS_INLINE calc_length_force(uint32_t field_id_size, size_t len)
Definition proto.h:853
static uint32_t calc_float(uint32_t field_id_size, float value)
Definition proto.h:815
static constexpr uint32_t calc_fixed32(uint32_t field_id_size, uint32_t value)
Definition proto.h:818
static constexpr uint32_t ESPHOME_ALWAYS_INLINE calc_message_force(uint32_t field_id_size, uint32_t nested_size)
Definition proto.h:871
static constexpr uint32_t ESPHOME_ALWAYS_INLINE calc_sint32_force(uint32_t field_id_size, int32_t value)
Definition proto.h:827
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2024
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2012
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2035
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1992
enums::SerialProxyParity parity
Definition api_pb2.h:3272
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:4203
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:4213
uint32_t calculate_size() const
Definition api_pb2.cpp:108
enums::SerialProxyPortType port_type
Definition api_pb2.h:538
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:101
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:4227
enums::SerialProxyRequestType type
Definition api_pb2.h:3379
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:4240
enums::SerialProxyRequestType type
Definition api_pb2.h:3395
enums::SerialProxyStatus status
Definition api_pb2.h:3396
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:4190
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:4178
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2107
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2137
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2148
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2089
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2452
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1167
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1010
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2906
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:945
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3385
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3373
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3396
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:989
uint32_t calculate_size() const
Definition api_pb2.cpp:3363
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3353
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3570
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3549
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3525
uint32_t calculate_size() const
Definition api_pb2.cpp:3537
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3891
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3876
enums::UpdateCommand command
Definition api_pb2.h:3106
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3842
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3700
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3718
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3680
enums::ValveOperation current_operation
Definition api_pb2.h:2980
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3104
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3085
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3075
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3000
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3010
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3027
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2919
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:261
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3174
std::vector< VoiceAssistantExternalWakeWord > external_wake_words
Definition api_pb2.h:2658
std::vector< VoiceAssistantWakeWord > available_wake_words
Definition api_pb2.h:2673
const std::vector< std::string > * active_wake_words
Definition api_pb2.h:2674
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3185
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2964
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2989
enums::VoiceAssistantEvent event_type
Definition api_pb2.h:2533
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2979
std::vector< VoiceAssistantEventData > data
Definition api_pb2.h:2534
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3144
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3134
std::vector< std::string > trained_languages
Definition api_pb2.h:2638
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2933
VoiceAssistantAudioSettings audio_settings
Definition api_pb2.h:2489
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2951
std::vector< std::string > active_wake_words
Definition api_pb2.h:2691
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3211
enums::VoiceAssistantTimerEvent event_type
Definition api_pb2.h:2572
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3060
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3041
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3114
std::vector< std::string > trained_languages
Definition api_pb2.h:2625
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1823
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1844
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1795
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:273
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3903
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3939
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
uint32_t calculate_size() const
Definition api_pb2.cpp:3957
enums::ZWaveProxyRequestType type
Definition api_pb2.h:3142
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3951
enums::ZWaveProxyRequestType type
Definition api_pb2.h:3162
enums::ZWaveProxyStatus status
Definition api_pb2.h:3163
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3963
struct @66::@67 __attribute__
Wake the main loop task from an ISR. ISR-safe.
Definition main_task.h:32
bool state
Definition fan.h:2
constexpr uint32_t encode_zigzag32(int32_t value)
Definition proto.h:42
uint64_t proto_varint_value_t
Type used for decoded varint values - uint64_t when BLE needs 64-bit addresses, uint32_t otherwise.
Definition proto.h:118
constexpr int32_t decode_zigzag32(uint32_t value)
Definition proto.h:50
uint16_t count_packed_varints(const uint8_t *data, size_t len)
Count number of varints in a packed buffer.
Definition proto.h:59
uint16_t size
Definition helpers.cpp:25
size_t size_t pos
Definition helpers.h:1092
static void uint32_t
uint16_t length
Definition tt21100.cpp:0