mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-02 19:58:44 +05:00
fix: set mqtt prefix before connection
This commit is contained in:
1 parent
2561e92ab9
commit
335429a52e
1 file changed
+2
@@ -167,6 +167,8 @@ protected:
|
||||
} else if (!this->connected && millis() - this->lastReconnectTime >= MQTT_RECONNECT_INTERVAL) {
|
||||
Log.sinfoln(FPSTR(L_MQTT), F("Connecting to %s:%u..."), settings.mqtt.server, settings.mqtt.port);
|
||||
|
||||
this->haHelper->setDevicePrefix(settings.mqtt.prefix);
|
||||
this->client->stop();
|
||||
this->client->setId(networkSettings.hostname);
|
||||
this->client->setUsernamePassword(settings.mqtt.user, settings.mqtt.password);
|
||||
this->client->connect(settings.mqtt.server, settings.mqtt.port);
|
||||
|
||||
Reference in new issue
Block a user