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