Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
startGeth: function(chain, purpose) {
const oThis = this
;
// start geth
logger.info("* Starting " + chain + " chain");
const cmd = oThis._startGethCommand(chain, purpose);
logger.info(cmd);
shellAsyncCmd.run(cmd);
},
setSpeed: function(value) {
console.log("Setting fan rSpeed to %s", value);
CEILING_FAN.rSpeed = value;
if (value > 0 && value < 33) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan1.py');
} else if (value == 0) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan0.py');
} else if (value > 34 && value < 66) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan2.py');
} else if (value > 67 && value < 101) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan3.py');
}
},
identify: function() {
setSpeed: function(value) {
console.log("Setting fan rSpeed to %s", value);
CEILING_FAN.rSpeed = value;
if (value > 0 && value < 33) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan1.py');
} else if (value == 0) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan0.py');
} else if (value > 34 && value < 66) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan2.py');
} else if (value > 67 && value < 101) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan3.py');
}
},
identify: function() {
open: function() {
console.log("Opening the Garage!");
cmd.run('sudo python /home/pi/HAP-NodeJS/python/garage2.py');
},
close: function() {
open: function() {
console.log("Opening the Garage!");
cmd.run('sudo python /home/pi/HAP-NodeJS/python/garage.py');
GARAGE_DOOR.opened = true;
},
close: function() {
var fucknode = function(name) {
if (fs.existsSync('node_modules')) {
cmd.get(
'pwd',
function(err, data, stderr) {
var fuckbreak = data.replace(/\n|\r/g, "");
console.log("🤦 removing node_modules in " + fuckbreak + "\n🤦 and force npm install\n");
}
);
cmd.run('rm -r node_modules');
cmd.run('npm install');
var undefined = '';
return undefined;
} else {
return "\n" + cool() + "\nfucknode isn't able to find your node_modules\n" + cool() + "\n";
}
};
setSpeed: function(value) {
console.log("Setting fan rSpeed to %s", value);
CEILING_FAN.rSpeed = value;
if (value > 0 && value < 33) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan1.py');
} else if (value == 0) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan0.py');
} else if (value > 34 && value < 66) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan2.py');
} else if (value > 67 && value < 101) {
cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan3.py');
}
},
identify: function() {
ncp('./temp-noia-sdk/packages', './', function (error) {
if (error) {
handleError(error);
return;
}
cmd.run('rm -rf ./temp-noia-sdk');
updateConfig(kaizenConfig, 'NOIA');
});
});
stopGeth: function() {
logger.info("* Stopping all running geths");
const cmd = "ps -ef | grep 'openst-setup\\|openst-platform' | grep 'geth ' | grep -v grep | awk '{print $2}' | xargs kill";
shellAsyncCmd.run(cmd);
},
stopExecutable: function() {
logger.info("* Stopping all running executable");
const cmd = "ps -ef | grep 'openst-setup\\|openst-platform' | grep 'executables' | grep -v grep | awk '{print $2}' | xargs kill";
shellAsyncCmd.run(cmd);
},