mirror of
https://github.com/esphome/esphome.git
synced 2025-08-02 08:27:47 +00:00
fix a few more that are missing
This commit is contained in:
parent
f6c12229e5
commit
dfdec8ec0a
@ -1961,7 +1961,7 @@ message DateStateResponse {
|
||||
uint32 year = 3;
|
||||
uint32 month = 4;
|
||||
uint32 day = 5;
|
||||
uint32 device_id = 6;
|
||||
uint32 device_id = 6 [(field_ifdef) = "USE_DEVICES"];
|
||||
}
|
||||
message DateCommandRequest {
|
||||
option (id) = 102;
|
||||
@ -1974,7 +1974,7 @@ message DateCommandRequest {
|
||||
uint32 year = 2;
|
||||
uint32 month = 3;
|
||||
uint32 day = 4;
|
||||
uint32 device_id = 5;
|
||||
uint32 device_id = 5 [(field_ifdef) = "USE_DEVICES"];
|
||||
}
|
||||
|
||||
// ==================== DATETIME TIME ====================
|
||||
@ -2008,7 +2008,7 @@ message TimeStateResponse {
|
||||
uint32 hour = 3;
|
||||
uint32 minute = 4;
|
||||
uint32 second = 5;
|
||||
uint32 device_id = 6;
|
||||
uint32 device_id = 6 [(field_ifdef) = "USE_DEVICES"];
|
||||
}
|
||||
message TimeCommandRequest {
|
||||
option (id) = 105;
|
||||
@ -2021,7 +2021,7 @@ message TimeCommandRequest {
|
||||
uint32 hour = 2;
|
||||
uint32 minute = 3;
|
||||
uint32 second = 4;
|
||||
uint32 device_id = 5;
|
||||
uint32 device_id = 5 [(field_ifdef) = "USE_DEVICES"];
|
||||
}
|
||||
|
||||
// ==================== EVENT ====================
|
||||
|
@ -2972,7 +2972,9 @@ void DateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_uint32(3, this->year);
|
||||
buffer.encode_uint32(4, this->month);
|
||||
buffer.encode_uint32(5, this->day);
|
||||
#ifdef USE_DEVICES
|
||||
buffer.encode_uint32(6, this->device_id);
|
||||
#endif
|
||||
}
|
||||
void DateStateResponse::calculate_size(uint32_t &total_size) const {
|
||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||
@ -2980,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->month);
|
||||
ProtoSize::add_uint32_field(total_size, 1, this->day);
|
||||
#ifdef USE_DEVICES
|
||||
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
||||
#endif
|
||||
}
|
||||
bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
switch (field_id) {
|
||||
@ -2993,9 +2997,11 @@ bool DateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
case 4:
|
||||
this->day = value.as_uint32();
|
||||
break;
|
||||
#ifdef USE_DEVICES
|
||||
case 5:
|
||||
this->device_id = value.as_uint32();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -3045,7 +3051,9 @@ void TimeStateResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_uint32(3, this->hour);
|
||||
buffer.encode_uint32(4, this->minute);
|
||||
buffer.encode_uint32(5, this->second);
|
||||
#ifdef USE_DEVICES
|
||||
buffer.encode_uint32(6, this->device_id);
|
||||
#endif
|
||||
}
|
||||
void TimeStateResponse::calculate_size(uint32_t &total_size) const {
|
||||
ProtoSize::add_fixed32_field(total_size, 1, this->key);
|
||||
@ -3053,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->minute);
|
||||
ProtoSize::add_uint32_field(total_size, 1, this->second);
|
||||
#ifdef USE_DEVICES
|
||||
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
||||
#endif
|
||||
}
|
||||
bool TimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
switch (field_id) {
|
||||
@ -3066,9 +3076,11 @@ bool TimeCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
case 4:
|
||||
this->second = value.as_uint32();
|
||||
break;
|
||||
#ifdef USE_DEVICES
|
||||
case 5:
|
||||
this->device_id = value.as_uint32();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -4052,10 +4052,13 @@ void DateStateResponse::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 DateCommandRequest::dump_to(std::string &out) const {
|
||||
@ -4081,10 +4084,13 @@ void DateCommandRequest::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
|
||||
@ -4155,10 +4161,13 @@ void TimeStateResponse::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 TimeCommandRequest::dump_to(std::string &out) const {
|
||||
@ -4184,10 +4193,13 @@ void TimeCommandRequest::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
|
||||
|
Loading…
x
Reference in New Issue
Block a user