 	if (led_mode == LED_ACTIVITY) {
 		is_on = millis() - last_activity < 500;
 	} else if (led_mode == LED_CONNECTION) {
-		is_on = WiFi.status() == WL_CONNECTED;
+		is_on = is_connected();
 	} else if (led_mode == LED_OFF) {
 		is_on = false;
 	} else if (led_mode == LED_ON) {

	// The chip remembers its last ssid and password, so generally just running the server will make it reachable,
	// even without reconfiguring.
	server.begin();
}

void handle_request() {

		} else if (command == COMMAND_CONNECT) {
			connect();
		} else if (command == COMMAND_IS_CONNECTED) {
			send_data(COMMAND_IS_CONNECTED, String(is_connected()));
		} else if (command == COMMAND_DISCONNECT) {
			disconnect();
		} else if (command == COMMAND_GET_IP) {
