Skip to content

Commit

Permalink
Fix issue #192. Movement continues to my position when finished.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrouse committed Nov 15, 2023
1 parent 42a4dcb commit d97f150
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ConfigSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef configsettings_h
#define configsettings_h

#define FW_VERSION "v2.2.1"
#define FW_VERSION "v2.2.2b"
enum DeviceStatus {
DS_OK = 0,
DS_ERROR = 1,
Expand Down
10 changes: 5 additions & 5 deletions Somfy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ void SomfyShade::checkMovement() {
bool tilt_first = this->tiltType == tilt_types::integrated && ((this->direction == -1 && this->currentTiltPos != 0.0f) || (this->direction == 1 && this->currentTiltPos != 100.0f));

this->p_tiltDirection(this->currentTiltPos == this->tiltTarget ? 0 : this->currentTiltPos > this->tiltTarget ? -1 : 1);
if(tilt_first) { this->p_tiltDirection(this->direction); }
if(tilt_first) this->p_tiltDirection(this->direction);
else if(this->direction != 0) this->p_tiltDirection(0);
uint8_t currPos = floor(this->currentPos);
uint8_t currTiltPos = floor(this->currentTiltPos);
Expand Down Expand Up @@ -1128,11 +1128,11 @@ void SomfyShade::checkMovement() {
if(this->settingTiltPos) {
if(this->tiltType == tilt_types::integrated) {
// If this is an integrated tilt mechanism the we will simply let it finish. If it is not then we will stop it.
if(this->tiltTarget != 100.0 || this->currentPos != 100.0) SomfyRemote::sendCommand(somfy_commands::My, this->repeats);
if(this->tiltTarget != 100.0f || this->currentTiltPos != 100.0f) SomfyRemote::sendCommand(somfy_commands::My, this->repeats);
}
else {
// This is a tilt motor so let it complete if it is going to 0.
if(this->tiltTarget != 100.0) SomfyRemote::sendCommand(somfy_commands::My, this->repeats);
// This is a tilt motor so let it complete if it is going to 100.
if(this->tiltTarget != 100.0f) SomfyRemote::sendCommand(somfy_commands::My, this->repeats);
}
}
this->p_tiltDirection(0);
Expand Down Expand Up @@ -1177,7 +1177,7 @@ void SomfyShade::checkMovement() {
if(this->settingTiltPos) {
if(this->tiltType == tilt_types::integrated) {
// If this is an integrated tilt mechanism the we will simply let it finish. If it is not then we will stop it.
if(this->tiltTarget != 0.0 || this->currentPos != 0.0) SomfyRemote::sendCommand(somfy_commands::My, this->repeats);
if(this->tiltTarget != 0.0 || this->currentTiltPos != 0.0) SomfyRemote::sendCommand(somfy_commands::My, this->repeats);
}
else {
// This is a tilt motor so let it complete if it is going to 0.
Expand Down
Binary file modified SomfyController.ino.esp32.bin
Binary file not shown.
Binary file modified SomfyController.littlefs.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion data/appversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
2.2.2
8 changes: 4 additions & 4 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="main.css?v=2.2.1" type="text/css" />
<link rel="stylesheet" href="widgets.css?v=2.2.1" type="text/css" />
<link rel="stylesheet" href="icons.css?v=2.2.1" type="text/css" />
<link rel="stylesheet" href="main.css?v=2.2.2b" type="text/css" />
<link rel="stylesheet" href="widgets.css?v=2.2.2b" type="text/css" />
<link rel="stylesheet" href="icons.css?v=2.2.2b" type="text/css" />
<link rel="icon" type="image/png" href="favicon.png" />
<script type="text/javascript" src="index.js?v=2.2.1"></script>
<script type="text/javascript" src="index.js?v=2.2.2b"></script>
</head>
<body>
<div id="divContainer" class="container main" data-auth="false">
Expand Down
2 changes: 1 addition & 1 deletion data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ var security = new Security();

class General {
initialized = false;
appVersion = 'v2.2.1';
appVersion = 'v2.2.2b';
reloadApp = false;
init() {
if (this.initialized) return;
Expand Down

0 comments on commit d97f150

Please sign in to comment.