Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

How to Add new Commands and Actions #64

@Adsouza98

Description

@Adsouza98

Hey, I was wondering where the getCommands function and Action function are suppose to be declared.

Are they suppose to be declared inside the MMM-Assistant module for the config.js or in a separate file?

Also I was hoping someone can show me a simple example of how to create the function call to another module. (Example: change the text of hello world).

Just installed Magic Mirror last week and this is my first Github question, so sorry if formatting is horrendous.

{
	module: "helloworld",
	position: "bottom_bar",
	config: {
            text: "Hello world!"
	}
},
{
        module: 'MMM-Assistant',
        position: 'bottom_left',
	config: {			
	    TestFunc: function() {
                //Change Text of Hello World!
            },
	    getCommands: function(commander) {
  	        commander.add({
    		     command: 'Test',
    		     callback: 'TestFunc'
  	        })
	    },
            //Rest of standard MMM-Assistant config
         }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions