Update esp8266-nanoleaf-webserver.ino

hostname configuration is now set before wifi starts
This commit is contained in:
Lorenz Nimmervoll 2019-09-01 14:23:06 +02:00 committed by GitHub
parent 8b81985b49
commit 9b0d2ac4e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -316,8 +316,8 @@ void setup() {
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
Serial.printf("Connecting to %s\n", ssid); Serial.printf("Connecting to %s\n", ssid);
if (String(WiFi.SSID()) != String(ssid)) { if (String(WiFi.SSID()) != String(ssid)) {
WiFi.begin(ssid, password);
WiFi.hostname("Nanoleaf"); WiFi.hostname("Nanoleaf");
WiFi.begin(ssid, password);
} }
} }