* Fixing issue where wrong sleep state entry was being used. closes #28370,#29397 * Fixing formatting. * Sorting imports to get black checks to pass. * Using lambda for getting latest sleep serie.