basically how pokemon sleep works is that it uses your phone's camera to check for light, and if theres no light it declares the phone is face-down and turns the screen off
it does not take into account that the screen itself is constantly making light