mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 02:52:11 +01:00
Added hostname setting to the event model #172
This commit is contained in:
parent
b64afd6796
commit
b91c54d377
2 changed files with 4 additions and 1 deletions
|
|
@ -280,7 +280,7 @@ bool Network::connectWiFi() {
|
|||
this->connectStart = millis();
|
||||
WiFi.setSleep(false);
|
||||
WiFi.mode(WIFI_MODE_NULL);
|
||||
|
||||
WiFi.onEvent(this->networkEvent);
|
||||
|
||||
if(!settings.IP.dhcp) {
|
||||
if(!WiFi.config(settings.IP.ip, settings.IP.gateway, settings.IP.subnet, settings.IP.dns1, settings.IP.dns2))
|
||||
|
|
@ -498,6 +498,9 @@ void Network::networkEvent(WiFiEvent_t event) {
|
|||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_START:
|
||||
Serial.println("WiFi STA Started");
|
||||
if(settings.hostname[0] != '\0') WiFi.setHostname(settings.hostname);
|
||||
Serial.print("Set hostname event to:");
|
||||
Serial.println(WiFi.getHostname());
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_CONNECTED:
|
||||
break;
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue