Skip to content

Commit

Permalink
Merge pull request #324 from dandjo/main
Browse files Browse the repository at this point in the history
Add possibility to disable log messages via MQTT
  • Loading branch information
raomin authored Oct 18, 2023
2 parents 07e6b03 + dc62550 commit 8b29fe8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/mqttserial.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ size_t MQTTSerial::write(const uint8_t *buffer, size_t size)
}
M5.Lcd.print((const char*) buffer);
#endif
#ifndef DISABLE_LOG_MESSAGES
if (WiFi.status() == WL_CONNECTED && _client!=nullptr &&_client->connected()){
_client->publish(_topic,buffer,size);
}
Serial.write(buffer,size);
#endif
return size;
}

Expand Down
3 changes: 3 additions & 0 deletions src/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
// #define ONEVAL_ONETOPIC
// #define MQTT_OneTopic "espaltherma/OneATTR/" //Keep the ending "/" !!

//Uncomment to disable common frequent log messages via MQTT to reduce network load
//#define DISABLE_LOG_MESSAGES


//Uncomment *ONE* of the following according to your installation.
//Then, open and edit the selected file in the /include/def/ folder and uncomment each values you are interested in.
Expand Down

0 comments on commit 8b29fe8

Please sign in to comment.