Fix issue where the available shades to be grouped was not correct #183

This commit is contained in:
Robert Strouse 2023-10-29 14:44:07 -07:00
parent 46f6e6912d
commit 9444d6119b
2 changed files with 2 additions and 2 deletions

Binary file not shown.

View file

@ -1205,7 +1205,7 @@ void Web::begin() {
int groupId = atoi(server.arg("groupId").c_str()); int groupId = atoi(server.arg("groupId").c_str());
SomfyGroup* group = somfy.getGroupById(groupId); SomfyGroup* group = somfy.getGroupById(groupId);
if (group) { if (group) {
DynamicJsonDocument doc(4096); DynamicJsonDocument doc(8192);
JsonObject obj = doc.to<JsonObject>(); JsonObject obj = doc.to<JsonObject>();
group->toJSON(obj); group->toJSON(obj);
JsonArray arr = obj.createNestedArray("availShades"); JsonArray arr = obj.createNestedArray("availShades");
@ -1214,7 +1214,7 @@ void Web::begin() {
if(shade->getShadeId() != 255) { if(shade->getShadeId() != 255) {
bool isLinked = false; bool isLinked = false;
for(uint8_t j = 0; j < SOMFY_MAX_GROUPED_SHADES; j++) { for(uint8_t j = 0; j < SOMFY_MAX_GROUPED_SHADES; j++) {
if(group->linkedShades[i] == shade->getShadeId()) { if(group->linkedShades[j] == shade->getShadeId()) {
isLinked = true; isLinked = true;
break; break;
} }