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
628caf63fc
commit
86ceccbb1c
@ -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 ====================
|
||||||
|
@ -1462,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);
|
||||||
@ -1479,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;
|
||||||
}
|
}
|
||||||
@ -1556,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;
|
||||||
}
|
}
|
||||||
@ -1637,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) {
|
||||||
@ -1736,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) {
|
||||||
@ -1751,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;
|
||||||
}
|
}
|
||||||
@ -1811,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;
|
||||||
}
|
}
|
||||||
|
@ -2438,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 {
|
||||||
@ -2461,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 {
|
||||||
@ -2480,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
|
||||||
@ -2549,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 {
|
||||||
@ -2567,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
|
||||||
@ -2640,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 {
|
||||||
@ -2766,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 {
|
||||||
@ -2792,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
|
||||||
@ -2851,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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user