Basil has been a folk remedy for keeping flies away for a very long time. While it has never been officially studied, mountains of anecdotal evidence suggest that it works wonders.
If you have any other potted plants in the house (or even outside!), you might want to try crushing up some dried basil leaves and nixing it in with the dirt. It won’t negatively impact the plants, and will further deter flies from buzzing around.