mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-03 06:54:16 +01:00
Added {magnitude} placeholder
This commit is contained in:
@@ -215,11 +215,12 @@ void _mqttConfigure() {
|
||||
// Get base topic
|
||||
_mqtt_topic = getSetting("mqttTopic", MQTT_TOPIC);
|
||||
if (_mqtt_topic.endsWith("/")) _mqtt_topic.remove(_mqtt_topic.length()-1);
|
||||
if (_mqtt_topic.indexOf("#") == -1) _mqtt_topic = _mqtt_topic + "/#";
|
||||
|
||||
// Placeholders
|
||||
_mqtt_topic.replace("{identifier}", getSetting("hostname"));
|
||||
_mqtt_topic.replace("{hostname}", getSetting("hostname"));
|
||||
_mqtt_topic.replace("{magnitude}", "#");
|
||||
if (_mqtt_topic.indexOf("#") == -1) _mqtt_topic = _mqtt_topic + "/#";
|
||||
String mac = WiFi.macAddress();
|
||||
mac.replace(":", "");
|
||||
_mqtt_topic.replace("{mac}", mac);
|
||||
|
||||
Reference in New Issue
Block a user