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