* Added Sao Paulo timezone
* Check for target change before movement so the shades to run to my position.
This commit is contained in:
Robert Strouse 2023-05-22 19:09:57 -07:00
parent a5868618c7
commit 5f67b99f88
5 changed files with 21 additions and 17 deletions

View file

@ -254,6 +254,7 @@ bool Network::connectWiFi() {
Serial.print("Set hostname to:"); Serial.print("Set hostname to:");
Serial.println(WiFi.getHostname()); Serial.println(WiFi.getHostname());
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE); WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE);
WiFi.setSleep(false);
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
delay(100); delay(100);
WiFi.begin(settings.WIFI.ssid, settings.WIFI.passphrase); WiFi.begin(settings.WIFI.ssid, settings.WIFI.passphrase);

View file

@ -1349,24 +1349,26 @@ void SomfyShade::moveToTarget(float pos, float tilt) {
cmd = somfy_commands::Up; cmd = somfy_commands::Up;
else if(tilt >= 0 && tilt > this->currentTiltPos) else if(tilt >= 0 && tilt > this->currentTiltPos)
cmd = somfy_commands::Down; cmd = somfy_commands::Down;
Serial.print("Moving to "); if(cmd != somfy_commands::My) {
Serial.print(pos); Serial.print("Moving to ");
Serial.print("% from "); Serial.print(pos);
Serial.print(this->currentPos);
if(tilt >= 0) {
Serial.print(" tilt ");
Serial.print(tilt);
Serial.print("% from "); Serial.print("% from ");
Serial.print(this->currentTiltPos); Serial.print(this->currentPos);
} if(tilt >= 0) {
Serial.print("% using "); Serial.print(" tilt ");
Serial.println(translateSomfyCommand(cmd)); Serial.print(tilt);
SomfyRemote::sendCommand(cmd); Serial.print("% from ");
this->target = pos; Serial.print(this->currentTiltPos);
this->settingPos = true; }
if(tilt >= 0) { Serial.print("% using ");
this->tiltTarget = tilt; Serial.println(translateSomfyCommand(cmd));
this->settingTiltPos = true; SomfyRemote::sendCommand(cmd);
this->settingPos = true;
this->target = pos;
if(tilt >= 0) {
this->tiltTarget = tilt;
this->settingTiltPos = true;
}
} }
} }
bool SomfyShade::save() { bool SomfyShade::save() {

Binary file not shown.

Binary file not shown.

View file

@ -430,6 +430,7 @@ class General {
{ city: "America/Miquelon", code: "<-03>3<-02>,M3.2.0,M11.1.0" }, { city: "America/Miquelon", code: "<-03>3<-02>,M3.2.0,M11.1.0" },
{ city: "America/Noronha", code: "<-02>2" }, { city: "America/Noronha", code: "<-02>2" },
{ city: "America/Santiago", code: "<-04>4<-03>,M9.1.6/24,M4.1.6/24" }, { city: "America/Santiago", code: "<-04>4<-03>,M9.1.6/24,M4.1.6/24" },
{ city: "America/Sao_Paulo", code: "<-03>3" },
{ city: "America/Scoresbysund", code: "<-01>1<+00>,M3.5.0/0,M10.5.0/1" }, { city: "America/Scoresbysund", code: "<-01>1<+00>,M3.5.0/0,M10.5.0/1" },
{ city: "America/St_Johns", code: "NST3:30NDT,M3.2.0,M11.1.0" }, { city: "America/St_Johns", code: "NST3:30NDT,M3.2.0,M11.1.0" },
{ city: "Antarctica/Casey", code: "<+11>-11" }, { city: "Antarctica/Casey", code: "<+11>-11" },