Skip to content

fix: drop ShellJS in favor of child_process #2

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

Merged
merged 1 commit into from
Sep 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

var NodeHelper = require('node_helper');
var mqtt = require('mqtt');
var shell = require('shelljs');
shell.config.execPath = '/usr/bin/node';
var { exec } = require('child_process');

module.exports = NodeHelper.create({

Expand Down Expand Up @@ -76,12 +75,12 @@ module.exports = NodeHelper.create({

// Turn display (hdmi) on
turnDisplayOn: function() {
shell.exec('vcgencmd display_power 1 >/dev/null 2>&1');
exec('vcgencmd display_power 1 >/dev/null 2>&1');
},

// Turn display (hdmi) off
turnDisplayOff: function() {
shell.exec('vcgencmd display_power 0 >/dev/null 2>&1');
exec('vcgencmd display_power 0 >/dev/null 2>&1');
}

});
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmm-toggle-by-mqtt",
"version": "1.0.0",
"version": "1.0.1",
"description": "Shows/hides MagicMirror modules on mqtt command",
"main": "mmm-toggle-by-mqtt.js",
"scripts": {
Expand All @@ -14,7 +14,6 @@
"author": "Moritz Kraus",
"license": "MIT",
"dependencies": {
"mqtt": "^3.0.0",
"shelljs": "^0.8.3"
"mqtt": "^3.0.0"
}
}