From 7558afc444efde460fa18803de2598cfb894a2ab Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sat, 3 Jun 2017 18:58:55 +0200 Subject: [PATCH] Changed so that the fanstate is reloaded when application starts --- server.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100755 => 100644 server.js diff --git a/server.js b/server.js old mode 100755 new mode 100644 index 51f3f9d..c406fe6 --- a/server.js +++ b/server.js @@ -66,5 +66,11 @@ var server = app.listen(3000, function () { var host = server.address().address var port = server.address().port - console.log("Example app listening at http://%s:%s", host, port) + console.log("Example app listening at http://%s:%s", host, port); + console.log('Setting fan to previous state'); + var options = { + pythonOptions: ['-u'], + args: 'reload' + }; + PythonShell.run('scripts/fanController.py', options); })