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

brain.classify checks global variables for command #121

Closed
danships opened this issue Nov 30, 2016 · 1 comment
Closed

brain.classify checks global variables for command #121

danships opened this issue Nov 30, 2016 · 1 comment

Comments

@danships
Copy link

See https://github.com/GladysProject/Gladys/blob/master/api/core/brain/brain.classify.js#L40

The code should check if there is a module where the command can be redirected to? Not sure if the module name should be the same name as the service, or if a module can define multiple services.

It now searches for global variables which have a command function.

@danships
Copy link
Author

danships commented Nov 30, 2016

A simple fix might be the change the line to:

if (!gladys.modules[service] || typeof gladys.modules[service].command != "function") {

But it might be even nicer if a module can define multiple services. For example a mediaplayer module which supports both audio and video and can receive commands from different services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant