mirror of
https://github.com/esphome/esphome.git
synced 2025-08-01 16:07:47 +00:00
fix a few more that are missing
This commit is contained in:
parent
5adfb71fe1
commit
561ed32b2a
@ -2139,7 +2139,7 @@ message DateTimeStateResponse {
|
||||
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
||||
bool missing_state = 2;
|
||||
fixed32 epoch_seconds = 3;
|
||||
uint32 device_id = 4;
|
||||
uint32 device_id = 4 [(field_ifdef) = "USE_DEVICES"];
|
||||
}
|
||||
message DateTimeCommandRequest {
|
||||
option (id) = 114;
|
||||
@ -2150,7 +2150,7 @@ message DateTimeCommandRequest {
|
||||
|
||||
fixed32 key = 1;
|
||||
fixed32 epoch_seconds = 2;
|
||||
uint32 device_id = 3;
|
||||
uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
|
||||
}
|
||||
|
||||
// ==================== UPDATE ====================
|
||||
@ -2204,5 +2204,5 @@ message UpdateCommandRequest {
|
||||
|
||||
fixed32 key = 1;
|
||||
UpdateCommand command = 2;
|
||||
uint32 device_id = 3;
|
||||
uint32 device_id = 3 [(field_ifdef) = "USE_DEVICES"];
|
||||
}
|
||||
|
@ -3263,19 +3263,25 @@ void DateTimeStateResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_fixed32(1, this->key);
|
||||
buffer.encode_bool(2, this->missing_state);
|
||||
buffer.encode_fixed32(3, this->epoch_seconds);
|
||||
#ifdef USE_DEVICES
|
||||
buffer.encode_uint32(4, this->device_id);
|
||||
#endif
|
||||
}
|
||||
void DateTimeStateResponse::calculate_size(uint32_t &total_size) const {
|
||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||
ProtoSize::add_bool_field(total_size, 1, this->missing_state);
|
||||
ProtoSize::add_fixed32_field(total_size, 1, this->epoch_seconds);
|
||||
#ifdef USE_DEVICES
|
||||
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
||||
#endif
|
||||
}
|
||||
bool DateTimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
switch (field_id) {
|
||||
#ifdef USE_DEVICES
|
||||
case 3:
|
||||
this->device_id = value.as_uint32();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -3359,9 +3365,11 @@ bool UpdateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
case 2:
|
||||
this->command = static_cast<enums::UpdateCommand>(value.as_uint32());
|
||||
break;
|
||||
#ifdef USE_DEVICES
|
||||
case 3:
|
||||
this->device_id = value.as_uint32();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -4445,10 +4445,13 @@ void DateTimeStateResponse::dump_to(std::string &out) const {
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
#ifdef USE_DEVICES
|
||||
out.append(" device_id: ");
|
||||
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
#endif
|
||||
out.append("}");
|
||||
}
|
||||
void DateTimeCommandRequest::dump_to(std::string &out) const {
|
||||
@ -4464,10 +4467,13 @@ void DateTimeCommandRequest::dump_to(std::string &out) const {
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
#ifdef USE_DEVICES
|
||||
out.append(" device_id: ");
|
||||
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
#endif
|
||||
out.append("}");
|
||||
}
|
||||
#endif
|
||||
@ -4581,10 +4587,13 @@ void UpdateCommandRequest::dump_to(std::string &out) const {
|
||||
out.append(proto_enum_to_string<enums::UpdateCommand>(this->command));
|
||||
out.append("\n");
|
||||
|
||||
#ifdef USE_DEVICES
|
||||
out.append(" device_id: ");
|
||||
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
#endif
|
||||
out.append("}");
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user