mirror of https://github.com/arendst/Tasmota.git
Avoid logging AWS IoT shadow when no MQTT connection
This commit is contained in:
parent
b486f2b1e1
commit
073f0267f0
|
@ -374,7 +374,7 @@ void MqttPublishPrefixTopic_P(uint32_t prefix, const char* subtopic, bool retain
|
||||||
MqttPublish(stopic, retained);
|
MqttPublish(stopic, retained);
|
||||||
|
|
||||||
#ifdef USE_MQTT_AWS_IOT
|
#ifdef USE_MQTT_AWS_IOT
|
||||||
if ((prefix > 0) && (Settings.flag4.awsiot_shadow)) { // placeholder for SetOptionXX
|
if ((prefix > 0) && (Settings.flag4.awsiot_shadow) && (Mqtt.connected)) { // placeholder for SetOptionXX
|
||||||
// compute the target topic
|
// compute the target topic
|
||||||
char *topic = SettingsText(SET_MQTT_TOPIC);
|
char *topic = SettingsText(SET_MQTT_TOPIC);
|
||||||
char topic2[strlen(topic)+1]; // save buffer onto stack
|
char topic2[strlen(topic)+1]; // save buffer onto stack
|
||||||
|
|
Loading…
Reference in New Issue