mirror of https://github.com/arendst/Tasmota.git
Merge pull request #16612 from ortegafernando/development
Setoption147 (MQTT) Disable publish SSerialReceived MQTT messages. If disabled, you must use event trigger rules instead.
This commit is contained in:
commit
0d124ee1cc
|
@ -283,6 +283,9 @@ String EthernetMacAddress(void);
|
||||||
#ifndef MQTT_CLEAN_SESSION
|
#ifndef MQTT_CLEAN_SESSION
|
||||||
#define MQTT_CLEAN_SESSION 1 // 0 = No clean session, 1 = Clean session (default)
|
#define MQTT_CLEAN_SESSION 1 // 0 = No clean session, 1 = Clean session (default)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef MQTT_DISABLE_SSERIALRECEIVED
|
||||||
|
#define MQTT_DISABLE_SSERIALRECEIVED 0 // 1 = Disable sserialreceived mqtt messages, 0 = Enable sserialreceived mqtt messages (default)
|
||||||
|
#endif
|
||||||
#ifndef MQTT_LWT_OFFLINE
|
#ifndef MQTT_LWT_OFFLINE
|
||||||
#define MQTT_LWT_OFFLINE "Offline" // MQTT LWT offline topic message
|
#define MQTT_LWT_OFFLINE "Offline" // MQTT LWT offline topic message
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -180,7 +180,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
|
||||||
uint32_t data; // Allow bit manipulation using SetOption
|
uint32_t data; // Allow bit manipulation using SetOption
|
||||||
struct { // SetOption146 .. SetOption177
|
struct { // SetOption146 .. SetOption177
|
||||||
uint32_t use_esp32_temperature : 1; // bit 0 (v12.1.1.1) - SetOption146 - (ESP32) Show ESP32 internal temperature sensor
|
uint32_t use_esp32_temperature : 1; // bit 0 (v12.1.1.1) - SetOption146 - (ESP32) Show ESP32 internal temperature sensor
|
||||||
uint32_t spare01 : 1; // bit 1
|
uint32_t mqtt_disable_sserialrec : 1; // bit 1 (v12.1.1.2) - SetOption147 - (MQTT) Disable publish SSerialReceived MQTT messages, you must use event trigger rules instead.
|
||||||
uint32_t spare02 : 1; // bit 2
|
uint32_t spare02 : 1; // bit 2
|
||||||
uint32_t spare03 : 1; // bit 3
|
uint32_t spare03 : 1; // bit 3
|
||||||
uint32_t spare04 : 1; // bit 4
|
uint32_t spare04 : 1; // bit 4
|
||||||
|
|
|
@ -428,6 +428,7 @@
|
||||||
|
|
||||||
#define MQTT_TELE_RETAIN 0 // Tele messages may send retain flag (0 = off, 1 = on)
|
#define MQTT_TELE_RETAIN 0 // Tele messages may send retain flag (0 = off, 1 = on)
|
||||||
#define MQTT_CLEAN_SESSION 1 // Mqtt clean session connection (0 = No clean session, 1 = Clean session (default))
|
#define MQTT_CLEAN_SESSION 1 // Mqtt clean session connection (0 = No clean session, 1 = Clean session (default))
|
||||||
|
#define MQTT_DISABLE_SSERIALRECEIVED 0 // 1 = Disable sserialreceived mqtt messages, 0 = Enable sserialreceived mqtt messages (default)
|
||||||
|
|
||||||
// -- MQTT - Domoticz -----------------------------
|
// -- MQTT - Domoticz -----------------------------
|
||||||
#define USE_DOMOTICZ // Enable Domoticz (+6k code, +0.3k mem)
|
#define USE_DOMOTICZ // Enable Domoticz (+6k code, +0.3k mem)
|
||||||
|
|
|
@ -838,6 +838,7 @@ void SettingsDefaultSet2(void) {
|
||||||
SOBitfield3 flag3 = { 0 };
|
SOBitfield3 flag3 = { 0 };
|
||||||
SOBitfield4 flag4 = { 0 };
|
SOBitfield4 flag4 = { 0 };
|
||||||
SOBitfield5 flag5 = { 0 };
|
SOBitfield5 flag5 = { 0 };
|
||||||
|
SOBitfield6 flag6 = { 0 };
|
||||||
SysMBitfield1 flag2 = { 0 };
|
SysMBitfield1 flag2 = { 0 };
|
||||||
SysMBitfield2 mbflag2 = { 0 };
|
SysMBitfield2 mbflag2 = { 0 };
|
||||||
|
|
||||||
|
@ -992,6 +993,7 @@ void SettingsDefaultSet2(void) {
|
||||||
flag5.mqtt_status_retain |= MQTT_STATUS_RETAIN;
|
flag5.mqtt_status_retain |= MQTT_STATUS_RETAIN;
|
||||||
flag5.mqtt_switches |= MQTT_SWITCHES;
|
flag5.mqtt_switches |= MQTT_SWITCHES;
|
||||||
flag5.mqtt_persistent |= ~MQTT_CLEAN_SESSION;
|
flag5.mqtt_persistent |= ~MQTT_CLEAN_SESSION;
|
||||||
|
flag6.mqtt_disable_sserialrec |= MQTT_DISABLE_SSERIALRECEIVED;
|
||||||
// flag.mqtt_serial |= 0;
|
// flag.mqtt_serial |= 0;
|
||||||
flag.device_index_enable |= MQTT_POWER_FORMAT;
|
flag.device_index_enable |= MQTT_POWER_FORMAT;
|
||||||
flag3.time_append_timezone |= MQTT_APPEND_TIMEZONE;
|
flag3.time_append_timezone |= MQTT_APPEND_TIMEZONE;
|
||||||
|
@ -1254,6 +1256,7 @@ void SettingsDefaultSet2(void) {
|
||||||
Settings->flag3 = flag3;
|
Settings->flag3 = flag3;
|
||||||
Settings->flag4 = flag4;
|
Settings->flag4 = flag4;
|
||||||
Settings->flag5 = flag5;
|
Settings->flag5 = flag5;
|
||||||
|
Settings->flag6 = flag6;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDefaultSet3(void) {
|
void SettingsDefaultSet3(void) {
|
||||||
|
|
|
@ -167,7 +167,11 @@ void SerialBridgeInput(void) {
|
||||||
}
|
}
|
||||||
ResponseJsonEnd();
|
ResponseJsonEnd();
|
||||||
|
|
||||||
MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_SSERIALRECEIVED));
|
if (Settings->flag6.mqtt_disable_sserialrec ) { // SetOption147 If it is activated, Tasmota will not publish SSerialReceived MQTT messages, but it will proccess event trigger rules
|
||||||
|
XdrvRulesProcess(0);
|
||||||
|
} else {
|
||||||
|
MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_SSERIALRECEIVED));
|
||||||
|
}
|
||||||
serial_bridge_in_byte_counter = 0;
|
serial_bridge_in_byte_counter = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue