[light] Add zero-copy support for API effect commands (#12384)

This commit is contained in:
J. Nick Koston authored and Jonathan Swoboda committed 2025-12-12 11:12:58 -05:00
1 parent a3a2a6d965
commit 1d13d18a16
7 files changed
+21 -12

No files matched your search

+5 -2
View File
@@ -611,9 +611,12 @@ bool LightCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
}
bool LightCommandRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 19:
this->effect = value.as_string();
case 19: {
// Use raw data directly to avoid allocation
this->effect = value.data();
this->effect_len = value.size();
break;
}
default:
return false;
}