mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 22:02:17 +01:00
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:
parent
29211630f2
commit
9ba33c75db
1 changed files with 1 additions and 9 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue