Matching log style
This commit is contained in:
parent
8111fafbad
commit
8936a96af7
17
functions.js
17
functions.js
@ -168,8 +168,7 @@ const functions = {
|
||||
init(gpio) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Boot/About/Info
|
||||
console.log(`
|
||||
== Lennox Winslow PS40
|
||||
console.log(`== Lennox Winslow PS40
|
||||
== Pellet Stove Control Panel
|
||||
== Author: Skylar Grant
|
||||
== Version: v${package.version}
|
||||
@ -187,29 +186,29 @@ const functions = {
|
||||
// Init the Auger pin
|
||||
gpio.setup(augerPin, gpio.DIR_OUT, (err) => {
|
||||
if (err) reject(err);
|
||||
if (process.env.DEBUG == 'true') console.log('Auger pin initialized.');
|
||||
if (process.env.DEBUG == 'true') console.log('== Auger pin initialized.');
|
||||
// Init the igniter pin
|
||||
gpio.setup(igniterPin, gpio.DIR_OUT, (err) => {
|
||||
if (err) reject(err);
|
||||
if (process.env.DEBUG == 'true') console.log('Igniter pin initialized.');
|
||||
if (process.env.DEBUG == 'true') console.log('== Igniter pin initialized.');
|
||||
// Init the blower pin
|
||||
gpio.setup(blowerPin, gpio.DIR_OUT, (err) => {
|
||||
if (err) reject(err);
|
||||
if (process.env.DEBUG == 'true') console.log('Combustion blower pin initialized.');
|
||||
if (process.env.DEBUG == 'true') console.log('== Combustion blower pin initialized.');
|
||||
// Init the Proof of Fire pin
|
||||
gpio.setup(pofPin, gpio.DIR_IN, (err) => {
|
||||
if (err) reject(err);
|
||||
if (process.env.DEBUG == 'true') console.log('Proof of Fire pin initialized.');
|
||||
if (process.env.DEBUG == 'true') console.log('== Proof of Fire pin initialized.');
|
||||
// Init the Temp Sensor pin
|
||||
gpio.setup(tempPin, gpio.DIR_IN, (err) => {
|
||||
if (err) reject(err);
|
||||
if (process.env.DEBUG == 'true') console.log('Temperature pin initialized.');
|
||||
if (process.env.DEBUG == 'true') console.log('== Temperature pin initialized.');
|
||||
// Init the Vacuum Switch pin
|
||||
gpio.setup(vacuumPin, gpio.DIR_IN, (err) => {
|
||||
if (err) reject(err);
|
||||
if (process.env.DEBUG == 'true') console.log('Vacuum Switch pin initialized.');
|
||||
if (process.env.DEBUG == 'true') console.log('== Vacuum Switch pin initialized.');
|
||||
// Resolve the promise now that all pins have been initialized
|
||||
resolve('GPIO Initialized.');
|
||||
resolve('== GPIO Initialized.');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
6
main.js
6
main.js
@ -15,7 +15,7 @@ const dotenv = require('dotenv').config();
|
||||
|
||||
// Setup for use with the Pi's GPIO pins
|
||||
if (process.env.ONPI == 'true') {
|
||||
console.log('Running on a Raspberry Pi.');
|
||||
console.log('== Running on a Raspberry Pi.');
|
||||
const gpio = require('rpi-gpio');
|
||||
fn.init(gpio).then((res, rej) => {
|
||||
if (res != undefined) {
|
||||
@ -26,7 +26,7 @@ if (process.env.ONPI == 'true') {
|
||||
}
|
||||
});
|
||||
} else if (process.env.ONPI == 'false') {
|
||||
console.log('Not running on a Raspberry Pi.');
|
||||
console.log('== Not running on a Raspberry Pi.');
|
||||
const gpio = 'gpio';
|
||||
fn.init(gpio).then((res, rej) => {
|
||||
if (res != undefined) {
|
||||
@ -37,7 +37,7 @@ if (process.env.ONPI == 'true') {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('Problem with ENV file.');
|
||||
console.log('== Problem with ENV file.');
|
||||
}
|
||||
|
||||
// TODO Add logic for other sensors
|
||||
|
Loading…
Reference in New Issue
Block a user