Always send Up/Down at hard-stop positions for recalibration

moveToTarget() silently dropped commands when pos == currentPos,
which prevented position recalibration via slider, MQTT, or Home
Assistant when the shade was already at 0% or 100%. Physical
end-stops are ground truth — always send the command so the motor
can jog to the hard stop and self-correct any position drift.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Frédéric Metrich 2026-07-04 16:31:23 +02:00
parent a5f7404b95
commit c88d36997f

View file

@ -3833,6 +3833,10 @@ void SomfyShade::moveToTarget(float pos, float tilt)
cmd = somfy_commands::Up;
else if (pos > this->currentPos)
cmd = somfy_commands::Down;
else if (pos == 0.0f)
cmd = somfy_commands::Up; // Hard stop: always send to allow position recalibration
else if (pos == 100.0f)
cmd = somfy_commands::Down; // Hard stop: always send to allow position recalibration
else if (tilt >= 0 && tilt < this->currentTiltPos)
cmd = somfy_commands::Up;
else if (tilt >= 0 && tilt > this->currentTiltPos)