diff --git a/ConfigSettings.h b/ConfigSettings.h index bbb1f51..a22aad8 100644 --- a/ConfigSettings.h +++ b/ConfigSettings.h @@ -3,7 +3,7 @@ #ifndef configsettings_h #define configsettings_h -#define FW_VERSION "v1.5.0" +#define FW_VERSION "v1.5.1" enum DeviceStatus { DS_OK = 0, DS_ERROR = 1, diff --git a/Somfy.cpp b/Somfy.cpp index 7ee92f3..3979792 100644 --- a/Somfy.cpp +++ b/Somfy.cpp @@ -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; diff --git a/SomfyController.ino.esp32.bin b/SomfyController.ino.esp32.bin index 45cbe92..b82b694 100644 Binary files a/SomfyController.ino.esp32.bin and b/SomfyController.ino.esp32.bin differ diff --git a/SomfyController.littlefs.bin b/SomfyController.littlefs.bin index 3a2d85e..f8918ec 100644 Binary files a/SomfyController.littlefs.bin and b/SomfyController.littlefs.bin differ diff --git a/data/appversion b/data/appversion index 3e1ad72..8e03717 100644 --- a/data/appversion +++ b/data/appversion @@ -1 +1 @@ -1.5.0 \ No newline at end of file +1.5.1 \ No newline at end of file diff --git a/data/index.html b/data/index.html index f89f6bd..426d3a8 100644 --- a/data/index.html +++ b/data/index.html @@ -3,10 +3,10 @@
- - + + - +