Skip to content

Commit 99ef5c9

Browse files
committed
set name and path in module init
1 parent d6f2e71 commit 99ef5c9

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ planned for 2025-04-01
3838
- [core] Fix wrong port in log message when starting server only (#3696)
3939
- [calendar] NewYork event processed on system in Central timezone shows wrong time #3701
4040
- [weather/yr] The Yr weather provider is now able to recover from bad API resposes instead of freezing (#3296)
41+
- [core] Add missing name and path to node_helper init function (#3708)
4142

4243
## [2.30.0] - 2025-01-01
4344

js/app.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ function App () {
210210
Log.error(`Error when loading ${moduleName}:`, e.message);
211211
return;
212212
}
213-
let m = new Module();
213+
let m = new Module(moduleName, path.resolve(moduleFolder));
214214

215215
if (m.requiresVersion) {
216216
Log.log(`Check MagicMirror² version for node helper '${moduleName}' - Minimum version: ${m.requiresVersion} - Current version: ${global.version}`);
@@ -222,8 +222,6 @@ function App () {
222222
}
223223
}
224224

225-
m.setName(moduleName);
226-
m.setPath(path.resolve(moduleFolder));
227225
nodeHelpers.push(m);
228226

229227
m.loaded();

js/node_helper.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ const Log = require("logger");
33
const Class = require("./class");
44

55
const NodeHelper = Class.extend({
6-
init () {
7-
Log.log("Initializing new module helper ...");
6+
init (name, path) {
7+
this.setName(name);
8+
this.setPath(path);
9+
10+
Log.log(`Initializing new module helper: ${this.name}`);
811
},
912

1013
loaded () {

0 commit comments

Comments
 (0)