Sorry for the late reply and possibly information that may be said already.
This is my take on fungas gnats.
First ask yourself, are you growing in a medium that contains organic material? Are you using hydro or soilless mediums?
If your soilless, hydro or any form of growing that is not using major organic/carbon materials. Fungas gnats (bare with me) are your fault. Think about what you are doing and if the medium is getting a proper dry period, if your plants are far from wilting or showing drought stress when your water timers go on, than you need to change watering times or adjust your watering to give them a dry period.
Good news is, when using non organic or soilless methods, your not worried about soil life or beneficial life really existing, your plants feed on nutrients directly. An easy solution to get rid of the gnats in under a week is using BT in your water, this is also marketed as catipillar killer. This will kill the larvae and get rid of the gnats in 7 days.
Organic growing, you don't want to use BT as the soil life will be damaged. Use beneficial insects and nematodes to combat the gnats while also addressing watering issues.
99% of the time gnats are result of over watering.