ESPHome 2026.5.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 return pos;
1443}
1445 uint32_t size = 0;
1446 size += 2 + this->object_id.size();
1447 size += 5;
1448 size += 2 + this->name.size();
1451 if (!this->supported_modes->empty()) {
1452 size += this->supported_modes->size() * 2;
1453 }
1457 size += ProtoSize::calc_bool(1, this->supports_action);
1458 if (!this->supported_fan_modes->empty()) {
1459 size += this->supported_fan_modes->size() * 2;
1460 }
1461 if (!this->supported_swing_modes->empty()) {
1462 size += this->supported_swing_modes->size() * 2;
1463 }
1464 if (!this->supported_custom_fan_modes->empty()) {
1465 for (const char *it : *this->supported_custom_fan_modes) {
1466 size += ProtoSize::calc_length_force(1, strlen(it));
1467 }
1468 }
1469 if (!this->supported_presets->empty()) {
1470 size += this->supported_presets->size() * 3;
1471 }
1472 if (!this->supported_custom_presets->empty()) {
1473 for (const char *it : *this->supported_custom_presets) {
1474 size += ProtoSize::calc_length_force(2, strlen(it));
1475 }
1476 }
1478#ifdef USE_ENTITY_ICON
1479 size += !this->icon.empty() ? 3 + this->icon.size() : 0;
1480#endif
1481 size += this->entity_category ? 3 : 0;
1487#ifdef USE_DEVICES
1488 size += ProtoSize::calc_uint32(2, this->device_id);
1489#endif
1490 size += ProtoSize::calc_uint32(2, this->feature_flags);
1491 return size;
1492}
1493uint8_t *ClimateStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1494 uint8_t *__restrict__ pos = buffer.get_pos();
1495 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1496 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->mode));
1497 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->current_temperature);
1498 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 4, this->target_temperature);
1499 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 5, this->target_temperature_low);
1500 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 6, this->target_temperature_high);
1501 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, static_cast<uint32_t>(this->action));
1502 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, static_cast<uint32_t>(this->fan_mode));
1503 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, static_cast<uint32_t>(this->swing_mode));
1504 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 11, this->custom_fan_mode);
1505 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, static_cast<uint32_t>(this->preset));
1506 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 13, this->custom_preset);
1507 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 14, this->current_humidity);
1508 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 15, this->target_humidity);
1509#ifdef USE_DEVICES
1510 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 16, this->device_id);
1511#endif
1512 return pos;
1513}
1515 uint32_t size = 0;
1516 size += 5;
1517 size += this->mode ? 2 : 0;
1519 size += ProtoSize::calc_float(1, this->target_temperature);
1522 size += this->action ? 2 : 0;
1523 size += this->fan_mode ? 2 : 0;
1524 size += this->swing_mode ? 2 : 0;
1525 size += ProtoSize::calc_length(1, this->custom_fan_mode.size());
1526 size += this->preset ? 2 : 0;
1527 size += ProtoSize::calc_length(1, this->custom_preset.size());
1528 size += ProtoSize::calc_float(1, this->current_humidity);
1529 size += ProtoSize::calc_float(1, this->target_humidity);
1530#ifdef USE_DEVICES
1531 size += ProtoSize::calc_uint32(2, this->device_id);
1532#endif
1533 return size;
1534}
1536 switch (field_id) {
1537 case 2:
1538 this->has_mode = value != 0;
1539 break;
1540 case 3:
1541 this->mode = static_cast<enums::ClimateMode>(value);
1542 break;
1543 case 4:
1544 this->has_target_temperature = value != 0;
1545 break;
1546 case 6:
1547 this->has_target_temperature_low = value != 0;
1548 break;
1549 case 8:
1550 this->has_target_temperature_high = value != 0;
1551 break;
1552 case 12:
1553 this->has_fan_mode = value != 0;
1554 break;
1555 case 13:
1556 this->fan_mode = static_cast<enums::ClimateFanMode>(value);
1557 break;
1558 case 14:
1559 this->has_swing_mode = value != 0;
1560 break;
1561 case 15:
1562 this->swing_mode = static_cast<enums::ClimateSwingMode>(value);
1563 break;
1564 case 16:
1565 this->has_custom_fan_mode = value != 0;
1566 break;
1567 case 18:
1568 this->has_preset = value != 0;
1569 break;
1570 case 19:
1571 this->preset = static_cast<enums::ClimatePreset>(value);
1572 break;
1573 case 20:
1574 this->has_custom_preset = value != 0;
1575 break;
1576 case 22:
1577 this->has_target_humidity = value != 0;
1578 break;
1579#ifdef USE_DEVICES
1580 case 24:
1581 this->device_id = value;
1582 break;
1583#endif
1584 default:
1585 return false;
1586 }
1587 return true;
1588}
1590 switch (field_id) {
1591 case 17: {
1592 this->custom_fan_mode = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1593 break;
1594 }
1595 case 21: {
1596 this->custom_preset = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1597 break;
1598 }
1599 default:
1600 return false;
1601 }
1602 return true;
1603}
1605 switch (field_id) {
1606 case 1:
1607 this->key = value.as_fixed32();
1608 break;
1609 case 5:
1610 this->target_temperature = value.as_float();
1611 break;
1612 case 7:
1613 this->target_temperature_low = value.as_float();
1614 break;
1615 case 9:
1616 this->target_temperature_high = value.as_float();
1617 break;
1618 case 23:
1619 this->target_humidity = value.as_float();
1620 break;
1621 default:
1622 return false;
1623 }
1624 return true;
1625}
1626#endif
1627#ifdef USE_WATER_HEATER
1628uint8_t *ListEntitiesWaterHeaterResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1629 uint8_t *__restrict__ pos = buffer.get_pos();
1630 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
1631 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1632 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
1633#ifdef USE_ENTITY_ICON
1634 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 4, this->icon);
1635#endif
1636 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->disabled_by_default);
1637 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, static_cast<uint32_t>(this->entity_category));
1638#ifdef USE_DEVICES
1639 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, this->device_id);
1640#endif
1641 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 8, this->min_temperature);
1642 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 9, this->max_temperature);
1643 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 10, this->target_temperature_step);
1644 for (const auto &it : *this->supported_modes) {
1645 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, static_cast<uint32_t>(it), true);
1646 }
1647 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, this->supported_features);
1648 return pos;
1649}
1651 uint32_t size = 0;
1652 size += 2 + this->object_id.size();
1653 size += 5;
1654 size += 2 + this->name.size();
1655#ifdef USE_ENTITY_ICON
1656 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
1657#endif
1658 size += ProtoSize::calc_bool(1, this->disabled_by_default);
1659 size += this->entity_category ? 2 : 0;
1660#ifdef USE_DEVICES
1661 size += ProtoSize::calc_uint32(1, this->device_id);
1662#endif
1663 size += ProtoSize::calc_float(1, this->min_temperature);
1664 size += ProtoSize::calc_float(1, this->max_temperature);
1666 if (!this->supported_modes->empty()) {
1667 size += this->supported_modes->size() * 2;
1668 }
1670 return size;
1671}
1672uint8_t *WaterHeaterStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1673 uint8_t *__restrict__ pos = buffer.get_pos();
1674 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1675 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 2, this->current_temperature);
1676 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->target_temperature);
1677 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, static_cast<uint32_t>(this->mode));
1678#ifdef USE_DEVICES
1679 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->device_id);
1680#endif
1681 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, this->state);
1682 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 7, this->target_temperature_low);
1683 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 8, this->target_temperature_high);
1684 return pos;
1685}
1687 uint32_t size = 0;
1688 size += 5;
1690 size += ProtoSize::calc_float(1, this->target_temperature);
1691 size += this->mode ? 2 : 0;
1692#ifdef USE_DEVICES
1693 size += ProtoSize::calc_uint32(1, this->device_id);
1694#endif
1695 size += ProtoSize::calc_uint32(1, this->state);
1698 return size;
1699}
1701 switch (field_id) {
1702 case 2:
1703 this->has_fields = value;
1704 break;
1705 case 3:
1706 this->mode = static_cast<enums::WaterHeaterMode>(value);
1707 break;
1708#ifdef USE_DEVICES
1709 case 5:
1710 this->device_id = value;
1711 break;
1712#endif
1713 case 6:
1714 this->state = value;
1715 break;
1716 default:
1717 return false;
1718 }
1719 return true;
1720}
1722 switch (field_id) {
1723 case 1:
1724 this->key = value.as_fixed32();
1725 break;
1726 case 4:
1727 this->target_temperature = value.as_float();
1728 break;
1729 case 7:
1730 this->target_temperature_low = value.as_float();
1731 break;
1732 case 8:
1733 this->target_temperature_high = value.as_float();
1734 break;
1735 default:
1736 return false;
1737 }
1738 return true;
1739}
1740#endif
1741#ifdef USE_NUMBER
1742uint8_t *ListEntitiesNumberResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1743 uint8_t *__restrict__ pos = buffer.get_pos();
1744 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
1745 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1746 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
1747#ifdef USE_ENTITY_ICON
1748 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
1749#endif
1750 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 6, this->min_value);
1751 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 7, this->max_value);
1752 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 8, this->step);
1753 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->disabled_by_default);
1754 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, static_cast<uint32_t>(this->entity_category));
1755 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 11, this->unit_of_measurement);
1756 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, static_cast<uint32_t>(this->mode));
1757 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 13, this->device_class);
1758#ifdef USE_DEVICES
1759 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 14, this->device_id);
1760#endif
1761 return pos;
1762}
1764 uint32_t size = 0;
1765 size += 2 + this->object_id.size();
1766 size += 5;
1767 size += 2 + this->name.size();
1768#ifdef USE_ENTITY_ICON
1769 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
1770#endif
1771 size += ProtoSize::calc_float(1, this->min_value);
1772 size += ProtoSize::calc_float(1, this->max_value);
1773 size += ProtoSize::calc_float(1, this->step);
1774 size += ProtoSize::calc_bool(1, this->disabled_by_default);
1775 size += this->entity_category ? 2 : 0;
1776 size += !this->unit_of_measurement.empty() ? 2 + this->unit_of_measurement.size() : 0;
1777 size += this->mode ? 2 : 0;
1778 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
1779#ifdef USE_DEVICES
1780 size += ProtoSize::calc_uint32(1, this->device_id);
1781#endif
1782 return size;
1783}
1784uint8_t *NumberStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1785 uint8_t *__restrict__ pos = buffer.get_pos();
1786 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1787 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
1788 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->missing_state);
1789#ifdef USE_DEVICES
1790 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
1791#endif
1792 return pos;
1793}
1795 uint32_t size = 0;
1796 size += 5;
1797 size += ProtoSize::calc_float(1, this->state);
1798 size += ProtoSize::calc_bool(1, this->missing_state);
1799#ifdef USE_DEVICES
1800 size += ProtoSize::calc_uint32(1, this->device_id);
1801#endif
1802 return size;
1803}
1805 switch (field_id) {
1806#ifdef USE_DEVICES
1807 case 3:
1808 this->device_id = value;
1809 break;
1810#endif
1811 default:
1812 return false;
1813 }
1814 return true;
1815}
1817 switch (field_id) {
1818 case 1:
1819 this->key = value.as_fixed32();
1820 break;
1821 case 2:
1822 this->state = value.as_float();
1823 break;
1824 default:
1825 return false;
1826 }
1827 return true;
1828}
1829#endif
1830#ifdef USE_SELECT
1831uint8_t *ListEntitiesSelectResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1832 uint8_t *__restrict__ pos = buffer.get_pos();
1833 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
1834 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1835 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
1836#ifdef USE_ENTITY_ICON
1837 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
1838#endif
1839 for (const char *it : *this->options) {
1840 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 6, it, strlen(it), true);
1841 }
1842 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 7, this->disabled_by_default);
1843 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, static_cast<uint32_t>(this->entity_category));
1844#ifdef USE_DEVICES
1845 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->device_id);
1846#endif
1847 return pos;
1848}
1850 uint32_t size = 0;
1851 size += 2 + this->object_id.size();
1852 size += 5;
1853 size += 2 + this->name.size();
1854#ifdef USE_ENTITY_ICON
1855 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
1856#endif
1857 if (!this->options->empty()) {
1858 for (const char *it : *this->options) {
1859 size += ProtoSize::calc_length_force(1, strlen(it));
1860 }
1861 }
1863 size += this->entity_category ? 2 : 0;
1864#ifdef USE_DEVICES
1865 size += ProtoSize::calc_uint32(1, this->device_id);
1866#endif
1867 return size;
1868}
1869uint8_t *SelectStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1870 uint8_t *__restrict__ pos = buffer.get_pos();
1871 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1872 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
1873 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->missing_state);
1874#ifdef USE_DEVICES
1875 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
1876#endif
1877 return pos;
1878}
1880 uint32_t size = 0;
1881 size += 5;
1882 size += ProtoSize::calc_length(1, this->state.size());
1883 size += ProtoSize::calc_bool(1, this->missing_state);
1884#ifdef USE_DEVICES
1885 size += ProtoSize::calc_uint32(1, this->device_id);
1886#endif
1887 return size;
1888}
1890 switch (field_id) {
1891#ifdef USE_DEVICES
1892 case 3:
1893 this->device_id = value;
1894 break;
1895#endif
1896 default:
1897 return false;
1898 }
1899 return true;
1900}
1902 switch (field_id) {
1903 case 2: {
1904 this->state = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
1905 break;
1906 }
1907 default:
1908 return false;
1909 }
1910 return true;
1911}
1913 switch (field_id) {
1914 case 1:
1915 this->key = value.as_fixed32();
1916 break;
1917 default:
1918 return false;
1919 }
1920 return true;
1921}
1922#endif
1923#ifdef USE_SIREN
1924uint8_t *ListEntitiesSirenResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1925 uint8_t *__restrict__ pos = buffer.get_pos();
1926 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
1927 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
1928 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
1929#ifdef USE_ENTITY_ICON
1930 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
1931#endif
1932 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
1933 for (const char *it : *this->tones) {
1934 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 7, it, strlen(it), true);
1935 }
1936 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 8, this->supports_duration);
1937 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->supports_volume);
1938 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, static_cast<uint32_t>(this->entity_category));
1939#ifdef USE_DEVICES
1940 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, this->device_id);
1941#endif
1942 return pos;
1943}
1945 uint32_t size = 0;
1946 size += 2 + this->object_id.size();
1947 size += 5;
1948 size += 2 + this->name.size();
1949#ifdef USE_ENTITY_ICON
1950 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
1951#endif
1952 size += ProtoSize::calc_bool(1, this->disabled_by_default);
1953 if (!this->tones->empty()) {
1954 for (const char *it : *this->tones) {
1955 size += ProtoSize::calc_length_force(1, strlen(it));
1956 }
1957 }
1959 size += ProtoSize::calc_bool(1, this->supports_volume);
1960 size += this->entity_category ? 2 : 0;
1961#ifdef USE_DEVICES
1962 size += ProtoSize::calc_uint32(1, this->device_id);
1963#endif
1964 return size;
1965}
1966uint8_t *SirenStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
1967 uint8_t *__restrict__ pos = buffer.get_pos();
1968 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
1969 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
1970#ifdef USE_DEVICES
1971 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->device_id);
1972#endif
1973 return pos;
1974}
1976 uint32_t size = 0;
1977 size += 5;
1978 size += ProtoSize::calc_bool(1, this->state);
1979#ifdef USE_DEVICES
1980 size += ProtoSize::calc_uint32(1, this->device_id);
1981#endif
1982 return size;
1983}
1985 switch (field_id) {
1986 case 2:
1987 this->has_state = value != 0;
1988 break;
1989 case 3:
1990 this->state = value != 0;
1991 break;
1992 case 4:
1993 this->has_tone = value != 0;
1994 break;
1995 case 6:
1996 this->has_duration = value != 0;
1997 break;
1998 case 7:
1999 this->duration = value;
2000 break;
2001 case 8:
2002 this->has_volume = value != 0;
2003 break;
2004#ifdef USE_DEVICES
2005 case 10:
2006 this->device_id = value;
2007 break;
2008#endif
2009 default:
2010 return false;
2011 }
2012 return true;
2013}
2015 switch (field_id) {
2016 case 5: {
2017 this->tone = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2018 break;
2019 }
2020 default:
2021 return false;
2022 }
2023 return true;
2024}
2026 switch (field_id) {
2027 case 1:
2028 this->key = value.as_fixed32();
2029 break;
2030 case 9:
2031 this->volume = value.as_float();
2032 break;
2033 default:
2034 return false;
2035 }
2036 return true;
2037}
2038#endif
2039#ifdef USE_LOCK
2040uint8_t *ListEntitiesLockResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2041 uint8_t *__restrict__ pos = buffer.get_pos();
2042 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
2043 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
2044 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
2045#ifdef USE_ENTITY_ICON
2046 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
2047#endif
2048 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
2049 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
2050 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 8, this->assumed_state);
2051 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->supports_open);
2052 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 10, this->requires_code);
2053 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 11, this->code_format);
2054#ifdef USE_DEVICES
2055 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, this->device_id);
2056#endif
2057 return pos;
2058}
2060 uint32_t size = 0;
2061 size += 2 + this->object_id.size();
2062 size += 5;
2063 size += 2 + this->name.size();
2064#ifdef USE_ENTITY_ICON
2065 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
2066#endif
2067 size += ProtoSize::calc_bool(1, this->disabled_by_default);
2068 size += this->entity_category ? 2 : 0;
2069 size += ProtoSize::calc_bool(1, this->assumed_state);
2070 size += ProtoSize::calc_bool(1, this->supports_open);
2071 size += ProtoSize::calc_bool(1, this->requires_code);
2072 size += ProtoSize::calc_length(1, this->code_format.size());
2073#ifdef USE_DEVICES
2074 size += ProtoSize::calc_uint32(1, this->device_id);
2075#endif
2076 return size;
2077}
2078uint8_t *LockStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2079 uint8_t *__restrict__ pos = buffer.get_pos();
2080 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
2081 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->state));
2082#ifdef USE_DEVICES
2083 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->device_id);
2084#endif
2085 return pos;
2086}
2088 uint32_t size = 0;
2089 size += 5;
2090 size += this->state ? 2 : 0;
2091#ifdef USE_DEVICES
2092 size += ProtoSize::calc_uint32(1, this->device_id);
2093#endif
2094 return size;
2095}
2097 switch (field_id) {
2098 case 2:
2099 this->command = static_cast<enums::LockCommand>(value);
2100 break;
2101 case 3:
2102 this->has_code = value != 0;
2103 break;
2104#ifdef USE_DEVICES
2105 case 5:
2106 this->device_id = value;
2107 break;
2108#endif
2109 default:
2110 return false;
2111 }
2112 return true;
2113}
2115 switch (field_id) {
2116 case 4: {
2117 this->code = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2118 break;
2119 }
2120 default:
2121 return false;
2122 }
2123 return true;
2124}
2126 switch (field_id) {
2127 case 1:
2128 this->key = value.as_fixed32();
2129 break;
2130 default:
2131 return false;
2132 }
2133 return true;
2134}
2135#endif
2136#ifdef USE_BUTTON
2137uint8_t *ListEntitiesButtonResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2138 uint8_t *__restrict__ pos = buffer.get_pos();
2139 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
2140 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
2141 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
2142#ifdef USE_ENTITY_ICON
2143 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
2144#endif
2145 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
2146 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
2147 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
2148#ifdef USE_DEVICES
2149 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->device_id);
2150#endif
2151 return pos;
2152}
2154 uint32_t size = 0;
2155 size += 2 + this->object_id.size();
2156 size += 5;
2157 size += 2 + this->name.size();
2158#ifdef USE_ENTITY_ICON
2159 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
2160#endif
2161 size += ProtoSize::calc_bool(1, this->disabled_by_default);
2162 size += this->entity_category ? 2 : 0;
2163 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
2164#ifdef USE_DEVICES
2165 size += ProtoSize::calc_uint32(1, this->device_id);
2166#endif
2167 return size;
2168}
2170 switch (field_id) {
2171#ifdef USE_DEVICES
2172 case 2:
2173 this->device_id = value;
2174 break;
2175#endif
2176 default:
2177 return false;
2178 }
2179 return true;
2180}
2182 switch (field_id) {
2183 case 1:
2184 this->key = value.as_fixed32();
2185 break;
2186 default:
2187 return false;
2188 }
2189 return true;
2190}
2191#endif
2192#ifdef USE_MEDIA_PLAYER
2193uint8_t *MediaPlayerSupportedFormat::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2194 uint8_t *__restrict__ pos = buffer.get_pos();
2195 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->format);
2196 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->sample_rate);
2197 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->num_channels);
2198 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, static_cast<uint32_t>(this->purpose));
2199 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->sample_bytes);
2200 return pos;
2201}
2203 uint32_t size = 0;
2204 size += ProtoSize::calc_length(1, this->format.size());
2205 size += ProtoSize::calc_uint32(1, this->sample_rate);
2206 size += ProtoSize::calc_uint32(1, this->num_channels);
2207 size += this->purpose ? 2 : 0;
2208 size += ProtoSize::calc_uint32(1, this->sample_bytes);
2209 return size;
2210}
2211uint8_t *ListEntitiesMediaPlayerResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2212 uint8_t *__restrict__ pos = buffer.get_pos();
2213 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
2214 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
2215 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
2216#ifdef USE_ENTITY_ICON
2217 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
2218#endif
2219 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
2220 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
2221 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 8, this->supports_pause);
2222 for (auto &it : this->supported_formats) {
2223 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 9, it);
2224 }
2225#ifdef USE_DEVICES
2226 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, this->device_id);
2227#endif
2228 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, this->feature_flags);
2229 return pos;
2230}
2232 uint32_t size = 0;
2233 size += 2 + this->object_id.size();
2234 size += 5;
2235 size += 2 + this->name.size();
2236#ifdef USE_ENTITY_ICON
2237 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
2238#endif
2239 size += ProtoSize::calc_bool(1, this->disabled_by_default);
2240 size += this->entity_category ? 2 : 0;
2241 size += ProtoSize::calc_bool(1, this->supports_pause);
2242 if (!this->supported_formats.empty()) {
2243 for (const auto &it : this->supported_formats) {
2244 size += ProtoSize::calc_message_force(1, it.calculate_size());
2245 }
2246 }
2247#ifdef USE_DEVICES
2249#endif
2250 size += ProtoSize::calc_uint32(1, this->feature_flags);
2251 return size;
2252}
2253uint8_t *MediaPlayerStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2254 uint8_t *__restrict__ pos = buffer.get_pos();
2255 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
2256 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->state));
2257 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->volume);
2258 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 4, this->muted);
2259#ifdef USE_DEVICES
2260 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->device_id);
2261#endif
2262 return pos;
2263}
2265 uint32_t size = 0;
2266 size += 5;
2267 size += this->state ? 2 : 0;
2268 size += ProtoSize::calc_float(1, this->volume);
2269 size += ProtoSize::calc_bool(1, this->muted);
2270#ifdef USE_DEVICES
2271 size += ProtoSize::calc_uint32(1, this->device_id);
2272#endif
2273 return size;
2274}
2276 switch (field_id) {
2277 case 2:
2278 this->has_command = value != 0;
2279 break;
2280 case 3:
2281 this->command = static_cast<enums::MediaPlayerCommand>(value);
2282 break;
2283 case 4:
2284 this->has_volume = value != 0;
2285 break;
2286 case 6:
2287 this->has_media_url = value != 0;
2288 break;
2289 case 8:
2290 this->has_announcement = value != 0;
2291 break;
2292 case 9:
2293 this->announcement = value != 0;
2294 break;
2295#ifdef USE_DEVICES
2296 case 10:
2297 this->device_id = value;
2298 break;
2299#endif
2300 default:
2301 return false;
2302 }
2303 return true;
2304}
2306 switch (field_id) {
2307 case 7: {
2308 this->media_url = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2309 break;
2310 }
2311 default:
2312 return false;
2313 }
2314 return true;
2315}
2317 switch (field_id) {
2318 case 1:
2319 this->key = value.as_fixed32();
2320 break;
2321 case 5:
2322 this->volume = value.as_float();
2323 break;
2324 default:
2325 return false;
2326 }
2327 return true;
2328}
2329#endif
2330#ifdef USE_BLUETOOTH_PROXY
2332 switch (field_id) {
2333 case 1:
2334 this->flags = value;
2335 break;
2336 default:
2337 return false;
2338 }
2339 return true;
2340}
2341__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
2342uint8_t *
2343BluetoothLERawAdvertisementsResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2344 uint8_t *__restrict__ pos = buffer.get_pos();
2345 for (uint16_t i = 0; i < this->advertisements_len; i++) {
2346 auto &sub_msg = this->advertisements[i];
2347 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 10);
2348 uint8_t *len_pos = pos;
2349 ProtoEncode::reserve_byte(pos PROTO_ENCODE_DEBUG_ARG);
2350 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 8);
2351 ProtoEncode::encode_varint_raw_64(pos PROTO_ENCODE_DEBUG_ARG, sub_msg.address);
2352 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 16);
2353 ProtoEncode::encode_varint_raw_short(pos PROTO_ENCODE_DEBUG_ARG, encode_zigzag32(sub_msg.rssi));
2354 if (sub_msg.address_type) {
2355 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 24);
2356 ProtoEncode::encode_varint_raw(pos PROTO_ENCODE_DEBUG_ARG, sub_msg.address_type);
2357 }
2358 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 34);
2359 ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, static_cast<uint8_t>(sub_msg.data_len));
2360 ProtoEncode::encode_raw(pos PROTO_ENCODE_DEBUG_ARG, sub_msg.data, sub_msg.data_len);
2361 *len_pos = static_cast<uint8_t>(pos - len_pos - 1);
2362 }
2363 return pos;
2364}
2365__attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes)
2367BluetoothLERawAdvertisementsResponse::calculate_size() const {
2368 uint32_t size = 0;
2369 for (uint16_t i = 0; i < this->advertisements_len; i++) {
2370 auto &sub_msg = this->advertisements[i];
2371 size += 2;
2372 size += ProtoSize::calc_uint64_force(1, sub_msg.address);
2373 size += ProtoSize::calc_sint32_force(1, sub_msg.rssi);
2374 size += sub_msg.address_type ? 2 : 0;
2375 size += 2 + sub_msg.data_len;
2376 }
2377 return size;
2378}
2380 switch (field_id) {
2381 case 1:
2382 this->address = value;
2383 break;
2384 case 2:
2385 this->request_type = static_cast<enums::BluetoothDeviceRequestType>(value);
2386 break;
2387 case 3:
2388 this->has_address_type = value != 0;
2389 break;
2390 case 4:
2391 this->address_type = value;
2392 break;
2393 default:
2394 return false;
2395 }
2396 return true;
2397}
2398uint8_t *BluetoothDeviceConnectionResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2399 uint8_t *__restrict__ pos = buffer.get_pos();
2400 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2401 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->connected);
2402 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->mtu);
2403 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->error);
2404 return pos;
2405}
2407 uint32_t size = 0;
2408 size += ProtoSize::calc_uint64(1, this->address);
2409 size += ProtoSize::calc_bool(1, this->connected);
2410 size += ProtoSize::calc_uint32(1, this->mtu);
2411 size += ProtoSize::calc_int32(1, this->error);
2412 return size;
2413}
2415 switch (field_id) {
2416 case 1:
2417 this->address = value;
2418 break;
2419 default:
2420 return false;
2421 }
2422 return true;
2423}
2424uint8_t *BluetoothGATTDescriptor::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2425 uint8_t *__restrict__ pos = buffer.get_pos();
2426 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2427 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[0], true);
2428 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[1], true);
2429 }
2430 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2431 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->short_uuid);
2432 return pos;
2433}
2435 uint32_t size = 0;
2436 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2437 size += ProtoSize::calc_uint64_force(1, this->uuid[0]);
2438 size += ProtoSize::calc_uint64_force(1, this->uuid[1]);
2439 }
2440 size += ProtoSize::calc_uint32(1, this->handle);
2441 size += ProtoSize::calc_uint32(1, this->short_uuid);
2442 return size;
2443}
2444uint8_t *BluetoothGATTCharacteristic::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2445 uint8_t *__restrict__ pos = buffer.get_pos();
2446 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2447 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[0], true);
2448 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[1], true);
2449 }
2450 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2451 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->properties);
2452 for (auto &it : this->descriptors) {
2453 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 4, it);
2454 }
2455 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->short_uuid);
2456 return pos;
2457}
2459 uint32_t size = 0;
2460 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2461 size += ProtoSize::calc_uint64_force(1, this->uuid[0]);
2462 size += ProtoSize::calc_uint64_force(1, this->uuid[1]);
2463 }
2464 size += ProtoSize::calc_uint32(1, this->handle);
2465 size += ProtoSize::calc_uint32(1, this->properties);
2466 if (!this->descriptors.empty()) {
2467 for (const auto &it : this->descriptors) {
2468 size += ProtoSize::calc_message_force(1, it.calculate_size());
2469 }
2470 }
2472 return size;
2473}
2474uint8_t *BluetoothGATTService::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2475 uint8_t *__restrict__ pos = buffer.get_pos();
2476 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2477 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[0], true);
2478 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->uuid[1], true);
2479 }
2480 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2481 for (auto &it : this->characteristics) {
2482 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 3, it);
2483 }
2484 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->short_uuid);
2485 return pos;
2486}
2488 uint32_t size = 0;
2489 if (this->uuid[0] != 0 || this->uuid[1] != 0) {
2490 size += ProtoSize::calc_uint64_force(1, this->uuid[0]);
2491 size += ProtoSize::calc_uint64_force(1, this->uuid[1]);
2492 }
2493 size += ProtoSize::calc_uint32(1, this->handle);
2494 if (!this->characteristics.empty()) {
2495 for (const auto &it : this->characteristics) {
2496 size += ProtoSize::calc_message_force(1, it.calculate_size());
2497 }
2498 }
2500 return size;
2501}
2502uint8_t *BluetoothGATTGetServicesResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2503 uint8_t *__restrict__ pos = buffer.get_pos();
2504 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2505 for (auto &it : this->services) {
2506 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 2, it);
2507 }
2508 return pos;
2509}
2511 uint32_t size = 0;
2512 size += ProtoSize::calc_uint64(1, this->address);
2513 if (!this->services.empty()) {
2514 for (const auto &it : this->services) {
2515 size += ProtoSize::calc_message_force(1, it.calculate_size());
2516 }
2517 }
2518 return size;
2519}
2520uint8_t *BluetoothGATTGetServicesDoneResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2521 uint8_t *__restrict__ pos = buffer.get_pos();
2522 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2523 return pos;
2524}
2531 switch (field_id) {
2532 case 1:
2533 this->address = value;
2534 break;
2535 case 2:
2536 this->handle = value;
2537 break;
2538 default:
2539 return false;
2540 }
2541 return true;
2542}
2543uint8_t *BluetoothGATTReadResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2544 uint8_t *__restrict__ pos = buffer.get_pos();
2545 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2546 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2547 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 3, this->data_ptr_, this->data_len_);
2548 return pos;
2549}
2551 uint32_t size = 0;
2552 size += ProtoSize::calc_uint64(1, this->address);
2553 size += ProtoSize::calc_uint32(1, this->handle);
2554 size += ProtoSize::calc_length(1, this->data_len_);
2555 return size;
2556}
2558 switch (field_id) {
2559 case 1:
2560 this->address = value;
2561 break;
2562 case 2:
2563 this->handle = value;
2564 break;
2565 case 3:
2566 this->response = value != 0;
2567 break;
2568 default:
2569 return false;
2570 }
2571 return true;
2572}
2574 switch (field_id) {
2575 case 4: {
2576 this->data = value.data();
2577 this->data_len = value.size();
2578 break;
2579 }
2580 default:
2581 return false;
2582 }
2583 return true;
2584}
2586 switch (field_id) {
2587 case 1:
2588 this->address = value;
2589 break;
2590 case 2:
2591 this->handle = value;
2592 break;
2593 default:
2594 return false;
2595 }
2596 return true;
2597}
2599 switch (field_id) {
2600 case 1:
2601 this->address = value;
2602 break;
2603 case 2:
2604 this->handle = value;
2605 break;
2606 default:
2607 return false;
2608 }
2609 return true;
2610}
2612 switch (field_id) {
2613 case 3: {
2614 this->data = value.data();
2615 this->data_len = value.size();
2616 break;
2617 }
2618 default:
2619 return false;
2620 }
2621 return true;
2622}
2624 switch (field_id) {
2625 case 1:
2626 this->address = value;
2627 break;
2628 case 2:
2629 this->handle = value;
2630 break;
2631 case 3:
2632 this->enable = value != 0;
2633 break;
2634 default:
2635 return false;
2636 }
2637 return true;
2638}
2639uint8_t *BluetoothGATTNotifyDataResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2640 uint8_t *__restrict__ pos = buffer.get_pos();
2641 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2642 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2643 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 3, this->data_ptr_, this->data_len_);
2644 return pos;
2645}
2647 uint32_t size = 0;
2648 size += ProtoSize::calc_uint64(1, this->address);
2649 size += ProtoSize::calc_uint32(1, this->handle);
2650 size += ProtoSize::calc_length(1, this->data_len_);
2651 return size;
2652}
2653uint8_t *BluetoothConnectionsFreeResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2654 uint8_t *__restrict__ pos = buffer.get_pos();
2655 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->free);
2656 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->limit);
2657 for (const auto &it : this->allocated) {
2658 if (it != 0) {
2659 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 3, it, true);
2660 }
2661 }
2662 return pos;
2663}
2665 uint32_t size = 0;
2666 size += ProtoSize::calc_uint32(1, this->free);
2667 size += ProtoSize::calc_uint32(1, this->limit);
2668 for (const auto &it : this->allocated) {
2669 if (it != 0) {
2671 }
2672 }
2673 return size;
2674}
2675uint8_t *BluetoothGATTErrorResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2676 uint8_t *__restrict__ pos = buffer.get_pos();
2677 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2678 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2679 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->error);
2680 return pos;
2681}
2683 uint32_t size = 0;
2684 size += ProtoSize::calc_uint64(1, this->address);
2685 size += ProtoSize::calc_uint32(1, this->handle);
2686 size += ProtoSize::calc_int32(1, this->error);
2687 return size;
2688}
2689uint8_t *BluetoothGATTWriteResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2690 uint8_t *__restrict__ pos = buffer.get_pos();
2691 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2692 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2693 return pos;
2694}
2696 uint32_t size = 0;
2697 size += ProtoSize::calc_uint64(1, this->address);
2698 size += ProtoSize::calc_uint32(1, this->handle);
2699 return size;
2700}
2701uint8_t *BluetoothGATTNotifyResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2702 uint8_t *__restrict__ pos = buffer.get_pos();
2703 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2704 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->handle);
2705 return pos;
2706}
2708 uint32_t size = 0;
2709 size += ProtoSize::calc_uint64(1, this->address);
2710 size += ProtoSize::calc_uint32(1, this->handle);
2711 return size;
2712}
2713uint8_t *BluetoothDevicePairingResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2714 uint8_t *__restrict__ pos = buffer.get_pos();
2715 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2716 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->paired);
2717 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->error);
2718 return pos;
2719}
2721 uint32_t size = 0;
2722 size += ProtoSize::calc_uint64(1, this->address);
2723 size += ProtoSize::calc_bool(1, this->paired);
2724 size += ProtoSize::calc_int32(1, this->error);
2725 return size;
2726}
2727uint8_t *BluetoothDeviceUnpairingResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2728 uint8_t *__restrict__ pos = buffer.get_pos();
2729 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2730 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->success);
2731 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->error);
2732 return pos;
2733}
2735 uint32_t size = 0;
2736 size += ProtoSize::calc_uint64(1, this->address);
2737 size += ProtoSize::calc_bool(1, this->success);
2738 size += ProtoSize::calc_int32(1, this->error);
2739 return size;
2740}
2741uint8_t *BluetoothDeviceClearCacheResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2742 uint8_t *__restrict__ pos = buffer.get_pos();
2743 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
2744 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->success);
2745 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->error);
2746 return pos;
2747}
2749 uint32_t size = 0;
2750 size += ProtoSize::calc_uint64(1, this->address);
2751 size += ProtoSize::calc_bool(1, this->success);
2752 size += ProtoSize::calc_int32(1, this->error);
2753 return size;
2754}
2755uint8_t *BluetoothScannerStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2756 uint8_t *__restrict__ pos = buffer.get_pos();
2757 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, static_cast<uint32_t>(this->state));
2758 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->mode));
2759 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, static_cast<uint32_t>(this->configured_mode));
2760 return pos;
2761}
2763 uint32_t size = 0;
2764 size += this->state ? 2 : 0;
2765 size += this->mode ? 2 : 0;
2766 size += this->configured_mode ? 2 : 0;
2767 return size;
2768}
2770 switch (field_id) {
2771 case 1:
2772 this->mode = static_cast<enums::BluetoothScannerMode>(value);
2773 break;
2774 default:
2775 return false;
2776 }
2777 return true;
2778}
2779#endif
2780#ifdef USE_VOICE_ASSISTANT
2782 switch (field_id) {
2783 case 1:
2784 this->subscribe = value != 0;
2785 break;
2786 case 2:
2787 this->flags = value;
2788 break;
2789 default:
2790 return false;
2791 }
2792 return true;
2793}
2794uint8_t *VoiceAssistantAudioSettings::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2795 uint8_t *__restrict__ pos = buffer.get_pos();
2796 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->noise_suppression_level);
2797 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->auto_gain);
2798 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 3, this->volume_multiplier);
2799 return pos;
2800}
2808uint8_t *VoiceAssistantRequest::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2809 uint8_t *__restrict__ pos = buffer.get_pos();
2810 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 1, this->start);
2811 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->conversation_id);
2812 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->flags);
2813 ProtoEncode::encode_optional_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 4, this->audio_settings);
2814 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->wake_word_phrase);
2815 return pos;
2816}
2818 uint32_t size = 0;
2819 size += ProtoSize::calc_bool(1, this->start);
2820 size += ProtoSize::calc_length(1, this->conversation_id.size());
2821 size += ProtoSize::calc_uint32(1, this->flags);
2823 size += ProtoSize::calc_length(1, this->wake_word_phrase.size());
2824 return size;
2825}
2827 switch (field_id) {
2828 case 1:
2829 this->port = value;
2830 break;
2831 case 2:
2832 this->error = value != 0;
2833 break;
2834 default:
2835 return false;
2836 }
2837 return true;
2838}
2840 switch (field_id) {
2841 case 1: {
2842 this->name = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2843 break;
2844 }
2845 case 2: {
2846 this->value = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2847 break;
2848 }
2849 default:
2850 return false;
2851 }
2852 return true;
2853}
2855 switch (field_id) {
2856 case 1:
2857 this->event_type = static_cast<enums::VoiceAssistantEvent>(value);
2858 break;
2859 default:
2860 return false;
2861 }
2862 return true;
2863}
2865 switch (field_id) {
2866 case 2:
2867 this->data.emplace_back();
2868 value.decode_to_message(this->data.back());
2869 break;
2870 default:
2871 return false;
2872 }
2873 return true;
2874}
2876 switch (field_id) {
2877 case 2:
2878 this->end = value != 0;
2879 break;
2880 default:
2881 return false;
2882 }
2883 return true;
2884}
2886 switch (field_id) {
2887 case 1: {
2888 this->data = value.data();
2889 this->data_len = value.size();
2890 break;
2891 }
2892 default:
2893 return false;
2894 }
2895 return true;
2896}
2897uint8_t *VoiceAssistantAudio::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2898 uint8_t *__restrict__ pos = buffer.get_pos();
2899 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 1, this->data, this->data_len);
2900 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->end);
2901 return pos;
2902}
2904 uint32_t size = 0;
2906 size += ProtoSize::calc_bool(1, this->end);
2907 return size;
2908}
2910 switch (field_id) {
2911 case 1:
2912 this->event_type = static_cast<enums::VoiceAssistantTimerEvent>(value);
2913 break;
2914 case 4:
2915 this->total_seconds = value;
2916 break;
2917 case 5:
2918 this->seconds_left = value;
2919 break;
2920 case 6:
2921 this->is_active = value != 0;
2922 break;
2923 default:
2924 return false;
2925 }
2926 return true;
2927}
2929 switch (field_id) {
2930 case 2: {
2931 this->timer_id = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2932 break;
2933 }
2934 case 3: {
2935 this->name = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2936 break;
2937 }
2938 default:
2939 return false;
2940 }
2941 return true;
2942}
2944 switch (field_id) {
2945 case 4:
2946 this->start_conversation = value != 0;
2947 break;
2948 default:
2949 return false;
2950 }
2951 return true;
2952}
2954 switch (field_id) {
2955 case 1: {
2956 this->media_id = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2957 break;
2958 }
2959 case 2: {
2960 this->text = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2961 break;
2962 }
2963 case 3: {
2964 this->preannounce_media_id = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
2965 break;
2966 }
2967 default:
2968 return false;
2969 }
2970 return true;
2971}
2972uint8_t *VoiceAssistantAnnounceFinished::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2973 uint8_t *__restrict__ pos = buffer.get_pos();
2974 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 1, this->success);
2975 return pos;
2976}
2978 uint32_t size = 0;
2979 size += ProtoSize::calc_bool(1, this->success);
2980 return size;
2981}
2982uint8_t *VoiceAssistantWakeWord::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
2983 uint8_t *__restrict__ pos = buffer.get_pos();
2984 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 1, this->id);
2985 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->wake_word);
2986 for (auto &it : this->trained_languages) {
2987 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 3, it, true);
2988 }
2989 return pos;
2990}
2992 uint32_t size = 0;
2993 size += ProtoSize::calc_length(1, this->id.size());
2994 size += ProtoSize::calc_length(1, this->wake_word.size());
2995 if (!this->trained_languages.empty()) {
2996 for (const auto &it : this->trained_languages) {
2997 size += ProtoSize::calc_length_force(1, it.size());
2998 }
2999 }
3000 return size;
3001}
3003 switch (field_id) {
3004 case 5:
3005 this->model_size = value;
3006 break;
3007 default:
3008 return false;
3009 }
3010 return true;
3011}
3013 switch (field_id) {
3014 case 1: {
3015 this->id = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3016 break;
3017 }
3018 case 2: {
3019 this->wake_word = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3020 break;
3021 }
3022 case 3:
3023 this->trained_languages.push_back(value.as_string());
3024 break;
3025 case 4: {
3026 this->model_type = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3027 break;
3028 }
3029 case 6: {
3030 this->model_hash = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3031 break;
3032 }
3033 case 7: {
3034 this->url = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3035 break;
3036 }
3037 default:
3038 return false;
3039 }
3040 return true;
3041}
3043 switch (field_id) {
3044 case 1:
3045 this->external_wake_words.emplace_back();
3046 value.decode_to_message(this->external_wake_words.back());
3047 break;
3048 default:
3049 return false;
3050 }
3051 return true;
3052}
3053uint8_t *VoiceAssistantConfigurationResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3054 uint8_t *__restrict__ pos = buffer.get_pos();
3055 for (auto &it : this->available_wake_words) {
3056 ProtoEncode::encode_sub_message(pos PROTO_ENCODE_DEBUG_ARG, buffer, 1, it);
3057 }
3058 for (const auto &it : *this->active_wake_words) {
3059 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, it, true);
3060 }
3061 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->max_active_wake_words);
3062 return pos;
3063}
3065 uint32_t size = 0;
3066 if (!this->available_wake_words.empty()) {
3067 for (const auto &it : this->available_wake_words) {
3068 size += ProtoSize::calc_message_force(1, it.calculate_size());
3069 }
3070 }
3071 if (!this->active_wake_words->empty()) {
3072 for (const auto &it : *this->active_wake_words) {
3073 size += ProtoSize::calc_length_force(1, it.size());
3074 }
3075 }
3077 return size;
3078}
3080 switch (field_id) {
3081 case 1:
3082 this->active_wake_words.push_back(value.as_string());
3083 break;
3084 default:
3085 return false;
3086 }
3087 return true;
3088}
3089#endif
3090#ifdef USE_ALARM_CONTROL_PANEL
3091uint8_t *ListEntitiesAlarmControlPanelResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3092 uint8_t *__restrict__ pos = buffer.get_pos();
3093 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3094 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3095 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3096#ifdef USE_ENTITY_ICON
3097 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3098#endif
3099 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3100 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3101 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->supported_features);
3102 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->requires_code);
3103 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 10, this->requires_code_to_arm);
3104#ifdef USE_DEVICES
3105 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, this->device_id);
3106#endif
3107 return pos;
3108}
3110 uint32_t size = 0;
3111 size += 2 + this->object_id.size();
3112 size += 5;
3113 size += 2 + this->name.size();
3114#ifdef USE_ENTITY_ICON
3115 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3116#endif
3117 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3118 size += this->entity_category ? 2 : 0;
3120 size += ProtoSize::calc_bool(1, this->requires_code);
3122#ifdef USE_DEVICES
3123 size += ProtoSize::calc_uint32(1, this->device_id);
3124#endif
3125 return size;
3126}
3127uint8_t *AlarmControlPanelStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3128 uint8_t *__restrict__ pos = buffer.get_pos();
3129 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3130 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->state));
3131#ifdef USE_DEVICES
3132 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->device_id);
3133#endif
3134 return pos;
3135}
3137 uint32_t size = 0;
3138 size += 5;
3139 size += this->state ? 2 : 0;
3140#ifdef USE_DEVICES
3141 size += ProtoSize::calc_uint32(1, this->device_id);
3142#endif
3143 return size;
3144}
3146 switch (field_id) {
3147 case 2:
3148 this->command = static_cast<enums::AlarmControlPanelStateCommand>(value);
3149 break;
3150#ifdef USE_DEVICES
3151 case 4:
3152 this->device_id = value;
3153 break;
3154#endif
3155 default:
3156 return false;
3157 }
3158 return true;
3159}
3161 switch (field_id) {
3162 case 3: {
3163 this->code = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3164 break;
3165 }
3166 default:
3167 return false;
3168 }
3169 return true;
3170}
3172 switch (field_id) {
3173 case 1:
3174 this->key = value.as_fixed32();
3175 break;
3176 default:
3177 return false;
3178 }
3179 return true;
3180}
3181#endif
3182#ifdef USE_TEXT
3183uint8_t *ListEntitiesTextResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3184 uint8_t *__restrict__ pos = buffer.get_pos();
3185 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3186 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3187 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3188#ifdef USE_ENTITY_ICON
3189 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3190#endif
3191 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3192 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3193 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->min_length);
3194 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->max_length);
3195 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 10, this->pattern);
3196 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, static_cast<uint32_t>(this->mode));
3197#ifdef USE_DEVICES
3198 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, this->device_id);
3199#endif
3200 return pos;
3201}
3203 uint32_t size = 0;
3204 size += 2 + this->object_id.size();
3205 size += 5;
3206 size += 2 + this->name.size();
3207#ifdef USE_ENTITY_ICON
3208 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3209#endif
3210 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3211 size += this->entity_category ? 2 : 0;
3212 size += ProtoSize::calc_uint32(1, this->min_length);
3213 size += ProtoSize::calc_uint32(1, this->max_length);
3214 size += ProtoSize::calc_length(1, this->pattern.size());
3215 size += this->mode ? 2 : 0;
3216#ifdef USE_DEVICES
3217 size += ProtoSize::calc_uint32(1, this->device_id);
3218#endif
3219 return size;
3220}
3221uint8_t *TextStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3222 uint8_t *__restrict__ pos = buffer.get_pos();
3223 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3224 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->state);
3225 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->missing_state);
3226#ifdef USE_DEVICES
3227 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
3228#endif
3229 return pos;
3230}
3232 uint32_t size = 0;
3233 size += 5;
3234 size += ProtoSize::calc_length(1, this->state.size());
3235 size += ProtoSize::calc_bool(1, this->missing_state);
3236#ifdef USE_DEVICES
3237 size += ProtoSize::calc_uint32(1, this->device_id);
3238#endif
3239 return size;
3240}
3242 switch (field_id) {
3243#ifdef USE_DEVICES
3244 case 3:
3245 this->device_id = value;
3246 break;
3247#endif
3248 default:
3249 return false;
3250 }
3251 return true;
3252}
3254 switch (field_id) {
3255 case 2: {
3256 this->state = StringRef(reinterpret_cast<const char *>(value.data()), value.size());
3257 break;
3258 }
3259 default:
3260 return false;
3261 }
3262 return true;
3263}
3265 switch (field_id) {
3266 case 1:
3267 this->key = value.as_fixed32();
3268 break;
3269 default:
3270 return false;
3271 }
3272 return true;
3273}
3274#endif
3275#ifdef USE_DATETIME_DATE
3276uint8_t *ListEntitiesDateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3277 uint8_t *__restrict__ pos = buffer.get_pos();
3278 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3279 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3280 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3281#ifdef USE_ENTITY_ICON
3282 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3283#endif
3284 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3285 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3286#ifdef USE_DEVICES
3287 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_id);
3288#endif
3289 return pos;
3290}
3292 uint32_t size = 0;
3293 size += 2 + this->object_id.size();
3294 size += 5;
3295 size += 2 + this->name.size();
3296#ifdef USE_ENTITY_ICON
3297 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3298#endif
3299 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3300 size += this->entity_category ? 2 : 0;
3301#ifdef USE_DEVICES
3302 size += ProtoSize::calc_uint32(1, this->device_id);
3303#endif
3304 return size;
3305}
3306uint8_t *DateStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3307 uint8_t *__restrict__ pos = buffer.get_pos();
3308 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3309 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->missing_state);
3310 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->year);
3311 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->month);
3312 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->day);
3313#ifdef USE_DEVICES
3314 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, this->device_id);
3315#endif
3316 return pos;
3317}
3319 uint32_t size = 0;
3320 size += 5;
3322 size += ProtoSize::calc_uint32(1, this->year);
3323 size += ProtoSize::calc_uint32(1, this->month);
3324 size += ProtoSize::calc_uint32(1, this->day);
3325#ifdef USE_DEVICES
3326 size += ProtoSize::calc_uint32(1, this->device_id);
3327#endif
3328 return size;
3329}
3331 switch (field_id) {
3332 case 2:
3333 this->year = value;
3334 break;
3335 case 3:
3336 this->month = value;
3337 break;
3338 case 4:
3339 this->day = value;
3340 break;
3341#ifdef USE_DEVICES
3342 case 5:
3343 this->device_id = value;
3344 break;
3345#endif
3346 default:
3347 return false;
3348 }
3349 return true;
3350}
3352 switch (field_id) {
3353 case 1:
3354 this->key = value.as_fixed32();
3355 break;
3356 default:
3357 return false;
3358 }
3359 return true;
3360}
3361#endif
3362#ifdef USE_DATETIME_TIME
3363uint8_t *ListEntitiesTimeResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3364 uint8_t *__restrict__ pos = buffer.get_pos();
3365 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3366 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3367 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3368#ifdef USE_ENTITY_ICON
3369 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3370#endif
3371 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3372 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3373#ifdef USE_DEVICES
3374 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_id);
3375#endif
3376 return pos;
3377}
3379 uint32_t size = 0;
3380 size += 2 + this->object_id.size();
3381 size += 5;
3382 size += 2 + this->name.size();
3383#ifdef USE_ENTITY_ICON
3384 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3385#endif
3386 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3387 size += this->entity_category ? 2 : 0;
3388#ifdef USE_DEVICES
3389 size += ProtoSize::calc_uint32(1, this->device_id);
3390#endif
3391 return size;
3392}
3393uint8_t *TimeStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3394 uint8_t *__restrict__ pos = buffer.get_pos();
3395 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3396 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->missing_state);
3397 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->hour);
3398 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->minute);
3399 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 5, this->second);
3400#ifdef USE_DEVICES
3401 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, this->device_id);
3402#endif
3403 return pos;
3404}
3406 uint32_t size = 0;
3407 size += 5;
3409 size += ProtoSize::calc_uint32(1, this->hour);
3410 size += ProtoSize::calc_uint32(1, this->minute);
3411 size += ProtoSize::calc_uint32(1, this->second);
3412#ifdef USE_DEVICES
3413 size += ProtoSize::calc_uint32(1, this->device_id);
3414#endif
3415 return size;
3416}
3418 switch (field_id) {
3419 case 2:
3420 this->hour = value;
3421 break;
3422 case 3:
3423 this->minute = value;
3424 break;
3425 case 4:
3426 this->second = value;
3427 break;
3428#ifdef USE_DEVICES
3429 case 5:
3430 this->device_id = value;
3431 break;
3432#endif
3433 default:
3434 return false;
3435 }
3436 return true;
3437}
3439 switch (field_id) {
3440 case 1:
3441 this->key = value.as_fixed32();
3442 break;
3443 default:
3444 return false;
3445 }
3446 return true;
3447}
3448#endif
3449#ifdef USE_EVENT
3450uint8_t *ListEntitiesEventResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3451 uint8_t *__restrict__ pos = buffer.get_pos();
3452 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3453 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3454 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3455#ifdef USE_ENTITY_ICON
3456 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3457#endif
3458 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3459 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3460 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
3461 for (const char *it : *this->event_types) {
3462 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 9, it, strlen(it), true);
3463 }
3464#ifdef USE_DEVICES
3465 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 10, this->device_id);
3466#endif
3467 return pos;
3468}
3470 uint32_t size = 0;
3471 size += 2 + this->object_id.size();
3472 size += 5;
3473 size += 2 + this->name.size();
3474#ifdef USE_ENTITY_ICON
3475 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3476#endif
3477 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3478 size += this->entity_category ? 2 : 0;
3479 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
3480 if (!this->event_types->empty()) {
3481 for (const char *it : *this->event_types) {
3482 size += ProtoSize::calc_length_force(1, strlen(it));
3483 }
3484 }
3485#ifdef USE_DEVICES
3487#endif
3488 return size;
3489}
3490uint8_t *EventResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3491 uint8_t *__restrict__ pos = buffer.get_pos();
3492 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3493 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 2, this->event_type);
3494#ifdef USE_DEVICES
3495 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->device_id);
3496#endif
3497 return pos;
3498}
3500 uint32_t size = 0;
3501 size += 5;
3503#ifdef USE_DEVICES
3504 size += ProtoSize::calc_uint32(1, this->device_id);
3505#endif
3506 return size;
3507}
3508#endif
3509#ifdef USE_VALVE
3510uint8_t *ListEntitiesValveResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3511 uint8_t *__restrict__ pos = buffer.get_pos();
3512 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3513 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3514 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3515#ifdef USE_ENTITY_ICON
3516 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3517#endif
3518 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3519 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3520 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
3521 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 9, this->assumed_state);
3522 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 10, this->supports_position);
3523 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 11, this->supports_stop);
3524#ifdef USE_DEVICES
3525 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 12, this->device_id);
3526#endif
3527 return pos;
3528}
3530 uint32_t size = 0;
3531 size += 2 + this->object_id.size();
3532 size += 5;
3533 size += 2 + this->name.size();
3534#ifdef USE_ENTITY_ICON
3535 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3536#endif
3537 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3538 size += this->entity_category ? 2 : 0;
3539 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
3540 size += ProtoSize::calc_bool(1, this->assumed_state);
3541 size += ProtoSize::calc_bool(1, this->supports_position);
3542 size += ProtoSize::calc_bool(1, this->supports_stop);
3543#ifdef USE_DEVICES
3544 size += ProtoSize::calc_uint32(1, this->device_id);
3545#endif
3546 return size;
3547}
3548uint8_t *ValveStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3549 uint8_t *__restrict__ pos = buffer.get_pos();
3550 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3551 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 2, this->position);
3552 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, static_cast<uint32_t>(this->current_operation));
3553#ifdef USE_DEVICES
3554 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
3555#endif
3556 return pos;
3557}
3559 uint32_t size = 0;
3560 size += 5;
3561 size += ProtoSize::calc_float(1, this->position);
3562 size += this->current_operation ? 2 : 0;
3563#ifdef USE_DEVICES
3564 size += ProtoSize::calc_uint32(1, this->device_id);
3565#endif
3566 return size;
3567}
3569 switch (field_id) {
3570 case 2:
3571 this->has_position = value != 0;
3572 break;
3573 case 4:
3574 this->stop = value != 0;
3575 break;
3576#ifdef USE_DEVICES
3577 case 5:
3578 this->device_id = value;
3579 break;
3580#endif
3581 default:
3582 return false;
3583 }
3584 return true;
3585}
3587 switch (field_id) {
3588 case 1:
3589 this->key = value.as_fixed32();
3590 break;
3591 case 3:
3592 this->position = value.as_float();
3593 break;
3594 default:
3595 return false;
3596 }
3597 return true;
3598}
3599#endif
3600#ifdef USE_DATETIME_DATETIME
3601uint8_t *ListEntitiesDateTimeResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3602 uint8_t *__restrict__ pos = buffer.get_pos();
3603 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3604 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3605 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3606#ifdef USE_ENTITY_ICON
3607 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3608#endif
3609 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3610 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3611#ifdef USE_DEVICES
3612 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_id);
3613#endif
3614 return pos;
3615}
3617 uint32_t size = 0;
3618 size += 2 + this->object_id.size();
3619 size += 5;
3620 size += 2 + this->name.size();
3621#ifdef USE_ENTITY_ICON
3622 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3623#endif
3624 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3625 size += this->entity_category ? 2 : 0;
3626#ifdef USE_DEVICES
3627 size += ProtoSize::calc_uint32(1, this->device_id);
3628#endif
3629 return size;
3630}
3631uint8_t *DateTimeStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3632 uint8_t *__restrict__ pos = buffer.get_pos();
3633 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3634 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->missing_state);
3635 ProtoEncode::encode_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->epoch_seconds);
3636#ifdef USE_DEVICES
3637 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 4, this->device_id);
3638#endif
3639 return pos;
3640}
3642 uint32_t size = 0;
3643 size += 5;
3645 size += ProtoSize::calc_fixed32(1, this->epoch_seconds);
3646#ifdef USE_DEVICES
3647 size += ProtoSize::calc_uint32(1, this->device_id);
3648#endif
3649 return size;
3650}
3652 switch (field_id) {
3653#ifdef USE_DEVICES
3654 case 3:
3655 this->device_id = value;
3656 break;
3657#endif
3658 default:
3659 return false;
3660 }
3661 return true;
3662}
3664 switch (field_id) {
3665 case 1:
3666 this->key = value.as_fixed32();
3667 break;
3668 case 2:
3669 this->epoch_seconds = value.as_fixed32();
3670 break;
3671 default:
3672 return false;
3673 }
3674 return true;
3675}
3676#endif
3677#ifdef USE_UPDATE
3678uint8_t *ListEntitiesUpdateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3679 uint8_t *__restrict__ pos = buffer.get_pos();
3680 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3681 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3682 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3683#ifdef USE_ENTITY_ICON
3684 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 5, this->icon);
3685#endif
3686 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 6, this->disabled_by_default);
3687 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, static_cast<uint32_t>(this->entity_category));
3688 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->device_class);
3689#ifdef USE_DEVICES
3690 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->device_id);
3691#endif
3692 return pos;
3693}
3695 uint32_t size = 0;
3696 size += 2 + this->object_id.size();
3697 size += 5;
3698 size += 2 + this->name.size();
3699#ifdef USE_ENTITY_ICON
3700 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3701#endif
3702 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3703 size += this->entity_category ? 2 : 0;
3704 size += !this->device_class.empty() ? 2 + this->device_class.size() : 0;
3705#ifdef USE_DEVICES
3706 size += ProtoSize::calc_uint32(1, this->device_id);
3707#endif
3708 return size;
3709}
3710uint8_t *UpdateStateResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3711 uint8_t *__restrict__ pos = buffer.get_pos();
3712 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 13, this->key);
3713 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->missing_state);
3714 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 3, this->in_progress);
3715 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 4, this->has_progress);
3716 ProtoEncode::encode_float(pos PROTO_ENCODE_DEBUG_ARG, 5, this->progress);
3717 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 6, this->current_version);
3718 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 7, this->latest_version);
3719 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 8, this->title);
3720 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 9, this->release_summary);
3721 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 10, this->release_url);
3722#ifdef USE_DEVICES
3723 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 11, this->device_id);
3724#endif
3725 return pos;
3726}
3728 uint32_t size = 0;
3729 size += 5;
3731 size += ProtoSize::calc_bool(1, this->in_progress);
3732 size += ProtoSize::calc_bool(1, this->has_progress);
3733 size += ProtoSize::calc_float(1, this->progress);
3734 size += ProtoSize::calc_length(1, this->current_version.size());
3735 size += ProtoSize::calc_length(1, this->latest_version.size());
3736 size += ProtoSize::calc_length(1, this->title.size());
3737 size += ProtoSize::calc_length(1, this->release_summary.size());
3738 size += ProtoSize::calc_length(1, this->release_url.size());
3739#ifdef USE_DEVICES
3740 size += ProtoSize::calc_uint32(1, this->device_id);
3741#endif
3742 return size;
3743}
3745 switch (field_id) {
3746 case 2:
3747 this->command = static_cast<enums::UpdateCommand>(value);
3748 break;
3749#ifdef USE_DEVICES
3750 case 3:
3751 this->device_id = value;
3752 break;
3753#endif
3754 default:
3755 return false;
3756 }
3757 return true;
3758}
3760 switch (field_id) {
3761 case 1:
3762 this->key = value.as_fixed32();
3763 break;
3764 default:
3765 return false;
3766 }
3767 return true;
3768}
3769#endif
3770#ifdef USE_ZWAVE_PROXY
3772 switch (field_id) {
3773 case 1: {
3774 this->data = value.data();
3775 this->data_len = value.size();
3776 break;
3777 }
3778 default:
3779 return false;
3780 }
3781 return true;
3782}
3783uint8_t *ZWaveProxyFrame::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3784 uint8_t *__restrict__ pos = buffer.get_pos();
3785 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 1, this->data, this->data_len);
3786 return pos;
3787}
3789 uint32_t size = 0;
3791 return size;
3792}
3794 switch (field_id) {
3795 case 1:
3796 this->type = static_cast<enums::ZWaveProxyRequestType>(value);
3797 break;
3798 default:
3799 return false;
3800 }
3801 return true;
3802}
3804 switch (field_id) {
3805 case 2: {
3806 this->data = value.data();
3807 this->data_len = value.size();
3808 break;
3809 }
3810 default:
3811 return false;
3812 }
3813 return true;
3814}
3815uint8_t *ZWaveProxyRequest::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3816 uint8_t *__restrict__ pos = buffer.get_pos();
3817 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, static_cast<uint32_t>(this->type));
3818 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 2, this->data, this->data_len);
3819 return pos;
3820}
3822 uint32_t size = 0;
3823 size += this->type ? 2 : 0;
3824 size += ProtoSize::calc_length(1, this->data_len);
3825 return size;
3826}
3827#endif
3828#ifdef USE_INFRARED
3829uint8_t *ListEntitiesInfraredResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3830 uint8_t *__restrict__ pos = buffer.get_pos();
3831 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 10, this->object_id);
3832 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3833 ProtoEncode::encode_short_string_force(pos PROTO_ENCODE_DEBUG_ARG, 26, this->name);
3834#ifdef USE_ENTITY_ICON
3835 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 4, this->icon);
3836#endif
3837 ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 5, this->disabled_by_default);
3838 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 6, static_cast<uint32_t>(this->entity_category));
3839#ifdef USE_DEVICES
3840 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 7, this->device_id);
3841#endif
3842 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 8, this->capabilities);
3843 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 9, this->receiver_frequency);
3844 return pos;
3845}
3847 uint32_t size = 0;
3848 size += 2 + this->object_id.size();
3849 size += 5;
3850 size += 2 + this->name.size();
3851#ifdef USE_ENTITY_ICON
3852 size += !this->icon.empty() ? 2 + this->icon.size() : 0;
3853#endif
3854 size += ProtoSize::calc_bool(1, this->disabled_by_default);
3855 size += this->entity_category ? 2 : 0;
3856#ifdef USE_DEVICES
3857 size += ProtoSize::calc_uint32(1, this->device_id);
3858#endif
3859 size += ProtoSize::calc_uint32(1, this->capabilities);
3861 return size;
3862}
3863#endif
3864#ifdef USE_IR_RF
3866 switch (field_id) {
3867#ifdef USE_DEVICES
3868 case 1:
3869 this->device_id = value;
3870 break;
3871#endif
3872 case 3:
3873 this->carrier_frequency = value;
3874 break;
3875 case 4:
3876 this->repeat_count = value;
3877 break;
3878 default:
3879 return false;
3880 }
3881 return true;
3882}
3884 switch (field_id) {
3885 case 5: {
3886 this->timings_data_ = value.data();
3887 this->timings_length_ = value.size();
3888 this->timings_count_ = count_packed_varints(value.data(), value.size());
3889 break;
3890 }
3891 default:
3892 return false;
3893 }
3894 return true;
3895}
3897 switch (field_id) {
3898 case 2:
3899 this->key = value.as_fixed32();
3900 break;
3901 default:
3902 return false;
3903 }
3904 return true;
3905}
3906uint8_t *InfraredRFReceiveEvent::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3907 uint8_t *__restrict__ pos = buffer.get_pos();
3908#ifdef USE_DEVICES
3909 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->device_id);
3910#endif
3911 ProtoEncode::write_tag_and_fixed32(pos PROTO_ENCODE_DEBUG_ARG, 21, this->key);
3912 for (const auto &it : *this->timings) {
3913 ProtoEncode::encode_sint32(pos PROTO_ENCODE_DEBUG_ARG, 3, it, true);
3914 }
3915 return pos;
3916}
3918 uint32_t size = 0;
3919#ifdef USE_DEVICES
3921#endif
3922 size += 5;
3923 if (!this->timings->empty()) {
3924 for (const auto &it : *this->timings) {
3925 size += ProtoSize::calc_sint32_force(1, it);
3926 }
3927 }
3928 return size;
3929}
3930#endif
3931#ifdef USE_SERIAL_PROXY
3933 switch (field_id) {
3934 case 1:
3935 this->instance = value;
3936 break;
3937 case 2:
3938 this->baudrate = value;
3939 break;
3940 case 3:
3941 this->flow_control = value != 0;
3942 break;
3943 case 4:
3944 this->parity = static_cast<enums::SerialProxyParity>(value);
3945 break;
3946 case 5:
3947 this->stop_bits = value;
3948 break;
3949 case 6:
3950 this->data_size = value;
3951 break;
3952 default:
3953 return false;
3954 }
3955 return true;
3956}
3957uint8_t *SerialProxyDataReceived::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
3958 uint8_t *__restrict__ pos = buffer.get_pos();
3959 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->instance);
3960 ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 2, this->data_ptr_, this->data_len_);
3961 return pos;
3962}
3964 uint32_t size = 0;
3966 size += ProtoSize::calc_length(1, this->data_len_);
3967 return size;
3968}
3970 switch (field_id) {
3971 case 1:
3972 this->instance = value;
3973 break;
3974 default:
3975 return false;
3976 }
3977 return true;
3978}
3980 switch (field_id) {
3981 case 2: {
3982 this->data = value.data();
3983 this->data_len = value.size();
3984 break;
3985 }
3986 default:
3987 return false;
3988 }
3989 return true;
3990}
3992 switch (field_id) {
3993 case 1:
3994 this->instance = value;
3995 break;
3996 case 2:
3997 this->line_states = value;
3998 break;
3999 default:
4000 return false;
4001 }
4002 return true;
4003}
4005 switch (field_id) {
4006 case 1:
4007 this->instance = value;
4008 break;
4009 default:
4010 return false;
4011 }
4012 return true;
4013}
4014uint8_t *SerialProxyGetModemPinsResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
4015 uint8_t *__restrict__ pos = buffer.get_pos();
4016 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->instance);
4017 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->line_states);
4018 return pos;
4019}
4021 uint32_t size = 0;
4023 size += ProtoSize::calc_uint32(1, this->line_states);
4024 return size;
4025}
4027 switch (field_id) {
4028 case 1:
4029 this->instance = value;
4030 break;
4031 case 2:
4032 this->type = static_cast<enums::SerialProxyRequestType>(value);
4033 break;
4034 default:
4035 return false;
4036 }
4037 return true;
4038}
4039uint8_t *SerialProxyRequestResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
4040 uint8_t *__restrict__ pos = buffer.get_pos();
4041 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 1, this->instance);
4042 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 2, static_cast<uint32_t>(this->type));
4043 ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, static_cast<uint32_t>(this->status));
4044 ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 4, this->error_message);
4045 return pos;
4046}
4048 uint32_t size = 0;
4050 size += this->type ? 2 : 0;
4051 size += this->status ? 2 : 0;
4052 size += ProtoSize::calc_length(1, this->error_message.size());
4053 return size;
4054}
4055#endif
4056#ifdef USE_BLUETOOTH_PROXY
4058 switch (field_id) {
4059 case 1:
4060 this->address = value;
4061 break;
4062 case 2:
4063 this->min_interval = value;
4064 break;
4065 case 3:
4066 this->max_interval = value;
4067 break;
4068 case 4:
4069 this->latency = value;
4070 break;
4071 case 5:
4072 this->timeout = value;
4073 break;
4074 default:
4075 return false;
4076 }
4077 return true;
4078}
4079uint8_t *BluetoothSetConnectionParamsResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
4080 uint8_t *__restrict__ pos = buffer.get_pos();
4081 ProtoEncode::encode_uint64(pos PROTO_ENCODE_DEBUG_ARG, 1, this->address);
4082 ProtoEncode::encode_int32(pos PROTO_ENCODE_DEBUG_ARG, 2, this->error);
4083 return pos;
4084}
4086 uint32_t size = 0;
4087 size += ProtoSize::calc_uint64(1, this->address);
4088 size += ProtoSize::calc_int32(1, this->error);
4089 return size;
4090}
4091#endif
4092
4093} // 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:680
void push_back(const T &value)
Add element without bounds checking Caller must ensure sufficient capacity was allocated via init() S...
Definition helpers.h:639
void init(size_t n)
Definition helpers.h:612
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:3171
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3145
enums::AlarmControlPanelStateCommand command
Definition api_pb2.h:2624
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3160
enums::AlarmControlPanelState state
Definition api_pb2.h:2608
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3127
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:2184
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2653
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2741
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2398
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2713
enums::BluetoothDeviceRequestType request_type
Definition api_pb2.h:1922
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:2727
FixedVector< BluetoothGATTDescriptor > descriptors
Definition api_pb2.h:1984
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:1981
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2444
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2424
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:1968
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2675
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2520
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2414
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2502
std::vector< BluetoothGATTService > services
Definition api_pb2.h:2016
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2639
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2623
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2701
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2585
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2530
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2543
FixedVector< BluetoothGATTCharacteristic > characteristics
Definition api_pb2.h:1998
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2474
std::array< uint64_t, 2 > uuid
Definition api_pb2.h:1996
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2598
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2611
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2573
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2557
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2689
enums::BluetoothScannerMode mode
Definition api_pb2.h:2324
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2769
enums::BluetoothScannerMode mode
Definition api_pb2.h:2307
enums::BluetoothScannerState state
Definition api_pb2.h:2306
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2755
enums::BluetoothScannerMode configured_mode
Definition api_pb2.h:2308
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:4057
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:4079
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2169
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2181
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:1604
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1451
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1449
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1535
enums::ClimatePreset preset
Definition api_pb2.h:1455
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1589
enums::ClimateFanMode fan_mode
Definition api_pb2.h:1418
enums::ClimateSwingMode swing_mode
Definition api_pb2.h:1419
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1493
enums::ClimateAction action
Definition api_pb2.h:1417
enums::ClimatePreset preset
Definition api_pb2.h:1421
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:664
uint32_t calculate_size() const
Definition api_pb2.cpp:326
enums::DSTRuleType type
Definition api_pb2.h:1170
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:3351
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3330
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3306
uint32_t calculate_size() const
Definition api_pb2.cpp:3318
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3651
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3663
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3631
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:563
std::array< SerialProxyInfo, SERIAL_PROXY_COUNT > serial_proxies
Definition api_pb2.h:575
std::array< DeviceInfo, ESPHOME_DEVICE_COUNT > devices
Definition api_pb2.h:560
uint32_t calculate_size() const
Definition api_pb2.cpp:3499
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3490
FixedVector< float > float_array
Definition api_pb2.h:1254
FixedVector< std::string > string_array
Definition api_pb2.h:1255
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:1253
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1243
FixedVector< ExecuteServiceArgument > args
Definition api_pb2.h:1274
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:747
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:724
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:1204
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:1072
FixedVector< HomeassistantServiceMap > data
Definition api_pb2.h:1070
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:974
FixedVector< HomeassistantServiceMap > data_template
Definition api_pb2.h:1071
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:356
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3906
const std::vector< int32_t > * timings
Definition api_pb2.h:3094
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3896
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3865
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3883
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:791
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:3091
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:2137
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:1390
const climate::ClimateSwingModeMask * supported_swing_modes
Definition api_pb2.h:1387
const std::vector< const char * > * supported_custom_fan_modes
Definition api_pb2.h:1388
const climate::ClimatePresetMask * supported_presets
Definition api_pb2.h:1389
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:1386
const climate::ClimateModeMask * supported_modes
Definition api_pb2.h:1381
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:3276
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3601
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3450
const FixedVector< const char * > * event_types
Definition api_pb2.h:2808
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:706
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3829
const FixedVector< const char * > * effects
Definition api_pb2.h:773
const light::ColorModeMask * supported_color_modes
Definition api_pb2.h:770
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:2040
std::vector< MediaPlayerSupportedFormat > supported_formats
Definition api_pb2.h:1815
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2211
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1742
const FixedVector< const char * > * options
Definition api_pb2.h:1598
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1831
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:708
enums::SensorStateClass state_class
Definition api_pb2.h:864
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:1236
FixedVector< ListEntitiesServicesArgument > args
Definition api_pb2.h:1235
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1924
const FixedVector< const char * > * tones
Definition api_pb2.h:1650
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3183
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:3363
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3678
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3510
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1628
const water_heater::WaterHeaterModeMask * supported_modes
Definition api_pb2.h:1481
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2096
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2125
enums::LockCommand command
Definition api_pb2.h:1745
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2114
uint32_t calculate_size() const
Definition api_pb2.cpp:2087
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2078
enums::MediaPlayerCommand command
Definition api_pb2.h:1851
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2316
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2305
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2275
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2253
enums::MediaPlayerState state
Definition api_pb2.h:1832
enums::MediaPlayerFormatPurpose purpose
Definition api_pb2.h:1797
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2193
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:1816
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1804
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1784
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:437
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:396
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:485
static void ESPHOME_ALWAYS_INLINE encode_varint_raw_64(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint64_t value)
Definition proto.h:336
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:350
static void encode_float(uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, float value, bool force=false)
Definition proto.h:465
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:370
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:382
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:502
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:495
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:357
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:362
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:445
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:430
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:472
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:419
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:423
void decode_to_message(T &msg) const
Decode the length-delimited data into a message instance.
Definition proto.h:865
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:814
static constexpr uint32_t calc_bool(uint32_t field_id_size, bool value)
Definition proto.h:791
static constexpr uint32_t calc_message(uint32_t field_id_size, uint32_t nested_size)
Definition proto.h:838
static constexpr uint32_t ESPHOME_ALWAYS_INLINE calc_uint64_force(uint32_t field_id_size, uint64_t value)
Definition proto.h:817
static constexpr uint32_t calc_uint32(uint32_t field_id_size, uint32_t value)
Definition proto.h:785
static constexpr uint32_t calc_length(uint32_t field_id_size, size_t len)
Definition proto.h:820
static constexpr uint32_t calc_int32(uint32_t field_id_size, int32_t value)
Definition proto.h:779
static constexpr uint32_t ESPHOME_ALWAYS_INLINE calc_length_force(uint32_t field_id_size, size_t len)
Definition proto.h:823
static uint32_t calc_float(uint32_t field_id_size, float value)
Definition proto.h:793
static constexpr uint32_t calc_fixed32(uint32_t field_id_size, uint32_t value)
Definition proto.h:796
static constexpr uint32_t ESPHOME_ALWAYS_INLINE calc_message_force(uint32_t field_id_size, uint32_t nested_size)
Definition proto.h:841
static constexpr uint32_t ESPHOME_ALWAYS_INLINE calc_sint32_force(uint32_t field_id_size, int32_t value)
Definition proto.h:805
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:1901
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1889
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1912
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1869
enums::SerialProxyParity parity
Definition api_pb2.h:3115
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3932
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3957
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:4004
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:4014
uint32_t calculate_size() const
Definition api_pb2.cpp:87
enums::SerialProxyPortType port_type
Definition api_pb2.h:508
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:4026
enums::SerialProxyRequestType type
Definition api_pb2.h:3221
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:4039
enums::SerialProxyRequestType type
Definition api_pb2.h:3237
enums::SerialProxyStatus status
Definition api_pb2.h:3238
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3991
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3979
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3969
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1984
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2014
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:2025
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1966
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2331
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:2781
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:3253
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3241
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3264
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:885
uint32_t calculate_size() const
Definition api_pb2.cpp:3231
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3221
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3438
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3417
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3393
uint32_t calculate_size() const
Definition api_pb2.cpp:3405
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3759
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3744
enums::UpdateCommand command
Definition api_pb2.h:2988
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3710
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3568
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:3586
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3548
enums::ValveOperation current_operation
Definition api_pb2.h:2862
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2972
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2953
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2943
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2875
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2885
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2897
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2794
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3042
std::vector< VoiceAssistantExternalWakeWord > external_wake_words
Definition api_pb2.h:2540
std::vector< VoiceAssistantWakeWord > available_wake_words
Definition api_pb2.h:2555
const std::vector< std::string > * active_wake_words
Definition api_pb2.h:2556
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3053
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2839
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2864
enums::VoiceAssistantEvent event_type
Definition api_pb2.h:2417
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2854
std::vector< VoiceAssistantEventData > data
Definition api_pb2.h:2418
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3012
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3002
std::vector< std::string > trained_languages
Definition api_pb2.h:2520
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2808
VoiceAssistantAudioSettings audio_settings
Definition api_pb2.h:2373
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2826
std::vector< std::string > active_wake_words
Definition api_pb2.h:2573
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3079
enums::VoiceAssistantTimerEvent event_type
Definition api_pb2.h:2454
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:2928
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:2909
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:2982
std::vector< std::string > trained_languages
Definition api_pb2.h:2507
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:1700
bool decode_32bit(uint32_t field_id, Proto32Bit value) override
Definition api_pb2.cpp:1721
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:1672
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3771
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3783
uint32_t calculate_size() const
Definition api_pb2.cpp:3788
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override
Definition api_pb2.cpp:3803
bool decode_varint(uint32_t field_id, proto_varint_value_t value) override
Definition api_pb2.cpp:3793
uint32_t calculate_size() const
Definition api_pb2.cpp:3821
enums::ZWaveProxyRequestType type
Definition api_pb2.h:3024
uint8_t * encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const
Definition api_pb2.cpp:3815
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:1082
static void uint32_t
uint16_t length
Definition tt21100.cpp:0