def set_sleep(minutes):
 value = _validate_sleep(minutes)
 cmd = 'systemsetup -setsleep {0}'.format(value)
 salt.utils.mac_utils.execute_return_success(cmd)
 state = []
 for check in (get_computer_sleep, get_display_sleep, get_harddisk_sleep):
  state.append(salt.utils.mac_utils.confirm_updated(value, check))
 return all(state)

def set_sleep ( minutes ) : value = _validate_sleep ( minutes ) cmd = 'systemsetup -setsleep {0}' . format ( value ) salt . utils . mac_utils . execute_return_success ( cmd ) state = [ ] for check in ( get_computer_sleep , get_display_sleep , get_harddisk_sleep ) : state . append ( salt . utils . mac_utils . confirm_updated ( value , check ) ) return all ( state )
sets the amount of idle time until the machine sleeps .