diff --git a/Somfy.cpp b/Somfy.cpp index a8dda8a..7ee92f3 100644 --- a/Somfy.cpp +++ b/Somfy.cpp @@ -1022,6 +1022,19 @@ void SomfyShade::processFrame(somfy_frame_t &frame, bool internal) { } break; case somfy_commands::StepUp: + // 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); + } + else { + + } + } + if(!internal) { this->lastFrame.await = millis() + 200; } @@ -1178,6 +1191,9 @@ void SomfyShade::sendCommand(somfy_commands cmd, uint8_t repeat) { this->tiltTarget = this->currentTiltPos; } } + else { + SomfyRemote::sendCommand(cmd, repeat); + } } void SomfyShade::sendTiltCommand(somfy_commands cmd) { if(cmd == somfy_commands::Up) { diff --git a/SomfyController.ino.esp32.bin b/SomfyController.ino.esp32.bin index e60d6d1..45cbe92 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 e6997cd..3a2d85e 100644 Binary files a/SomfyController.littlefs.bin and b/SomfyController.littlefs.bin differ diff --git a/Web.cpp b/Web.cpp index 433e9ec..fb856d6 100644 --- a/Web.cpp +++ b/Web.cpp @@ -1047,7 +1047,7 @@ void Web::begin() { else { server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Remote address not provided.\"}")); } - DynamicJsonDocument sdoc(512); + DynamicJsonDocument sdoc(2048); JsonObject sobj = sdoc.to(); shade->toJSON(sobj); serializeJson(sdoc, g_content); @@ -1095,7 +1095,7 @@ void Web::begin() { else { server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Remote address not provided.\"}")); } - DynamicJsonDocument sdoc(512); + DynamicJsonDocument sdoc(2048); JsonObject sobj = sdoc.to(); shade->toJSON(sobj); serializeJson(sdoc, g_content); diff --git a/data/index.js b/data/index.js index 07c7af3..af615af 100644 --- a/data/index.js +++ b/data/index.js @@ -1484,6 +1484,7 @@ class Somfy { let tilt = ico.parentElement.querySelector('i.icss-window-tilt'); tilt.style.display = shade.tiltType !== 0 ? '' : 'none'; tilt.setAttribute('data-tiltposition', shade.tiltPosition); + tilt.setAttribute('data-shadeid', shade.shadeId); ico.style.setProperty('--shade-position', `${shade.position}%`); ico.style.setProperty('--tilt-position', `${shade.tiltPosition}%`); ico.setAttribute('data-shadeid', shade.shadeId);