Somfy: add SunFlag auto movement logic

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2023-06-02 12:10:24 +02:00
parent 1be1fe4fba
commit e55d7a4205

View file

@ -1112,6 +1112,15 @@ void SomfyShade::processFrame(somfy_frame_t &frame, bool internal) {
break;
case somfy_commands::SunFlag:
this->flags |= static_cast<uint8_t>(somfy_flags_t::SunFlag);
if (!(this->flags & static_cast<uint8_t>(somfy_flags_t::Windy)))
{
if (this->flags & static_cast<uint8_t>(somfy_flags_t::Sunny))
this->target = 100.0f;
else
this->target = 0.0f;
}
this->emitState();
break;
case somfy_commands::Up: