Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin auto complete system #77

Closed
2 tasks
Tracked by #35
matheuswhite opened this issue Apr 9, 2024 · 3 comments
Closed
2 tasks
Tracked by #35

Plugin auto complete system #77

matheuswhite opened this issue Apr 9, 2024 · 3 comments
Labels
new New feature or request

Comments

@matheuswhite
Copy link
Owner

matheuswhite commented Apr 9, 2024

Dependencies

@matheuswhite matheuswhite converted this from a draft issue Apr 9, 2024
@matheuswhite matheuswhite added the new New feature or request label Apr 9, 2024
@matheuswhite
Copy link
Owner Author

matheuswhite commented Apr 9, 2024

List of commands

The plugin should implement a function help that returns a table with supported commands. The table must obey the following format:

function scope.help()
  return {
    {'connect', scope.arg('dev_name', scope.dyn)},
    {'disconnect'},
    {'write', scope.arg('characteristic', scope.dyn), scope.arg('data', scope.str)}
    {'read', scope.arg('characteristic', scope.dyn)},
    {'track', scope.arg('characteristic', scope.dyn), scope.arg('mode', scope.options('last', 'all'))},
  }
end

Types of arguments

  • scope.str: String type
  • scope.options: Options type. This type has a list of options, resolved in loadtime.
  • scope.dyn -> Dynamic type. This type has a list of options, resolved in runtime. To resolve this argument, the program must call the function scope.resolve(command, argument). This function must return a list of strings.

Resolve the dynamic argument

function scope.resolve(command, argument)
  if argument == 'characteristic' then
    return scope.ble_chars()
  end
end

@matheuswhite
Copy link
Owner Author

Do help for !plugin inside the program

@matheuswhite matheuswhite moved this from 🆕 New to 📋 v0.3.0 in Scope Apr 9, 2024
@matheuswhite
Copy link
Owner Author

It'll be made on #98

@matheuswhite matheuswhite closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2024
@github-project-automation github-project-automation bot moved this from 📋 v0.3.0 to ✅ Done in Scope Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new New feature or request
Projects
Status: ✅ Done
Development

No branches or pull requests

1 participant