mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-15 11:52:12 +01:00
Do not reload MQTT if the device is rebooting
This commit is contained in:
parent
2b30646114
commit
2bb23e6d3e
4 changed files with 4 additions and 2 deletions
|
|
@ -231,7 +231,7 @@ bool GitRepo::toJSON(JsonObject &obj) {
|
||||||
|
|
||||||
void GitUpdater::loop() {
|
void GitUpdater::loop() {
|
||||||
if(this->status == GIT_STATUS_READY) {
|
if(this->status == GIT_STATUS_READY) {
|
||||||
if(this->lastCheck + 14400000 < millis()) { // 4 hours
|
if(this->lastCheck + 14400000 < millis() && !rebootDelay.reboot) { // 4 hours
|
||||||
this->checkForUpdate();
|
this->checkForUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
MQTT.cpp
4
MQTT.cpp
|
|
@ -5,6 +5,7 @@
|
||||||
#include "ConfigSettings.h"
|
#include "ConfigSettings.h"
|
||||||
#include "Somfy.h"
|
#include "Somfy.h"
|
||||||
#include "Network.h"
|
#include "Network.h"
|
||||||
|
#include "Utils.h"
|
||||||
|
|
||||||
WiFiClient tcpClient;
|
WiFiClient tcpClient;
|
||||||
PubSubClient mqttClient(tcpClient);
|
PubSubClient mqttClient(tcpClient);
|
||||||
|
|
@ -15,6 +16,7 @@ static char g_content[MQTT_MAX_RESPONSE];
|
||||||
extern ConfigSettings settings;
|
extern ConfigSettings settings;
|
||||||
extern SomfyShadeController somfy;
|
extern SomfyShadeController somfy;
|
||||||
extern Network net;
|
extern Network net;
|
||||||
|
extern rebootDelay_t rebootDelay;
|
||||||
|
|
||||||
|
|
||||||
bool MQTTClass::begin() {
|
bool MQTTClass::begin() {
|
||||||
|
|
@ -32,7 +34,7 @@ void MQTTClass::reset() {
|
||||||
this->connect();
|
this->connect();
|
||||||
}
|
}
|
||||||
bool MQTTClass::loop() {
|
bool MQTTClass::loop() {
|
||||||
if(settings.MQTT.enabled && !this->suspended && !mqttClient.connected())
|
if(settings.MQTT.enabled && !rebootDelay.reboot && !this->suspended && !mqttClient.connected())
|
||||||
this->connect();
|
this->connect();
|
||||||
if(settings.MQTT.enabled) mqttClient.loop();
|
if(settings.MQTT.enabled) mqttClient.loop();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue