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