Enable automatic brightness
If your computer has an integrated light sensor, it can be used to automatically control screen brightness. This ensures that the screen is always easy to see in different ambient light conditions, and helps to reduce battery consumption.
Open the Activities overview and start typing Power.
Click Power to open the panel.
In the Power Saving section, ensure that the Automatic brightness switch is set to on.
To disable automatic screen brightness, switch it to off.