Treatment of water for swimming pools