mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 19:12:10 +01:00
Add invert options for commands and position #69
This commit is contained in:
parent
536bf839a1
commit
ec499cbec4
11 changed files with 138 additions and 67 deletions
10
Web.cpp
10
Web.cpp
|
|
@ -167,7 +167,7 @@ void Web::begin() {
|
|||
Serial.println(apiServer.arg("plain"));
|
||||
// Send the command to the shade.
|
||||
if(target <= 100)
|
||||
shade->moveToTarget(target);
|
||||
shade->moveToTarget(shade->transformPosition(target));
|
||||
else
|
||||
shade->sendCommand(command, repeat);
|
||||
DynamicJsonDocument sdoc(512);
|
||||
|
|
@ -231,7 +231,7 @@ void Web::begin() {
|
|||
Serial.println(apiServer.arg("plain"));
|
||||
// Send the command to the shade.
|
||||
if(target <= 100)
|
||||
shade->moveToTiltTarget(target);
|
||||
shade->moveToTiltTarget(shade->transformPosition(target));
|
||||
else
|
||||
shade->sendTiltCommand(command);
|
||||
DynamicJsonDocument sdoc(512);
|
||||
|
|
@ -688,7 +688,7 @@ void Web::begin() {
|
|||
Serial.println(server.arg("plain"));
|
||||
// Send the command to the shade.
|
||||
if(target <= 100)
|
||||
shade->moveToTiltTarget(target);
|
||||
shade->moveToTiltTarget(shade->transformPosition(target));
|
||||
else
|
||||
shade->sendTiltCommand(command);
|
||||
DynamicJsonDocument sdoc(512);
|
||||
|
|
@ -755,7 +755,7 @@ void Web::begin() {
|
|||
Serial.println(server.arg("plain"));
|
||||
// Send the command to the shade.
|
||||
if(target <= 100)
|
||||
shade->moveToTarget(target);
|
||||
shade->moveToTarget(shade->transformPosition(target));
|
||||
else
|
||||
shade->sendCommand(command, repeat);
|
||||
DynamicJsonDocument sdoc(512);
|
||||
|
|
@ -813,7 +813,7 @@ void Web::begin() {
|
|||
if(tilt < 0) tilt = shade->myPos;
|
||||
if(shade->tiltType == tilt_types::none) tilt = -1;
|
||||
if(pos >= 0 && pos <= 100)
|
||||
shade->setMyPosition(pos, tilt);
|
||||
shade->setMyPosition(shade->transformPosition(pos), shade->transformPosition(tilt));
|
||||
DynamicJsonDocument sdoc(512);
|
||||
JsonObject sobj = sdoc.to<JsonObject>();
|
||||
shade->toJSON(sobj);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue