Added check for last input item in fanController main function

This commit is contained in:
2017-02-23 17:47:42 +01:00
parent 64c55a62a3
commit 682642c19e
3 changed files with 4 additions and 5 deletions

View File

@@ -21,7 +21,6 @@ app.get('/state', function(req, res) {
PythonShell.run('scripts/fanController.py', options, function (err, results) {
if (err) throw err;
if (results[0] == true)
res.send('on')
else
@@ -37,8 +36,8 @@ app.post('/on', function (req, res) {
};
PythonShell.run('scripts/fanController.py', options, function (err, results) {
if (err) throw err;
if (err) throw err;
if (results[0] == true)
res.send('on')
else