Merge pull request #59 from cjkas/cleanup/waiting-frame-steps

cleanup: drop the step cases onWaitingFrame never reaches
This commit is contained in:
cjkas 2026-10-17 23:35:59 +02:00 • committed by GitHub
commit fa79d44e70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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.