diff --git a/ConfigSettings.h b/ConfigSettings.h index 5dd839b..37da1ca 100644 --- a/ConfigSettings.h +++ b/ConfigSettings.h @@ -3,7 +3,7 @@ #ifndef configsettings_h #define configsettings_h -#define FW_VERSION "v1.5.2beta" +#define FW_VERSION "v1.5.2" enum DeviceStatus { DS_OK = 0, DS_ERROR = 1, diff --git a/MQTT.cpp b/MQTT.cpp index 0dc5b3b..be2ca4c 100644 --- a/MQTT.cpp +++ b/MQTT.cpp @@ -100,6 +100,7 @@ bool MQTTClass::connect() { return true; } if(settings.MQTT.enabled) { + if(this->lastConnect + 10000 > millis()) return false; uint64_t mac = ESP.getEfuseMac(); snprintf(this->clientId, sizeof(this->clientId), "client-%08lx%08lx", (uint32_t)((mac >> 32) & 0xFFFFFFFF), (uint32_t)(mac & 0xFFFFFFFF)); if(strlen(settings.MQTT.protocol) > 0 && strlen(settings.MQTT.hostname) > 0) { @@ -112,11 +113,14 @@ bool MQTTClass::connect() { this->subscribe("shades/+/direction/set"); this->subscribe("shades/+/mypos/set"); mqttClient.setCallback(MQTTClass::receive); + this->lastConnect = millis(); return true; } else { - Serial.print("MQTT Connection failed for "); + Serial.print("MQTT Connection failed for: "); Serial.println(mqttClient.state()); + this->lastConnect = millis(); + return false; } } else diff --git a/MQTT.h b/MQTT.h index 7ab97d5..cf7ea31 100644 --- a/MQTT.h +++ b/MQTT.h @@ -5,6 +5,7 @@ #include class MQTTClass { public: + uint64_t lastConnect = 0; char clientId[32] = {'\0'}; bool begin(); bool loop(); diff --git a/SomfyController.ino.esp32.bin b/SomfyController.ino.esp32.bin index 85544ac..061f7ab 100644 Binary files a/SomfyController.ino.esp32.bin and b/SomfyController.ino.esp32.bin differ diff --git a/data/index.html b/data/index.html index eeac99c..3a5a98c 100644 --- a/data/index.html +++ b/data/index.html @@ -3,10 +3,10 @@ - - + + - +
diff --git a/data/index.js b/data/index.js index 1e3af55..78de6e1 100644 --- a/data/index.js +++ b/data/index.js @@ -378,7 +378,7 @@ async function reopenSocket() { await initSockets(); } class General { - appVersion = 'v1.5.2beta'; + appVersion = 'v1.5.2'; reloadApp = false; async init() { this.setAppVersion();