From ac4fcab0290b7677e3b5925dd7e7eed5dd03ac1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 3 Jun 2023 11:31:04 +0200 Subject: [PATCH] Somfy: commit flags when they change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Fernández Rojas --- ConfigFile.cpp | 2 +- Somfy.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ConfigFile.cpp b/ConfigFile.cpp index c4fb891..197e1c0 100644 --- a/ConfigFile.cpp +++ b/ConfigFile.cpp @@ -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(somfy_flags_t::SunFlag)); this->writeFloat(shade->myPos, 5); this->writeFloat(shade->myTiltPos, 5); this->writeFloat(shade->currentPos, 5); diff --git a/Somfy.cpp b/Somfy.cpp index 4bc1623..3c1e4f6 100644 --- a/Somfy.cpp +++ b/Somfy.cpp @@ -1215,6 +1215,7 @@ void SomfyShade::processFrame(somfy_frame_t &frame, bool internal) { case somfy_commands::Flag: this->flags &= ~(static_cast(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;