Javascript module not initializing

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
TheJoyOfPainting
Posts: 3
Joined: 04 Oct 2017 10:56

Javascript module not initializing

Post by TheJoyOfPainting » 04 Oct 2017 13:27

Hi guys,

I am trying to create a javascript automation module but I'm are having trouble getting the module initialized.
I can see from the z-way-server.log file that the module is loaded but the init method is not being called.
The index.js and module.json files are very simple.

Heres the index.js file:
function Alumis (id, controller) {
// Call superconstructor first (AutomationModule)
Alumis.super_.call(this, id, controller);
}

inherits(Alumis, BaseModule);

_module = Alumis;

console.log("alumis module loaded");
// ----------------------------------------------------------------------------
// --- Module instance initialized
// ----------------------------------------------------------------------------

Alumis.prototype.init = function (config) {
Alumis.super_.prototype.init.call(this, config);

console.log("alumis module initialized");

};


heres the module.json:

{
"singleton": true,
"dependencies": [],
"category": "scripting",
"author": "Alumis",
"homepage": "www.alumis.no",
"icon": "",
"version": "0.0.1",
"maturity": "stable",
"repository": {},
"defaults": {},
"schema": {},
"options": {}
}

What am i doing wrong here?

User avatar
PoltoS
Posts: 4092
Joined: 26 Jan 2011 19:36

Re: Javascript module not initializing

Post by PoltoS » 05 Oct 2017 09:27

Make sure the folder have the same name as the class

Post Reply