Module determining if device is sleeping