diff --git a/lib/PsychicMqttClient/src/PsychicMqttClient.h b/lib/PsychicMqttClient/src/PsychicMqttClient.h index 80961d22..e7b45b9e 100644 --- a/lib/PsychicMqttClient/src/PsychicMqttClient.h +++ b/lib/PsychicMqttClient/src/PsychicMqttClient.h @@ -224,6 +224,11 @@ public: */ PsychicMqttClient &setWill(const char *topic, uint8_t qos, bool retain, const char *payload = nullptr, int length = 0); + /** + * @brief Clears the last will and testament (disables LWT for the next connect / config apply). + */ + PsychicMqttClient &clearLastWill(); + /** * @brief Sets the MQTT server URI. Supports mqtt://, mqtts:// and ws://, wss:// as * transport protocols. Fully supports SSL/TLS. diff --git a/src/helpers/MQTTMessageBuilder.cpp b/src/helpers/MQTTMessageBuilder.cpp index 4648a70c..b784f595 100644 --- a/src/helpers/MQTTMessageBuilder.cpp +++ b/src/helpers/MQTTMessageBuilder.cpp @@ -118,8 +118,8 @@ int MQTTMessageBuilder::buildPacketMessage( snprintf(rssi_str, sizeof(rssi_str), "%d", rssi); root["timestamp"] = timestamp; - root["origin"] = origin; root["hash"] = hash; + root["origin"] = origin; root["type"] = "PACKET"; root["direction"] = direction; root["time"] = time;