mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 11:02:12 +01:00
Bug Fix Prog
* Added filter for prog frame #27 * Expanded link remote json buffer #25 * Display tilt position on edit shade screen
This commit is contained in:
parent
5a16977ea9
commit
1174bed558
5 changed files with 19 additions and 2 deletions
16
Somfy.cpp
16
Somfy.cpp
|
|
@ -1022,6 +1022,19 @@ void SomfyShade::processFrame(somfy_frame_t &frame, bool internal) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case somfy_commands::StepUp:
|
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) {
|
if(!internal) {
|
||||||
this->lastFrame.await = millis() + 200;
|
this->lastFrame.await = millis() + 200;
|
||||||
}
|
}
|
||||||
|
|
@ -1178,6 +1191,9 @@ void SomfyShade::sendCommand(somfy_commands cmd, uint8_t repeat) {
|
||||||
this->tiltTarget = this->currentTiltPos;
|
this->tiltTarget = this->currentTiltPos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
SomfyRemote::sendCommand(cmd, repeat);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void SomfyShade::sendTiltCommand(somfy_commands cmd) {
|
void SomfyShade::sendTiltCommand(somfy_commands cmd) {
|
||||||
if(cmd == somfy_commands::Up) {
|
if(cmd == somfy_commands::Up) {
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
4
Web.cpp
4
Web.cpp
|
|
@ -1047,7 +1047,7 @@ void Web::begin() {
|
||||||
else {
|
else {
|
||||||
server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Remote address not provided.\"}"));
|
server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Remote address not provided.\"}"));
|
||||||
}
|
}
|
||||||
DynamicJsonDocument sdoc(512);
|
DynamicJsonDocument sdoc(2048);
|
||||||
JsonObject sobj = sdoc.to<JsonObject>();
|
JsonObject sobj = sdoc.to<JsonObject>();
|
||||||
shade->toJSON(sobj);
|
shade->toJSON(sobj);
|
||||||
serializeJson(sdoc, g_content);
|
serializeJson(sdoc, g_content);
|
||||||
|
|
@ -1095,7 +1095,7 @@ void Web::begin() {
|
||||||
else {
|
else {
|
||||||
server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Remote address not provided.\"}"));
|
server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Remote address not provided.\"}"));
|
||||||
}
|
}
|
||||||
DynamicJsonDocument sdoc(512);
|
DynamicJsonDocument sdoc(2048);
|
||||||
JsonObject sobj = sdoc.to<JsonObject>();
|
JsonObject sobj = sdoc.to<JsonObject>();
|
||||||
shade->toJSON(sobj);
|
shade->toJSON(sobj);
|
||||||
serializeJson(sdoc, g_content);
|
serializeJson(sdoc, g_content);
|
||||||
|
|
|
||||||
|
|
@ -1484,6 +1484,7 @@ class Somfy {
|
||||||
let tilt = ico.parentElement.querySelector('i.icss-window-tilt');
|
let tilt = ico.parentElement.querySelector('i.icss-window-tilt');
|
||||||
tilt.style.display = shade.tiltType !== 0 ? '' : 'none';
|
tilt.style.display = shade.tiltType !== 0 ? '' : 'none';
|
||||||
tilt.setAttribute('data-tiltposition', shade.tiltPosition);
|
tilt.setAttribute('data-tiltposition', shade.tiltPosition);
|
||||||
|
tilt.setAttribute('data-shadeid', shade.shadeId);
|
||||||
ico.style.setProperty('--shade-position', `${shade.position}%`);
|
ico.style.setProperty('--shade-position', `${shade.position}%`);
|
||||||
ico.style.setProperty('--tilt-position', `${shade.tiltPosition}%`);
|
ico.style.setProperty('--tilt-position', `${shade.tiltPosition}%`);
|
||||||
ico.setAttribute('data-shadeid', shade.shadeId);
|
ico.setAttribute('data-shadeid', shade.shadeId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue