mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-23 08:37:08 +01:00
Moved {identifier} check to _mqttBackwards
This commit is contained in:
@@ -962,7 +962,7 @@ void migrate() {
|
||||
setSetting("btnRelay", 0, 0);
|
||||
setSetting("relayGPIO", 0, 12);
|
||||
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
|
||||
|
||||
|
||||
#elif defined(PILOTAK_ESP_DIN_V1)
|
||||
|
||||
setSetting("board", 76);
|
||||
@@ -1013,15 +1013,6 @@ void migrate() {
|
||||
|
||||
}
|
||||
|
||||
#if MQTT_SUPPORT
|
||||
// Deprecated MQTT substitution
|
||||
String mqttTopic = getSetting("mqttTopic", MQTT_TOPIC);
|
||||
if (mqttTopic.indexOf("{identifier}") > 0) {
|
||||
mqttTopic.replace("{identifier}", "{hostname}");
|
||||
setSetting("mqttTopic", mqttTopic);
|
||||
}
|
||||
#endif
|
||||
|
||||
saveSettings();
|
||||
|
||||
}
|
||||
|
||||
@@ -249,6 +249,14 @@ void _mqttConfigure() {
|
||||
|
||||
}
|
||||
|
||||
void _mqttBackwards() {
|
||||
String mqttTopic = getSetting("mqttTopic", MQTT_TOPIC);
|
||||
if (mqttTopic.indexOf("{identifier}") > 0) {
|
||||
mqttTopic.replace("{identifier}", "{hostname}");
|
||||
setSetting("mqttTopic", mqttTopic);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long _mqttNextMessageId() {
|
||||
|
||||
static unsigned long id = 0;
|
||||
@@ -740,6 +748,8 @@ void mqttReset() {
|
||||
|
||||
void mqttSetup() {
|
||||
|
||||
_mqttBackwards();
|
||||
|
||||
DEBUG_MSG_P(PSTR("[MQTT] Async %s, SSL %s, Autoconnect %s\n"),
|
||||
MQTT_USE_ASYNC ? "ENABLED" : "DISABLED",
|
||||
ASYNC_TCP_SSL_ENABLED ? "ENABLED" : "DISABLED",
|
||||
|
||||
Reference in New Issue
Block a user