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