cleanup: drop the step cases onWaitingFrame never reaches

onWaitingFrame only acts on a frame that isn't processed yet, and the
step rule in onFrame marks a step frame processed as soon as it arrives;
a repeat or synonym keeps the mark. So the "fixed 1% step of a held step
button" never ran. A new test pins what a held step button does: one
step by the frame's step size. SOMFY_SPLIT_PLAN.md is corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-17 23:25:16 +02:00
parent 29211630f2
commit 9df2638f03
3 changed files with 15 additions and 19 deletions

View file

@ -364,24 +364,7 @@ void ShadeBehaviour::onWaitingFrame(uint32_t now) {
if(this->lastFrame.await > 0 && static_cast<int32_t>(now - this->lastFrame.await) > 0) {
somfy_commands cmd = this->transformCommand(this->lastFrame.cmd);
switch(cmd) {
case somfy_commands::StepUp:
this->lastFrame.processed = true;
// Simply move the shade up by 1%.
if(this->s.currentPos > 0) {
this->p_target(floor(this->s.currentPos) - 1);
this->setMovement(-1, now);
this->emitCommand(cmd, "remote", this->lastFrame.remoteAddress);
}
break;
case somfy_commands::StepDown:
this->lastFrame.processed = true;
// Simply move the shade down by 1%.
if(this->s.currentPos < 100) {
this->p_target(floor(this->s.currentPos) + 1);
this->setMovement(1, now);
this->emitCommand(cmd, "remote", this->lastFrame.remoteAddress);
}
break;
// A step acts as soon as it arrives (onFrame), so it is never waiting here.
case somfy_commands::Down:
case somfy_commands::Up:
if(this->settings.tiltType == tilt_types::tiltmotor) { // Theoretically this should get here unless it does have a tilt motor.