Skip to content

Commit

Permalink
fix connectionState
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Jul 5, 2024
1 parent 0d35bad commit 29b3817
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ void WifiComponent::connect()
#ifdef ESP32
#endif

setState(Connecting);

#ifdef USE_ETHERNET
if (mode == MODE_ETH || mode == MODE_ETH_STA)
{
Expand All @@ -158,8 +160,6 @@ void WifiComponent::connect()
WiFi.setTxPower(WIFI_POWER_19dBm);
WiFi.begin(ssid.c_str(), pass.c_str());
}

setState(Connecting);
}

void WifiComponent::disable()
Expand All @@ -182,7 +182,6 @@ void WifiComponent::WiFiEvent(WiFiEvent_t event)

case ARDUINO_EVENT_ETH_START:
ETH.setHostname(DeviceID.c_str());
setState(Connecting);
break;

case ARDUINO_EVENT_ETH_CONNECTED:
Expand Down

0 comments on commit 29b3817

Please sign in to comment.