Merge branch 'proto_field_ifdefs' into integration

This commit is contained in:
J. Nick Koston 2025-07-15 20:02:50 -10:00
commit 7744b2db79
No known key found for this signature in database
3 changed files with 258 additions and 36 deletions

View File

@ -311,7 +311,7 @@ message BinarySensorStateResponse {
// If the binary sensor does not have a valid state yet. // If the binary sensor does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 3; bool missing_state = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== COVER ==================== // ==================== COVER ====================
@ -361,7 +361,7 @@ message CoverStateResponse {
float position = 3; float position = 3;
float tilt = 4; float tilt = 4;
CoverOperation current_operation = 5; CoverOperation current_operation = 5;
uint32 device_id = 6; uint32 device_id = 6 [(field_ifdef) = "USE_DEVICES"];
} }
enum LegacyCoverCommand { enum LegacyCoverCommand {
@ -458,7 +458,7 @@ message FanCommandRequest {
int32 speed_level = 11; int32 speed_level = 11;
bool has_preset_mode = 12; bool has_preset_mode = 12;
string preset_mode = 13; string preset_mode = 13;
uint32 device_id = 14; uint32 device_id = 14 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== LIGHT ==================== // ==================== LIGHT ====================
@ -520,7 +520,7 @@ message LightStateResponse {
float cold_white = 12; float cold_white = 12;
float warm_white = 13; float warm_white = 13;
string effect = 9; string effect = 9;
uint32 device_id = 14; uint32 device_id = 14 [(field_ifdef) = "USE_DEVICES"];
} }
message LightCommandRequest { message LightCommandRequest {
option (id) = 32; option (id) = 32;
@ -556,7 +556,7 @@ message LightCommandRequest {
uint32 flash_length = 17; uint32 flash_length = 17;
bool has_effect = 18; bool has_effect = 18;
string effect = 19; string effect = 19;
uint32 device_id = 28; uint32 device_id = 28 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== SENSOR ==================== // ==================== SENSOR ====================
@ -594,7 +594,7 @@ message ListEntitiesSensorResponse {
SensorLastResetType legacy_last_reset_type = 11; SensorLastResetType legacy_last_reset_type = 11;
bool disabled_by_default = 12; bool disabled_by_default = 12;
EntityCategory entity_category = 13; EntityCategory entity_category = 13;
uint32 device_id = 14; uint32 device_id = 14 [(field_ifdef) = "USE_DEVICES"];
} }
message SensorStateResponse { message SensorStateResponse {
option (id) = 25; option (id) = 25;
@ -608,7 +608,7 @@ message SensorStateResponse {
// If the sensor does not have a valid state yet. // If the sensor does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 3; bool missing_state = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== SWITCH ==================== // ==================== SWITCH ====================
@ -639,7 +639,7 @@ message SwitchStateResponse {
fixed32 key = 1; fixed32 key = 1;
bool state = 2; bool state = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
message SwitchCommandRequest { message SwitchCommandRequest {
option (id) = 33; option (id) = 33;
@ -650,7 +650,7 @@ message SwitchCommandRequest {
fixed32 key = 1; fixed32 key = 1;
bool state = 2; bool state = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== TEXT SENSOR ==================== // ==================== TEXT SENSOR ====================
@ -683,7 +683,7 @@ message TextSensorStateResponse {
// If the text sensor does not have a valid state yet. // If the text sensor does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 3; bool missing_state = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== SUBSCRIBE LOGS ==================== // ==================== SUBSCRIBE LOGS ====================
@ -869,7 +869,7 @@ message CameraImageResponse {
fixed32 key = 1; fixed32 key = 1;
bytes data = 2; bytes data = 2;
bool done = 3; bool done = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
message CameraImageRequest { message CameraImageRequest {
option (id) = 45; option (id) = 45;
@ -1020,7 +1020,7 @@ message ClimateCommandRequest {
string custom_preset = 21; string custom_preset = 21;
bool has_target_humidity = 22; bool has_target_humidity = 22;
float target_humidity = 23; float target_humidity = 23;
uint32 device_id = 24; uint32 device_id = 24 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== NUMBER ==================== // ==================== NUMBER ====================
@ -1049,7 +1049,7 @@ message ListEntitiesNumberResponse {
string unit_of_measurement = 11; string unit_of_measurement = 11;
NumberMode mode = 12; NumberMode mode = 12;
string device_class = 13; string device_class = 13;
uint32 device_id = 14; uint32 device_id = 14 [(field_ifdef) = "USE_DEVICES"];
} }
message NumberStateResponse { message NumberStateResponse {
option (id) = 50; option (id) = 50;
@ -1063,7 +1063,7 @@ message NumberStateResponse {
// If the number does not have a valid state yet. // If the number does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 3; bool missing_state = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
message NumberCommandRequest { message NumberCommandRequest {
option (id) = 51; option (id) = 51;
@ -1074,7 +1074,7 @@ message NumberCommandRequest {
fixed32 key = 1; fixed32 key = 1;
float state = 2; float state = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== SELECT ==================== // ==================== SELECT ====================
@ -1107,7 +1107,7 @@ message SelectStateResponse {
// If the select does not have a valid state yet. // If the select does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 3; bool missing_state = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
message SelectCommandRequest { message SelectCommandRequest {
option (id) = 54; option (id) = 54;
@ -1118,7 +1118,7 @@ message SelectCommandRequest {
fixed32 key = 1; fixed32 key = 1;
string state = 2; string state = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== SIREN ==================== // ==================== SIREN ====================
@ -1150,7 +1150,7 @@ message SirenStateResponse {
fixed32 key = 1; fixed32 key = 1;
bool state = 2; bool state = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
message SirenCommandRequest { message SirenCommandRequest {
option (id) = 57; option (id) = 57;
@ -1216,7 +1216,7 @@ message LockStateResponse {
option (no_delay) = true; option (no_delay) = true;
fixed32 key = 1; fixed32 key = 1;
LockState state = 2; LockState state = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
message LockCommandRequest { message LockCommandRequest {
option (id) = 60; option (id) = 60;
@ -1230,7 +1230,7 @@ message LockCommandRequest {
// Not yet implemented: // Not yet implemented:
bool has_code = 3; bool has_code = 3;
string code = 4; string code = 4;
uint32 device_id = 5; uint32 device_id = 5 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== BUTTON ==================== // ==================== BUTTON ====================
@ -1259,7 +1259,7 @@ message ButtonCommandRequest {
option (base_class) = "CommandProtoMessage"; option (base_class) = "CommandProtoMessage";
fixed32 key = 1; fixed32 key = 1;
uint32 device_id = 2; uint32 device_id = 2 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== MEDIA PLAYER ==================== // ==================== MEDIA PLAYER ====================
@ -1320,7 +1320,7 @@ message MediaPlayerStateResponse {
MediaPlayerState state = 2; MediaPlayerState state = 2;
float volume = 3; float volume = 3;
bool muted = 4; bool muted = 4;
uint32 device_id = 5; uint32 device_id = 5 [(field_ifdef) = "USE_DEVICES"];
} }
message MediaPlayerCommandRequest { message MediaPlayerCommandRequest {
option (id) = 65; option (id) = 65;
@ -1863,7 +1863,7 @@ message AlarmControlPanelStateResponse {
option (no_delay) = true; option (no_delay) = true;
fixed32 key = 1; fixed32 key = 1;
AlarmControlPanelState state = 2; AlarmControlPanelState state = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
message AlarmControlPanelCommandRequest { message AlarmControlPanelCommandRequest {
@ -1875,7 +1875,7 @@ message AlarmControlPanelCommandRequest {
fixed32 key = 1; fixed32 key = 1;
AlarmControlPanelStateCommand command = 2; AlarmControlPanelStateCommand command = 2;
string code = 3; string code = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
// ===================== TEXT ===================== // ===================== TEXT =====================
@ -1915,7 +1915,7 @@ message TextStateResponse {
// If the Text does not have a valid state yet. // If the Text does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 3; bool missing_state = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
message TextCommandRequest { message TextCommandRequest {
option (id) = 99; option (id) = 99;
@ -1926,7 +1926,7 @@ message TextCommandRequest {
fixed32 key = 1; fixed32 key = 1;
string state = 2; string state = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
@ -1961,7 +1961,7 @@ message DateStateResponse {
uint32 year = 3; uint32 year = 3;
uint32 month = 4; uint32 month = 4;
uint32 day = 5; uint32 day = 5;
uint32 device_id = 6; uint32 device_id = 6 [(field_ifdef) = "USE_DEVICES"];
} }
message DateCommandRequest { message DateCommandRequest {
option (id) = 102; option (id) = 102;
@ -1974,7 +1974,7 @@ message DateCommandRequest {
uint32 year = 2; uint32 year = 2;
uint32 month = 3; uint32 month = 3;
uint32 day = 4; uint32 day = 4;
uint32 device_id = 5; uint32 device_id = 5 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== DATETIME TIME ==================== // ==================== DATETIME TIME ====================
@ -2008,7 +2008,7 @@ message TimeStateResponse {
uint32 hour = 3; uint32 hour = 3;
uint32 minute = 4; uint32 minute = 4;
uint32 second = 5; uint32 second = 5;
uint32 device_id = 6; uint32 device_id = 6 [(field_ifdef) = "USE_DEVICES"];
} }
message TimeCommandRequest { message TimeCommandRequest {
option (id) = 105; option (id) = 105;
@ -2021,7 +2021,7 @@ message TimeCommandRequest {
uint32 hour = 2; uint32 hour = 2;
uint32 minute = 3; uint32 minute = 3;
uint32 second = 4; uint32 second = 4;
uint32 device_id = 5; uint32 device_id = 5 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== EVENT ==================== // ==================== EVENT ====================
@ -2052,7 +2052,7 @@ message EventResponse {
fixed32 key = 1; fixed32 key = 1;
string event_type = 2; string event_type = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== VALVE ==================== // ==================== VALVE ====================
@ -2093,7 +2093,7 @@ message ValveStateResponse {
fixed32 key = 1; fixed32 key = 1;
float position = 2; float position = 2;
ValveOperation current_operation = 3; ValveOperation current_operation = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
message ValveCommandRequest { message ValveCommandRequest {
@ -2107,7 +2107,7 @@ message ValveCommandRequest {
bool has_position = 2; bool has_position = 2;
float position = 3; float position = 3;
bool stop = 4; bool stop = 4;
uint32 device_id = 5; uint32 device_id = 5 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== DATETIME DATETIME ==================== // ==================== DATETIME DATETIME ====================
@ -2139,7 +2139,7 @@ message DateTimeStateResponse {
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 2; bool missing_state = 2;
fixed32 epoch_seconds = 3; fixed32 epoch_seconds = 3;
uint32 device_id = 4; uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
} }
message DateTimeCommandRequest { message DateTimeCommandRequest {
option (id) = 114; option (id) = 114;
@ -2150,7 +2150,7 @@ message DateTimeCommandRequest {
fixed32 key = 1; fixed32 key = 1;
fixed32 epoch_seconds = 2; fixed32 epoch_seconds = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }
// ==================== UPDATE ==================== // ==================== UPDATE ====================
@ -2204,5 +2204,5 @@ message UpdateCommandRequest {
fixed32 key = 1; fixed32 key = 1;
UpdateCommand command = 2; UpdateCommand command = 2;
uint32 device_id = 3; uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
} }

View File

@ -260,13 +260,17 @@ void BinarySensorStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_bool(2, this->state); buffer.encode_bool(2, this->state);
buffer.encode_bool(3, this->missing_state); buffer.encode_bool(3, this->missing_state);
#ifdef USE_DEVICES
buffer.encode_uint32(4, this->device_id); buffer.encode_uint32(4, this->device_id);
#endif
} }
void BinarySensorStateResponse::calculate_size(uint32_t &total_size) const { void BinarySensorStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_bool_field(total_size, 1, this->state); ProtoSize::add_bool_field(total_size, 1, this->state);
ProtoSize::add_bool_field(total_size, 1, this->missing_state); ProtoSize::add_bool_field(total_size, 1, this->missing_state);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
#endif #endif
#ifdef USE_COVER #ifdef USE_COVER
@ -312,7 +316,9 @@ void CoverStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_float(3, this->position); buffer.encode_float(3, this->position);
buffer.encode_float(4, this->tilt); buffer.encode_float(4, this->tilt);
buffer.encode_uint32(5, static_cast<uint32_t>(this->current_operation)); buffer.encode_uint32(5, static_cast<uint32_t>(this->current_operation));
#ifdef USE_DEVICES
buffer.encode_uint32(6, this->device_id); buffer.encode_uint32(6, this->device_id);
#endif
} }
void CoverStateResponse::calculate_size(uint32_t &total_size) const { void CoverStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
@ -320,7 +326,9 @@ void CoverStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_float_field(total_size, 1, this->position); ProtoSize::add_float_field(total_size, 1, this->position);
ProtoSize::add_float_field(total_size, 1, this->tilt); ProtoSize::add_float_field(total_size, 1, this->tilt);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation));
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool CoverCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool CoverCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
@ -468,9 +476,11 @@ bool FanCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
case 12: case 12:
this->has_preset_mode = value.as_bool(); this->has_preset_mode = value.as_bool();
break; break;
#ifdef USE_DEVICES
case 14: case 14:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -566,7 +576,9 @@ void LightStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_float(12, this->cold_white); buffer.encode_float(12, this->cold_white);
buffer.encode_float(13, this->warm_white); buffer.encode_float(13, this->warm_white);
buffer.encode_string(9, this->effect); buffer.encode_string(9, this->effect);
#ifdef USE_DEVICES
buffer.encode_uint32(14, this->device_id); buffer.encode_uint32(14, this->device_id);
#endif
} }
void LightStateResponse::calculate_size(uint32_t &total_size) const { void LightStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
@ -582,7 +594,9 @@ void LightStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_float_field(total_size, 1, this->cold_white); ProtoSize::add_float_field(total_size, 1, this->cold_white);
ProtoSize::add_float_field(total_size, 1, this->warm_white); ProtoSize::add_float_field(total_size, 1, this->warm_white);
ProtoSize::add_string_field(total_size, 1, this->effect); ProtoSize::add_string_field(total_size, 1, this->effect);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool LightCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool LightCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
@ -634,9 +648,11 @@ bool LightCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
case 18: case 18:
this->has_effect = value.as_bool(); this->has_effect = value.as_bool();
break; break;
#ifdef USE_DEVICES
case 28: case 28:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -706,7 +722,9 @@ void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_uint32(11, static_cast<uint32_t>(this->legacy_last_reset_type)); buffer.encode_uint32(11, static_cast<uint32_t>(this->legacy_last_reset_type));
buffer.encode_bool(12, this->disabled_by_default); buffer.encode_bool(12, this->disabled_by_default);
buffer.encode_uint32(13, static_cast<uint32_t>(this->entity_category)); buffer.encode_uint32(13, static_cast<uint32_t>(this->entity_category));
#ifdef USE_DEVICES
buffer.encode_uint32(14, this->device_id); buffer.encode_uint32(14, this->device_id);
#endif
} }
void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const { void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_string_field(total_size, 1, this->object_id); ProtoSize::add_string_field(total_size, 1, this->object_id);
@ -723,19 +741,25 @@ void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_last_reset_type)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_last_reset_type));
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default); ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category));
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
void SensorStateResponse::encode(ProtoWriteBuffer buffer) const { void SensorStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_float(2, this->state); buffer.encode_float(2, this->state);
buffer.encode_bool(3, this->missing_state); buffer.encode_bool(3, this->missing_state);
#ifdef USE_DEVICES
buffer.encode_uint32(4, this->device_id); buffer.encode_uint32(4, this->device_id);
#endif
} }
void SensorStateResponse::calculate_size(uint32_t &total_size) const { void SensorStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_float_field(total_size, 1, this->state); ProtoSize::add_float_field(total_size, 1, this->state);
ProtoSize::add_bool_field(total_size, 1, this->missing_state); ProtoSize::add_bool_field(total_size, 1, this->missing_state);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
#endif #endif
#ifdef USE_SWITCH #ifdef USE_SWITCH
@ -772,21 +796,27 @@ void ListEntitiesSwitchResponse::calculate_size(uint32_t &total_size) const {
void SwitchStateResponse::encode(ProtoWriteBuffer buffer) const { void SwitchStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_bool(2, this->state); buffer.encode_bool(2, this->state);
#ifdef USE_DEVICES
buffer.encode_uint32(3, this->device_id); buffer.encode_uint32(3, this->device_id);
#endif
} }
void SwitchStateResponse::calculate_size(uint32_t &total_size) const { void SwitchStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_bool_field(total_size, 1, this->state); ProtoSize::add_bool_field(total_size, 1, this->state);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool SwitchCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool SwitchCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
case 2: case 2:
this->state = value.as_bool(); this->state = value.as_bool();
break; break;
#ifdef USE_DEVICES
case 3: case 3:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -836,13 +866,17 @@ void TextSensorStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_string(2, this->state); buffer.encode_string(2, this->state);
buffer.encode_bool(3, this->missing_state); buffer.encode_bool(3, this->missing_state);
#ifdef USE_DEVICES
buffer.encode_uint32(4, this->device_id); buffer.encode_uint32(4, this->device_id);
#endif
} }
void TextSensorStateResponse::calculate_size(uint32_t &total_size) const { void TextSensorStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_string_field(total_size, 1, this->state); ProtoSize::add_string_field(total_size, 1, this->state);
ProtoSize::add_bool_field(total_size, 1, this->missing_state); ProtoSize::add_bool_field(total_size, 1, this->missing_state);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
#endif #endif
bool SubscribeLogsRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool SubscribeLogsRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
@ -1151,13 +1185,17 @@ void CameraImageResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_bytes(2, reinterpret_cast<const uint8_t *>(this->data.data()), this->data.size()); buffer.encode_bytes(2, reinterpret_cast<const uint8_t *>(this->data.data()), this->data.size());
buffer.encode_bool(3, this->done); buffer.encode_bool(3, this->done);
#ifdef USE_DEVICES
buffer.encode_uint32(4, this->device_id); buffer.encode_uint32(4, this->device_id);
#endif
} }
void CameraImageResponse::calculate_size(uint32_t &total_size) const { void CameraImageResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_string_field(total_size, 1, this->data); ProtoSize::add_string_field(total_size, 1, this->data);
ProtoSize::add_bool_field(total_size, 1, this->done); ProtoSize::add_bool_field(total_size, 1, this->done);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool CameraImageRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool CameraImageRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
@ -1362,9 +1400,11 @@ bool ClimateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value)
case 22: case 22:
this->has_target_humidity = value.as_bool(); this->has_target_humidity = value.as_bool();
break; break;
#ifdef USE_DEVICES
case 24: case 24:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -1422,7 +1462,9 @@ void ListEntitiesNumberResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_string(11, this->unit_of_measurement); buffer.encode_string(11, this->unit_of_measurement);
buffer.encode_uint32(12, static_cast<uint32_t>(this->mode)); buffer.encode_uint32(12, static_cast<uint32_t>(this->mode));
buffer.encode_string(13, this->device_class); buffer.encode_string(13, this->device_class);
#ifdef USE_DEVICES
buffer.encode_uint32(14, this->device_id); buffer.encode_uint32(14, this->device_id);
#endif
} }
void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const { void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_string_field(total_size, 1, this->object_id); ProtoSize::add_string_field(total_size, 1, this->object_id);
@ -1439,25 +1481,33 @@ void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement); ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode));
ProtoSize::add_string_field(total_size, 1, this->device_class); ProtoSize::add_string_field(total_size, 1, this->device_class);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
void NumberStateResponse::encode(ProtoWriteBuffer buffer) const { void NumberStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_float(2, this->state); buffer.encode_float(2, this->state);
buffer.encode_bool(3, this->missing_state); buffer.encode_bool(3, this->missing_state);
#ifdef USE_DEVICES
buffer.encode_uint32(4, this->device_id); buffer.encode_uint32(4, this->device_id);
#endif
} }
void NumberStateResponse::calculate_size(uint32_t &total_size) const { void NumberStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_float_field(total_size, 1, this->state); ProtoSize::add_float_field(total_size, 1, this->state);
ProtoSize::add_bool_field(total_size, 1, this->missing_state); ProtoSize::add_bool_field(total_size, 1, this->missing_state);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool NumberCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool NumberCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
#ifdef USE_DEVICES
case 3: case 3:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -1516,19 +1566,25 @@ void SelectStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_string(2, this->state); buffer.encode_string(2, this->state);
buffer.encode_bool(3, this->missing_state); buffer.encode_bool(3, this->missing_state);
#ifdef USE_DEVICES
buffer.encode_uint32(4, this->device_id); buffer.encode_uint32(4, this->device_id);
#endif
} }
void SelectStateResponse::calculate_size(uint32_t &total_size) const { void SelectStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_string_field(total_size, 1, this->state); ProtoSize::add_string_field(total_size, 1, this->state);
ProtoSize::add_bool_field(total_size, 1, this->missing_state); ProtoSize::add_bool_field(total_size, 1, this->missing_state);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool SelectCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool SelectCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
#ifdef USE_DEVICES
case 3: case 3:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -1597,12 +1653,16 @@ void ListEntitiesSirenResponse::calculate_size(uint32_t &total_size) const {
void SirenStateResponse::encode(ProtoWriteBuffer buffer) const { void SirenStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_bool(2, this->state); buffer.encode_bool(2, this->state);
#ifdef USE_DEVICES
buffer.encode_uint32(3, this->device_id); buffer.encode_uint32(3, this->device_id);
#endif
} }
void SirenStateResponse::calculate_size(uint32_t &total_size) const { void SirenStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_bool_field(total_size, 1, this->state); ProtoSize::add_bool_field(total_size, 1, this->state);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool SirenCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool SirenCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
@ -1696,12 +1756,16 @@ void ListEntitiesLockResponse::calculate_size(uint32_t &total_size) const {
void LockStateResponse::encode(ProtoWriteBuffer buffer) const { void LockStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_uint32(2, static_cast<uint32_t>(this->state)); buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
#ifdef USE_DEVICES
buffer.encode_uint32(3, this->device_id); buffer.encode_uint32(3, this->device_id);
#endif
} }
void LockStateResponse::calculate_size(uint32_t &total_size) const { void LockStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state));
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool LockCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool LockCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
@ -1711,9 +1775,11 @@ bool LockCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
case 3: case 3:
this->has_code = value.as_bool(); this->has_code = value.as_bool();
break; break;
#ifdef USE_DEVICES
case 5: case 5:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -1771,9 +1837,11 @@ void ListEntitiesButtonResponse::calculate_size(uint32_t &total_size) const {
} }
bool ButtonCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool ButtonCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
#ifdef USE_DEVICES
case 2: case 2:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -1871,14 +1939,18 @@ void MediaPlayerStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_uint32(2, static_cast<uint32_t>(this->state)); buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
buffer.encode_float(3, this->volume); buffer.encode_float(3, this->volume);
buffer.encode_bool(4, this->muted); buffer.encode_bool(4, this->muted);
#ifdef USE_DEVICES
buffer.encode_uint32(5, this->device_id); buffer.encode_uint32(5, this->device_id);
#endif
} }
void MediaPlayerStateResponse::calculate_size(uint32_t &total_size) const { void MediaPlayerStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state));
ProtoSize::add_float_field(total_size, 1, this->volume); ProtoSize::add_float_field(total_size, 1, this->volume);
ProtoSize::add_bool_field(total_size, 1, this->muted); ProtoSize::add_bool_field(total_size, 1, this->muted);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool MediaPlayerCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool MediaPlayerCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
@ -2736,21 +2808,27 @@ void ListEntitiesAlarmControlPanelResponse::calculate_size(uint32_t &total_size)
void AlarmControlPanelStateResponse::encode(ProtoWriteBuffer buffer) const { void AlarmControlPanelStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_uint32(2, static_cast<uint32_t>(this->state)); buffer.encode_uint32(2, static_cast<uint32_t>(this->state));
#ifdef USE_DEVICES
buffer.encode_uint32(3, this->device_id); buffer.encode_uint32(3, this->device_id);
#endif
} }
void AlarmControlPanelStateResponse::calculate_size(uint32_t &total_size) const { void AlarmControlPanelStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state));
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool AlarmControlPanelCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool AlarmControlPanelCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
case 2: case 2:
this->command = static_cast<enums::AlarmControlPanelStateCommand>(value.as_uint32()); this->command = static_cast<enums::AlarmControlPanelStateCommand>(value.as_uint32());
break; break;
#ifdef USE_DEVICES
case 4: case 4:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -2816,19 +2894,25 @@ void TextStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_string(2, this->state); buffer.encode_string(2, this->state);
buffer.encode_bool(3, this->missing_state); buffer.encode_bool(3, this->missing_state);
#ifdef USE_DEVICES
buffer.encode_uint32(4, this->device_id); buffer.encode_uint32(4, this->device_id);
#endif
} }
void TextStateResponse::calculate_size(uint32_t &total_size) const { void TextStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_string_field(total_size, 1, this->state); ProtoSize::add_string_field(total_size, 1, this->state);
ProtoSize::add_bool_field(total_size, 1, this->missing_state); ProtoSize::add_bool_field(total_size, 1, this->missing_state);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool TextCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool TextCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
#ifdef USE_DEVICES
case 3: case 3:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -2888,7 +2972,9 @@ void DateStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_uint32(3, this->year); buffer.encode_uint32(3, this->year);
buffer.encode_uint32(4, this->month); buffer.encode_uint32(4, this->month);
buffer.encode_uint32(5, this->day); buffer.encode_uint32(5, this->day);
#ifdef USE_DEVICES
buffer.encode_uint32(6, this->device_id); buffer.encode_uint32(6, this->device_id);
#endif
} }
void DateStateResponse::calculate_size(uint32_t &total_size) const { void DateStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
@ -2896,7 +2982,9 @@ void DateStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_uint32_field(total_size, 1, this->year); ProtoSize::add_uint32_field(total_size, 1, this->year);
ProtoSize::add_uint32_field(total_size, 1, this->month); ProtoSize::add_uint32_field(total_size, 1, this->month);
ProtoSize::add_uint32_field(total_size, 1, this->day); ProtoSize::add_uint32_field(total_size, 1, this->day);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
@ -2909,9 +2997,11 @@ bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
case 4: case 4:
this->day = value.as_uint32(); this->day = value.as_uint32();
break; break;
#ifdef USE_DEVICES
case 5: case 5:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -2961,7 +3051,9 @@ void TimeStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_uint32(3, this->hour); buffer.encode_uint32(3, this->hour);
buffer.encode_uint32(4, this->minute); buffer.encode_uint32(4, this->minute);
buffer.encode_uint32(5, this->second); buffer.encode_uint32(5, this->second);
#ifdef USE_DEVICES
buffer.encode_uint32(6, this->device_id); buffer.encode_uint32(6, this->device_id);
#endif
} }
void TimeStateResponse::calculate_size(uint32_t &total_size) const { void TimeStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
@ -2969,7 +3061,9 @@ void TimeStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_uint32_field(total_size, 1, this->hour); ProtoSize::add_uint32_field(total_size, 1, this->hour);
ProtoSize::add_uint32_field(total_size, 1, this->minute); ProtoSize::add_uint32_field(total_size, 1, this->minute);
ProtoSize::add_uint32_field(total_size, 1, this->second); ProtoSize::add_uint32_field(total_size, 1, this->second);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool TimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool TimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
@ -2982,9 +3076,11 @@ bool TimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
case 4: case 4:
this->second = value.as_uint32(); this->second = value.as_uint32();
break; break;
#ifdef USE_DEVICES
case 5: case 5:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -3041,12 +3137,16 @@ void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const {
void EventResponse::encode(ProtoWriteBuffer buffer) const { void EventResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_string(2, this->event_type); buffer.encode_string(2, this->event_type);
#ifdef USE_DEVICES
buffer.encode_uint32(3, this->device_id); buffer.encode_uint32(3, this->device_id);
#endif
} }
void EventResponse::calculate_size(uint32_t &total_size) const { void EventResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_string_field(total_size, 1, this->event_type); ProtoSize::add_string_field(total_size, 1, this->event_type);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
#endif #endif
#ifdef USE_VALVE #ifdef USE_VALVE
@ -3088,13 +3188,17 @@ void ValveStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_float(2, this->position); buffer.encode_float(2, this->position);
buffer.encode_uint32(3, static_cast<uint32_t>(this->current_operation)); buffer.encode_uint32(3, static_cast<uint32_t>(this->current_operation));
#ifdef USE_DEVICES
buffer.encode_uint32(4, this->device_id); buffer.encode_uint32(4, this->device_id);
#endif
} }
void ValveStateResponse::calculate_size(uint32_t &total_size) const { void ValveStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_float_field(total_size, 1, this->position); ProtoSize::add_float_field(total_size, 1, this->position);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation));
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool ValveCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool ValveCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
@ -3104,9 +3208,11 @@ bool ValveCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
case 4: case 4:
this->stop = value.as_bool(); this->stop = value.as_bool();
break; break;
#ifdef USE_DEVICES
case 5: case 5:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -3157,19 +3263,25 @@ void DateTimeStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_bool(2, this->missing_state); buffer.encode_bool(2, this->missing_state);
buffer.encode_fixed32(3, this->epoch_seconds); buffer.encode_fixed32(3, this->epoch_seconds);
#ifdef USE_DEVICES
buffer.encode_uint32(4, this->device_id); buffer.encode_uint32(4, this->device_id);
#endif
} }
void DateTimeStateResponse::calculate_size(uint32_t &total_size) const { void DateTimeStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_bool_field(total_size, 1, this->missing_state); ProtoSize::add_bool_field(total_size, 1, this->missing_state);
ProtoSize::add_fixed32_field(total_size, 1, this->epoch_seconds); ProtoSize::add_fixed32_field(total_size, 1, this->epoch_seconds);
#ifdef USE_DEVICES
ProtoSize::add_uint32_field(total_size, 1, this->device_id); ProtoSize::add_uint32_field(total_size, 1, this->device_id);
#endif
} }
bool DateTimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool DateTimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
#ifdef USE_DEVICES
case 3: case 3:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }
@ -3253,9 +3365,11 @@ bool UpdateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
case 2: case 2:
this->command = static_cast<enums::UpdateCommand>(value.as_uint32()); this->command = static_cast<enums::UpdateCommand>(value.as_uint32());
break; break;
#ifdef USE_DEVICES
case 3: case 3:
this->device_id = value.as_uint32(); this->device_id = value.as_uint32();
break; break;
#endif
default: default:
return false; return false;
} }

View File

@ -883,10 +883,13 @@ void BinarySensorStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->missing_state)); out.append(YESNO(this->missing_state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -976,10 +979,13 @@ void CoverStateResponse::dump_to(std::string &out) const {
out.append(proto_enum_to_string<enums::CoverOperation>(this->current_operation)); out.append(proto_enum_to_string<enums::CoverOperation>(this->current_operation));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void CoverCommandRequest::dump_to(std::string &out) const { void CoverCommandRequest::dump_to(std::string &out) const {
@ -1192,10 +1198,13 @@ void FanCommandRequest::dump_to(std::string &out) const {
out.append("'").append(this->preset_mode).append("'"); out.append("'").append(this->preset_mode).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -1342,10 +1351,13 @@ void LightStateResponse::dump_to(std::string &out) const {
out.append("'").append(this->effect).append("'"); out.append("'").append(this->effect).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void LightCommandRequest::dump_to(std::string &out) const { void LightCommandRequest::dump_to(std::string &out) const {
@ -1471,10 +1483,13 @@ void LightCommandRequest::dump_to(std::string &out) const {
out.append("'").append(this->effect).append("'"); out.append("'").append(this->effect).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -1534,10 +1549,13 @@ void ListEntitiesSensorResponse::dump_to(std::string &out) const {
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category)); out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void SensorStateResponse::dump_to(std::string &out) const { void SensorStateResponse::dump_to(std::string &out) const {
@ -1557,10 +1575,13 @@ void SensorStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->missing_state)); out.append(YESNO(this->missing_state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -1624,10 +1645,13 @@ void SwitchStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->state)); out.append(YESNO(this->state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void SwitchCommandRequest::dump_to(std::string &out) const { void SwitchCommandRequest::dump_to(std::string &out) const {
@ -1642,10 +1666,13 @@ void SwitchCommandRequest::dump_to(std::string &out) const {
out.append(YESNO(this->state)); out.append(YESNO(this->state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -1709,10 +1736,13 @@ void TextSensorStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->missing_state)); out.append(YESNO(this->missing_state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -2009,10 +2039,13 @@ void CameraImageResponse::dump_to(std::string &out) const {
out.append(YESNO(this->done)); out.append(YESNO(this->done));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void CameraImageRequest::dump_to(std::string &out) const { void CameraImageRequest::dump_to(std::string &out) const {
@ -2337,10 +2370,13 @@ void ClimateCommandRequest::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -2402,10 +2438,13 @@ void ListEntitiesNumberResponse::dump_to(std::string &out) const {
out.append("'").append(this->device_class).append("'"); out.append("'").append(this->device_class).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void NumberStateResponse::dump_to(std::string &out) const { void NumberStateResponse::dump_to(std::string &out) const {
@ -2425,10 +2464,13 @@ void NumberStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->missing_state)); out.append(YESNO(this->missing_state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void NumberCommandRequest::dump_to(std::string &out) const { void NumberCommandRequest::dump_to(std::string &out) const {
@ -2444,10 +2486,13 @@ void NumberCommandRequest::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -2513,10 +2558,13 @@ void SelectStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->missing_state)); out.append(YESNO(this->missing_state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void SelectCommandRequest::dump_to(std::string &out) const { void SelectCommandRequest::dump_to(std::string &out) const {
@ -2531,10 +2579,13 @@ void SelectCommandRequest::dump_to(std::string &out) const {
out.append("'").append(this->state).append("'"); out.append("'").append(this->state).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -2604,10 +2655,13 @@ void SirenStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->state)); out.append(YESNO(this->state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void SirenCommandRequest::dump_to(std::string &out) const { void SirenCommandRequest::dump_to(std::string &out) const {
@ -2730,10 +2784,13 @@ void LockStateResponse::dump_to(std::string &out) const {
out.append(proto_enum_to_string<enums::LockState>(this->state)); out.append(proto_enum_to_string<enums::LockState>(this->state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void LockCommandRequest::dump_to(std::string &out) const { void LockCommandRequest::dump_to(std::string &out) const {
@ -2756,10 +2813,13 @@ void LockCommandRequest::dump_to(std::string &out) const {
out.append("'").append(this->code).append("'"); out.append("'").append(this->code).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -2815,10 +2875,13 @@ void ButtonCommandRequest::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -2920,10 +2983,13 @@ void MediaPlayerStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->muted)); out.append(YESNO(this->muted));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void MediaPlayerCommandRequest::dump_to(std::string &out) const { void MediaPlayerCommandRequest::dump_to(std::string &out) const {
@ -3779,10 +3845,13 @@ void AlarmControlPanelStateResponse::dump_to(std::string &out) const {
out.append(proto_enum_to_string<enums::AlarmControlPanelState>(this->state)); out.append(proto_enum_to_string<enums::AlarmControlPanelState>(this->state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void AlarmControlPanelCommandRequest::dump_to(std::string &out) const { void AlarmControlPanelCommandRequest::dump_to(std::string &out) const {
@ -3801,10 +3870,13 @@ void AlarmControlPanelCommandRequest::dump_to(std::string &out) const {
out.append("'").append(this->code).append("'"); out.append("'").append(this->code).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -3882,10 +3954,13 @@ void TextStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->missing_state)); out.append(YESNO(this->missing_state));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void TextCommandRequest::dump_to(std::string &out) const { void TextCommandRequest::dump_to(std::string &out) const {
@ -3900,10 +3975,13 @@ void TextCommandRequest::dump_to(std::string &out) const {
out.append("'").append(this->state).append("'"); out.append("'").append(this->state).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -3974,10 +4052,13 @@ void DateStateResponse::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void DateCommandRequest::dump_to(std::string &out) const { void DateCommandRequest::dump_to(std::string &out) const {
@ -4003,10 +4084,13 @@ void DateCommandRequest::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -4077,10 +4161,13 @@ void TimeStateResponse::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void TimeCommandRequest::dump_to(std::string &out) const { void TimeCommandRequest::dump_to(std::string &out) const {
@ -4106,10 +4193,13 @@ void TimeCommandRequest::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -4175,10 +4265,13 @@ void EventResponse::dump_to(std::string &out) const {
out.append("'").append(this->event_type).append("'"); out.append("'").append(this->event_type).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -4255,10 +4348,13 @@ void ValveStateResponse::dump_to(std::string &out) const {
out.append(proto_enum_to_string<enums::ValveOperation>(this->current_operation)); out.append(proto_enum_to_string<enums::ValveOperation>(this->current_operation));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void ValveCommandRequest::dump_to(std::string &out) const { void ValveCommandRequest::dump_to(std::string &out) const {
@ -4282,10 +4378,13 @@ void ValveCommandRequest::dump_to(std::string &out) const {
out.append(YESNO(this->stop)); out.append(YESNO(this->stop));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -4346,10 +4445,13 @@ void DateTimeStateResponse::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
void DateTimeCommandRequest::dump_to(std::string &out) const { void DateTimeCommandRequest::dump_to(std::string &out) const {
@ -4365,10 +4467,13 @@ void DateTimeCommandRequest::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif
@ -4482,10 +4587,13 @@ void UpdateCommandRequest::dump_to(std::string &out) const {
out.append(proto_enum_to_string<enums::UpdateCommand>(this->command)); out.append(proto_enum_to_string<enums::UpdateCommand>(this->command));
out.append("\n"); out.append("\n");
#ifdef USE_DEVICES
out.append(" device_id: "); out.append(" device_id: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
out.append("}"); out.append("}");
} }
#endif #endif