Somfy: commit flags when they change

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2023-06-03 11:31:04 +02:00
parent dbff287437
commit ac4fcab029
2 changed files with 3 additions and 1 deletions

View file

@ -360,7 +360,7 @@ bool ShadeConfigFile::writeShadeRecord(SomfyShade *shade) {
this->writeUInt32(rem->getRemoteAddress());
}
this->writeUInt16(shade->lastRollingCode);
this->writeUInt8(shade->flags);
this->writeUInt8(shade->flags & static_cast<uint8_t>(somfy_flags_t::SunFlag));
this->writeFloat(shade->myPos, 5);
this->writeFloat(shade->myTiltPos, 5);
this->writeFloat(shade->currentPos, 5);

View file

@ -1215,6 +1215,7 @@ void SomfyShade::processFrame(somfy_frame_t &frame, bool internal) {
case somfy_commands::Flag:
this->flags &= ~(static_cast<uint8_t>(somfy_flags_t::SunFlag));
somfy.isDirty = true;
this->emitState();
break;
case somfy_commands::SunFlag:
@ -1233,6 +1234,7 @@ void SomfyShade::processFrame(somfy_frame_t &frame, bool internal) {
this->target = 0.0f;
}
somfy.isDirty = true;
this->emitState();
}
break;