1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-22 11:43:51 +01:00

[zwave_proxy, api] Add notification message when Z-Wave HomeID changes (#10860)

This commit is contained in:
Keith Burzinski
2025-09-27 17:50:18 -05:00
committed by GitHub
parent 2bf79a607f
commit 9dd6be4061
8 changed files with 79 additions and 8 deletions

View File

@@ -3112,6 +3112,27 @@ bool ZWaveProxyRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
}
return true;
}
bool ZWaveProxyRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 2: {
// Use raw data directly to avoid allocation
this->data = value.data();
this->data_len = value.size();
break;
}
default:
return false;
}
return true;
}
void ZWaveProxyRequest::encode(ProtoWriteBuffer buffer) const {
buffer.encode_uint32(1, static_cast<uint32_t>(this->type));
buffer.encode_bytes(2, this->data, this->data_len);
}
void ZWaveProxyRequest::calculate_size(ProtoSize &size) const {
size.add_uint32(1, static_cast<uint32_t>(this->type));
size.add_length(2, this->data_len);
}
#endif
} // namespace esphome::api