mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
fix: don't read a missing linked shade's flags in group state events
SomfyGroup::emitState skipped a linked shade id that no longer resolves when listing the shades, but still read its flags through the null pointer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c1b47f898c
commit
53dfe619d0
1 changed files with 4 additions and 2 deletions
|
|
@ -1565,8 +1565,10 @@ void SomfyGroup::emitState(uint8_t num, const char *evt) {
|
|||
for(uint8_t i = 0; i < SOMFY_MAX_GROUPED_SHADES; i++) {
|
||||
if(this->linkedShades[i] != 255 && this->linkedShades[i] != 0) {
|
||||
SomfyShade *shade = somfy.getShadeById(this->linkedShades[i]);
|
||||
if(shade) json->addElem(this->linkedShades[i]);
|
||||
flags |= shade->flags;
|
||||
if(shade) {
|
||||
json->addElem(this->linkedShades[i]);
|
||||
flags |= shade->flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
json->endArray();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue