I have a 2018 MacBook Pro with Touch Bar. The said Touch Bar is flickering from time to time (to the point it hurts my eyes) and does not even light up the rest of the time. It looks like the problem is coming from the hardware but after looking thru a lot of documentation and experimenting a lot it looks like when I expose the ambient light sensor to a flashlight the motherboard is sending more power to the Touch Bar's screen and the flickering stops.
Therefore, I am trying to find a way to set the ambient light sensor's value to something that would stop the screen from flickering. I do not know if this is even possible but I do not have the money or the competencies to fix the bad hardware. Sorry for my bad English :)