Skip to content

Commit

Permalink
Fix issues with on-demand pump run command.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankit Rajpoot committed Nov 1, 2018
1 parent 1f60537 commit ec18a7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import db
import json

urls = ('/', 'Index', '/logs/(.*)/(.*)', 'Logs', '/login', 'Login', '/operation/(.*)', 'Operation')
urls = ('/', 'Index', '/logs/(.*)/(.*)', 'Logs', '/login', 'Login', '/operation/(.*)', 'Operations')
html = web.template.render('webtemplates')
logs = web.template.render('cache')

Expand Down Expand Up @@ -64,7 +64,8 @@ def GET(self, operation):
if web.ctx.env.get('HTTP_AUTHORIZATION') is None:
web.seeother('/login')
elif(operation == 'runpump'):
return os.popen("python3 pumpcontroller.py runnow").readline()
os.popen("python3 pumpcontroller.py runnow &")
return "Success"


def startServer():
Expand Down
6 changes: 4 additions & 2 deletions webtemplates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WaterPI - WaterPI loves plants!</title>
<link rel="stylesheet" href="static/styles.css" type="text/css" />

Expand Down Expand Up @@ -80,8 +82,8 @@ <h1>WaterPI - WaterPI loves plants!</h1>
Plants are wonderful: They give us food to eat, air to breathe and don't ask for much in return.
</p>
<p>
Unfortunately, they often get left alone for days at a time when their companion hoomans decide to travel.
They feel alone and hungry when that happens.
Unfortunately, they often get left alone for days at a time when their hoomans decide to travel.
They feel alone and hungry.
</p>
<p>
Thankfully, WaterPI is here, to take care of your plant friends when you're out.
Expand Down

0 comments on commit ec18a7d

Please sign in to comment.