v1.5.1 Bug Fixes

* Fixed issue where prog command was being filtered out #27
* Added tilt wheel commands for tilt positioning with integrated tilt motors #17
* Added tilt position visibility for Edit Shade screen
This commit is contained in:
Robert Strouse 2023-04-21 14:12:28 -07:00
parent 1174bed558
commit 39c6e08ca5
7 changed files with 26 additions and 31 deletions

View file

@ -1022,43 +1022,38 @@ void SomfyShade::processFrame(somfy_frame_t &frame, bool internal) {
}
break;
case somfy_commands::StepUp:
dir = 0;
this->lastFrame.processed = true;
// With the step commands and integrated shades
// the motor must tilt in the direction first then move
// so we have to calculate the target with this in mind.
if(this->tiltType == tilt_types::integrated) {
// First check to see if the tilt is 0. If it is not then we need to tilt.
if(this->currentTiltPos != 0.0f) {
this->tiltTarget = max(0.0f, this->currentTiltPos - 0.5f);
if(this->currentTiltPos > 0.0f) {
this->tiltTarget = max(0.0f, this->currentTiltPos - 1.0f);
}
else {
}
}
if(!internal) {
this->lastFrame.await = millis() + 200;
}
else {
this->lastFrame.processed = true;
// Simply move the shade up by 1%.
if(this->currentPos > 0) {
this->target = this->currentPos - 0.5f;
dir = -1;
else if(this->currentPos > 0.0f) {
this->target = max(0.0f, this->currentPos - 1.0f);
}
}
else if(this->currentPos > 0.0f) this->target = max(0.0f, this->currentPos - 1.0f);
break;
case somfy_commands::StepDown:
if(!internal) {
this->lastFrame.await = millis() + 200;
}
else {
this->lastFrame.processed = true;
// Simply move the shade down by 1%.
if(this->currentPos < 100) {
this->target = this->currentPos + 0.5f;
dir = 1;
dir = 1;
this->lastFrame.processed = true;
// With the step commands and integrated shades
// the motor must tilt in the direction first then move
// so we have to calculate the target with this in mind.
if(this->tiltType == tilt_types::integrated) {
// First check to see if the tilt is 0. If it is not then we need to tilt.
if(this->currentTiltPos < 100.0f) {
this->tiltTarget = min(100.0f, this->currentTiltPos + 1.0f);
}
else if(this->currentPos > 100.0f) {
this->target = min(100.0f, this->currentPos + 1.0f);
}
}
else if(this->currentPos < 100.0f) this->target = min(100.0f, this->currentPos + 1.0f);
break;
default:
dir = 0;