mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-02-17 12:12:11 +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
4
MQTT.cpp
4
MQTT.cpp
|
|
@ -5,6 +5,7 @@
|
|||
#include "ConfigSettings.h"
|
||||
#include "Somfy.h"
|
||||
#include "Network.h"
|
||||
#include "Utils.h"
|
||||
|
||||
WiFiClient tcpClient;
|
||||
PubSubClient mqttClient(tcpClient);
|
||||
|
|
@ -15,6 +16,7 @@ static char g_content[MQTT_MAX_RESPONSE];
|
|||
extern ConfigSettings settings;
|
||||
extern SomfyShadeController somfy;
|
||||
extern Network net;
|
||||
extern rebootDelay_t rebootDelay;
|
||||
|
||||
|
||||
bool MQTTClass::begin() {
|
||||
|
|
@ -32,7 +34,7 @@ void MQTTClass::reset() {
|
|||
this->connect();
|
||||
}
|
||||
bool MQTTClass::loop() {
|
||||
if(settings.MQTT.enabled && !this->suspended && !mqttClient.connected())
|
||||
if(settings.MQTT.enabled && !rebootDelay.reboot && !this->suspended && !mqttClient.connected())
|
||||
this->connect();
|
||||
if(settings.MQTT.enabled) mqttClient.loop();
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue