fix: ignore a received StepUp for a shade with no up time

The lift StepUp checked downTime for 0 but divided by upTime, so a shade with
an up time of 0 had its target sent to 0% instead of the step being ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-12 20:58:10 +02:00
parent d85b3d30c8
commit 4dd4a9872e

View file

@ -2019,7 +2019,7 @@ void SomfyShade::processFrame(somfy_frame_t &frame, bool internal) {
this->p_tiltTarget(max(0.0f, this->currentTiltPos - (100.0f/(static_cast<float>(this->tiltTime/static_cast<float>(this->stepSize * this->lastFrame.stepSize))))));
}
else if(this->currentPos > 0.0f) {
if(this->downTime == 0 || this->stepSize == 0) return;
if(this->upTime == 0 || this->stepSize == 0) return;
this->p_target(max(0.0f, this->currentPos - (100.0f/(static_cast<float>(this->upTime/static_cast<float>(this->stepSize * this->lastFrame.stepSize))))));
}
this->emitCommand(cmd, internal ? "internal" : "remote", frame.remoteAddress);