[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:
1 parent
3ceb19f7be
commit
dbba1bdaf7
2 files changed
+4
-1
No files matched your search
@@ -359,6 +359,9 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE;
|
|||||||
#ifndef will_Retain
|
#ifndef will_Retain
|
||||||
# define will_Retain true
|
# define will_Retain true
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef sensor_Retain
|
||||||
|
# define sensor_Retain false
|
||||||
|
#endif
|
||||||
#ifndef will_Message
|
#ifndef will_Message
|
||||||
# define will_Message "offline"
|
# define will_Message "offline"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -462,7 +462,7 @@ void pub_custom_topic(const char* topic, JsonObject& data, boolean retain) {
|
|||||||
* @param payload the payload
|
* @param payload the payload
|
||||||
*/
|
*/
|
||||||
void pubMQTT(const char* topic, const char* 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