mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Increment mqttFailedCount on enabled but NotConnected
This commit is contained in:
parent
076c1f1b4d
commit
517268426d
@ -95,7 +95,11 @@ PubSubClient mqttClient(mqttNetworkClient);
|
||||
int mqttPublish(const char* topic, const char* payload, size_t len, bool retain)
|
||||
{
|
||||
if(!mqttEnabled) return MQTT_ERR_DISABLED;
|
||||
if(!mqttClient.connected()) return MQTT_ERR_NO_CONN;
|
||||
|
||||
if(!mqttClient.connected()) {
|
||||
mqttFailedCount++;
|
||||
return MQTT_ERR_NO_CONN;
|
||||
}
|
||||
|
||||
if(mqttClient.beginPublish(topic, len, retain)) {
|
||||
mqttPublishCount++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user