diff --git a/code/espurna/mqtt.ino b/code/espurna/mqtt.ino index d5777e0b..d2e149a7 100644 --- a/code/espurna/mqtt.ino +++ b/code/espurna/mqtt.ino @@ -184,7 +184,7 @@ bool _mqttConnectSyncClient(bool secure = false) { #if MQTT_LIBRARY == MQTT_LIBRARY_ARDUINOMQTT _mqtt.begin(_mqtt_server.c_str(), _mqtt_port, _mqttGetClient(secure)); - _mqtt.setWill(_mqtt_will.c_str(), _mqtt_payload_offline.c_str(), _mqtt_qos, _mqtt_retain); + _mqtt.setWill(_mqtt_will.c_str(), _mqtt_payload_offline.c_str(), _mqtt_retain, _mqtt_qos); result = _mqtt.connect(_mqtt_clientid.c_str(), _mqtt_user.c_str(), _mqtt_pass.c_str()); #elif MQTT_LIBRARY == MQTT_LIBRARY_PUBSUBCLIENT _mqtt.setClient(_mqttGetClient(secure));