Module for determining if device is sleeping