mirror of
https://github.com/wled/WLED.git
synced 2025-07-27 04:36:33 +00:00
Remove anything behind .local and ignore case
This commit is contained in:
parent
24f2306129
commit
07e303bcc1
@ -215,7 +215,9 @@ bool initMqtt()
|
||||
} else {
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
String mqttMDNS = mqttServer;
|
||||
mqttMDNS.replace(F(".local"), ""); // remove .local if present
|
||||
mqttMDNS.toLowerCase(); // make sure we have a lowercase hostname
|
||||
int pos = mqttMDNS.indexOf(F(".local"));
|
||||
if (pos > 0) mqttMDNS.remove(pos); // remove .local domain if present (and anything following it)
|
||||
if (strlen(cmDNS) > 0 && mqttMDNS.length() > 0 && mqttMDNS.indexOf('.') < 0) { // if mDNS is enabled and server does not have domain
|
||||
mqttIP = MDNS.queryHost(mqttMDNS.c_str());
|
||||
if (mqttIP != IPAddress()) // if MDNS resolved the hostname
|
||||
|
Loading…
x
Reference in New Issue
Block a user