1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 21:32:21 +01:00

Send manufacturer name via API (#3938)

This commit is contained in:
Jesse Hills
2022-10-25 17:24:38 +13:00
committed by GitHub
parent 702b60ce66
commit d93f35701f
4 changed files with 17 additions and 0 deletions

View File

@@ -576,6 +576,10 @@ bool DeviceInfoResponse::decode_length(uint32_t field_id, ProtoLengthDelimited v
this->project_version = value.as_string();
return true;
}
case 12: {
this->manufacturer = value.as_string();
return true;
}
default:
return false;
}
@@ -592,6 +596,7 @@ void DeviceInfoResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_string(9, this->project_version);
buffer.encode_uint32(10, this->webserver_port);
buffer.encode_uint32(11, this->bluetooth_proxy_version);
buffer.encode_string(12, this->manufacturer);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void DeviceInfoResponse::dump_to(std::string &out) const {
@@ -642,6 +647,10 @@ void DeviceInfoResponse::dump_to(std::string &out) const {
sprintf(buffer, "%u", this->bluetooth_proxy_version);
out.append(buffer);
out.append("\n");
out.append(" manufacturer: ");
out.append("'").append(this->manufacturer).append("'");
out.append("\n");
out.append("}");
}
#endif