Meowbit has a built-in light intensity sensor, allowing it to detect environment brightness.
MakeCode Arcade Coding Tutorial
Load Controller Extension
Blocks for Controller Extension
Detecting Light Intensity
The light intensity has a range from 0 to 255.
Kittenblock Coding Tutorial
Blocks for onboard sensors
Detecting Light Intensity