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

This commit is contained in:
J. Nick Koston
2025-12-10 04:19:29 +01:00
committed by GitHub
parent 5601a2b686
commit 03c391bd43
7 changed files with 21 additions and 12 deletions
+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;
}