diff --git a/ConfigSettings.h b/ConfigSettings.h
index 83253ba..e88458b 100644
--- a/ConfigSettings.h
+++ b/ConfigSettings.h
@@ -3,7 +3,7 @@
#ifndef configsettings_h
#define configsettings_h
-#define FW_VERSION "v2.0.1"
+#define FW_VERSION "v2.0.2"
enum DeviceStatus {
DS_OK = 0,
DS_ERROR = 1,
diff --git a/SomfyController.ino.esp32.bin b/SomfyController.ino.esp32.bin
index 2f694c5..b05f55f 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 5880f22..da4bc31 100644
Binary files a/SomfyController.littlefs.bin and b/SomfyController.littlefs.bin differ
diff --git a/Web.cpp b/Web.cpp
index 9b1be3d..2e2f28e 100644
--- a/Web.cpp
+++ b/Web.cpp
@@ -393,7 +393,7 @@ void Web::begin() {
uint8_t repeat = 1;
somfy_commands command = somfy_commands::My;
if (method == HTTP_GET || method == HTTP_PUT || method == HTTP_POST) {
- if (apiServer.hasArg("shadeId")) {
+ if (apiServer.hasArg("groupId")) {
groupId = atoi(apiServer.arg("groupId").c_str());
if (apiServer.hasArg("command")) command = translateSomfyCommand(apiServer.arg("command"));
if(apiServer.hasArg("repeat")) repeat = atoi(apiServer.arg("repeat").c_str());
@@ -1139,7 +1139,7 @@ void Web::begin() {
somfy_commands command = somfy_commands::My;
if (method == HTTP_GET || method == HTTP_PUT || method == HTTP_POST) {
if (server.hasArg("groupId")) {
- groupId = atoi(server.arg("shadeId").c_str());
+ groupId = atoi(server.arg("groupId").c_str());
if (server.hasArg("command")) command = translateSomfyCommand(server.arg("command"));
if(server.hasArg("repeat")) repeat = atoi(server.arg("repeat").c_str());
}
diff --git a/data/appversion b/data/appversion
index 359a5b9..f93ea0c 100644
--- a/data/appversion
+++ b/data/appversion
@@ -1 +1 @@
-2.0.0
\ No newline at end of file
+2.0.2
\ No newline at end of file
diff --git a/data/index.html b/data/index.html
index 697451d..4765938 100644
--- a/data/index.html
+++ b/data/index.html
@@ -3,11 +3,11 @@
-
-
-
+
+
+
-
+
diff --git a/data/index.js b/data/index.js
index b1ad926..167328f 100644
--- a/data/index.js
+++ b/data/index.js
@@ -13,9 +13,9 @@ Date.prototype.toJSON = function () {
return `${this.getFullYear()}-${(this.getMonth() + 1).fmt('00')}-${this.getDate().fmt('00')}T${this.getHours().fmt('00')}:${this.getMinutes().fmt('00')}:${this.getSeconds().fmt('00')}.${this.getMilliseconds().fmt('000')}${sign}${tzHrs}${tzMin}`;
};
Date.prototype.fmt = function (fmtMask, emptyMask) {
- if (fmtMask.match(/[hHmt]/g) !== null) { if (this.isDateTimeEmpty()) return typeof (emptyMask) !== 'undefined' ? emptyMask : ''; }
- if (fmtMask.match(/[Mdy]/g) !== null) { if (this.isDateEmpty()) return typeof (emptyMask) !== 'undefined' ? emptyMask : ''; }
- let formatted = (typeof (fmtMask) !== 'undefined' && fmtMask !== null) ? fmtMask : 'MM-dd-yyyy HH:mm:ss';
+ if (fmtMask.match(/[hHmt]/g) !== null) { if (this.isDateTimeEmpty()) return typeof emptyMask !== 'undefined' ? emptyMask : ''; }
+ if (fmtMask.match(/[Mdy]/g) !== null) { if (this.isDateEmpty()) return typeof emptyMask !== 'undefined' ? emptyMask : ''; }
+ let formatted = typeof fmtMask !== 'undefined' && fmtMask !== null ? fmtMask : 'MM-dd-yyyy HH:mm:ss';
let letters = 'dMyHhmst'.split('');
let temp = [];
let count = 0;
@@ -36,14 +36,14 @@ Date.prototype.fmt = function (fmtMask, emptyMask) {
yyyy: year,
H: this.getHours().toString(),
HH: this.getHours().toString().padStart(2, '00'),
- h: this.getHours() === 0 ? '12' : (this.getHours() > 12) ? Math.abs(this.getHours() - 12).toString() : this.getHours().toString(),
- hh: this.getHours() === 0 ? '12' : (this.getHours() > 12) ? Math.abs(this.getHours() - 12).toString().padStart(2, '00') : this.getHours().toString().padStart(2, '00'),
+ h: this.getHours() === 0 ? '12' : this.getHours() > 12 ? Math.abs(this.getHours() - 12).toString() : this.getHours().toString(),
+ hh: this.getHours() === 0 ? '12' : this.getHours() > 12 ? Math.abs(this.getHours() - 12).toString().padStart(2, '00') : this.getHours().toString().padStart(2, '00'),
m: this.getMinutes().toString(),
mm: this.getMinutes().toString().padStart(2, '00'),
s: this.getSeconds().toString(),
ss: this.getSeconds().toString().padStart(2, '00'),
- t: (this.getHours() < 12 || this.getHours() === 24) ? 'a' : 'p',
- tt: (this.getHours() < 12 || this.getHours() === 24) ? 'am' : 'pm'
+ t: this.getHours() < 12 || this.getHours() === 24 ? 'a' : 'p',
+ tt: this.getHours() < 12 || this.getHours() === 24 ? 'am' : 'pm'
};
for (let i = 0; i < letters.length; i++) {
regexA = new RegExp('(' + letters[i] + '+)');
@@ -152,10 +152,10 @@ Number.prototype.fmt = function (format, empty) {
var baseUrl = window.location.protocol === 'file:' ? 'http://ESPSomfyRTS' : '';
//var baseUrl = '';
function makeBool(val) {
- if (typeof (val) === 'boolean') return val;
- if (typeof (val) === 'undefined') return false;
- if (typeof (val) === 'number') return val >= 1;
- if (typeof (val) === 'string') {
+ if (typeof val === 'boolean') return val;
+ if (typeof val === 'undefined') return false;
+ if (typeof val === 'number') return val >= 1;
+ if (typeof val === 'string') {
if (val === '') return false;
switch (val.toLowerCase().trim()) {
case 'on':
@@ -735,7 +735,7 @@ class UIBinder {
if (typeof val.getMonth === 'function') return val.getTime();
var tval = val.replace(/[^0-9\.\-]+/g, '');
return tval.indexOf('.') !== -1 ? parseFloat(tval) : parseInt(tval, 10);
- };
+ }
_bindValue(obj, el, val, arrayRef) {
var binding = el.getAttribute('data-bind');
var dataType = el.getAttribute('data-datatype');
@@ -746,7 +746,7 @@ class UIBinder {
for (var i = 0; i < arr.length - 1; i++) {
let s = arr[i];
if (typeof s === 'undefined' || s.length === 0) continue;
- sRef += ('.' + s);
+ sRef += '.' + s;
var ndx = s.lastIndexOf('[');
if (ndx !== -1) {
var v = s.substring(0, ndx);
@@ -1038,7 +1038,7 @@ class UIBinder {
}
}
}
- isConfigOpen() { return (window.getComputedStyle(document.getElementById('divConfigPnl')).display !== 'none'); }
+ isConfigOpen() { return window.getComputedStyle(document.getElementById('divConfigPnl')).display !== 'none'; }
setConfigPanel() {
if (this.isConfigOpen()) return;
let divCfg = document.getElementById('divConfigPnl');
@@ -1186,7 +1186,7 @@ var security = new Security();
class General {
initialized = false;
- appVersion = 'v2.0.1';
+ appVersion = 'v2.0.2';
reloadApp = false;
init() {
if (this.initialized) return;
@@ -1468,7 +1468,7 @@ class General {
ui.errorMessage('Invalid Pin').querySelector('.sub-message').innerHTML = 'Pins must be exactly 4 alpha-numeric values in length. Please enter a complete pin.';
return;
}
- confirm = '
Please keep your PIN safe and above all remember it. The only way to recover a lost PIN is to completely reload the onboarding firmware which will wipe out your configuration.
Have you stored your PIN in a safe place?
'
+ confirm = '
Please keep your PIN safe and above all remember it. The only way to recover a lost PIN is to completely reload the onboarding firmware which will wipe out your configuration.
Have you stored your PIN in a safe place?
';
}
else if (security.type === 2) { // Password
if (sec.username.length === 0) {
@@ -1497,7 +1497,7 @@ class General {
ui.errorMessage('Passwords do not Match').querySelector('.sub-message').innerHTML = 'Please re-enter the password exactly as you typed it in the Re-enter Password field.';
return;
}
- confirm = '
Please keep your password safe and above all remember it. The only way to recover a password is to completely reload the onboarding firmware which will wipe out your configuration.
Have you stored your username and password in a safe place?
'
+ confirm = '
Please keep your password safe and above all remember it. The only way to recover a password is to completely reload the onboarding firmware which will wipe out your configuration.
Have you stored your username and password in a safe place?
';
}
let prompt = ui.promptMessage('Confirm Security', () => {
putJSONSync('/saveSecurity', sec, (err, objApiKey) => {
@@ -1745,10 +1745,10 @@ class Wifi {
html += `