From e55d7a4205eec6370415ec18263dac5d259bf3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Fri, 2 Jun 2023 12:10:24 +0200 Subject: [PATCH] Somfy: add SunFlag auto movement logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Fernández Rojas --- Somfy.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Somfy.cpp b/Somfy.cpp index 5aca6c9..2678dbd 100644 --- a/Somfy.cpp +++ b/Somfy.cpp @@ -1112,6 +1112,15 @@ void SomfyShade::processFrame(somfy_frame_t &frame, bool internal) { break; case somfy_commands::SunFlag: this->flags |= static_cast(somfy_flags_t::SunFlag); + + if (!(this->flags & static_cast(somfy_flags_t::Windy))) + { + if (this->flags & static_cast(somfy_flags_t::Sunny)) + this->target = 100.0f; + else + this->target = 0.0f; + } + this->emitState(); break; case somfy_commands::Up: