cleanup: drop the group members SomfyGroup::fromJSON threw away

fromJSON read linkedShades into a local array and dropped it, so /addGroup
and /saveGroup never changed a group's members; /linkToGroup and
/unlinkFromGroup do, with ModelEditor's checks. The loop also wrote past
the end of that stack array when a request listed more than 32 shades.
No client sends the list: the web UI's group form has no members field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-17 23:23:13 +02:00
parent 29211630f2
commit 9ba33c75db

View file

@ -179,15 +179,7 @@ bool SomfyGroup::fromJSON(JsonObject &obj) {
//if(!obj["sunSensor"].isNull()) this->hasSunSensor() = obj["sunSensor"]; This is calculated //if(!obj["sunSensor"].isNull()) this->hasSunSensor() = obj["sunSensor"]; This is calculated
if(!obj["repeats"].isNull()) this->repeats = obj["repeats"]; if(!obj["repeats"].isNull()) this->repeats = obj["repeats"];
if(!obj["linkedShades"].isNull()) { // Members change only through /linkToGroup and /unlinkFromGroup (ModelEditor).
uint8_t linkedShades[SOMFY_MAX_GROUPED_SHADES];
memset(linkedShades, 0x00, sizeof(linkedShades));
JsonArray arr = obj["linkedShades"];
uint8_t i = 0;
for(uint8_t shadeId : arr) {
linkedShades[i++] = shadeId;
}
}
return true; return true;
} }
bool Transceiver::fromJSON(JsonObject& obj) { bool Transceiver::fromJSON(JsonObject& obj) {