mirror of
https://github.com/1technophile/OpenMQTTGateway.git
synced 2026-03-21 14:37:01 +01:00
[MQTT] Optional message retain flag (#1534)
* Define optional sensor_Retain ...with default : false to preserve current behaviour * Support optional sensor message retaining
This commit is contained in:
@@ -359,6 +359,9 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE;
|
||||
#ifndef will_Retain
|
||||
# define will_Retain true
|
||||
#endif
|
||||
#ifndef sensor_Retain
|
||||
# define sensor_Retain false
|
||||
#endif
|
||||
#ifndef will_Message
|
||||
# define will_Message "offline"
|
||||
#endif
|
||||
|
||||
@@ -462,7 +462,7 @@ void pub_custom_topic(const char* topic, JsonObject& data, boolean retain) {
|
||||
* @param payload the payload
|
||||
*/
|
||||
void pubMQTT(const char* topic, const char* payload) {
|
||||
pubMQTT(topic, payload, false);
|
||||
pubMQTT(topic, payload, sensor_Retain);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user