Skip to content

Commit

Permalink
Fix chargecontroller syntax error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankit Rajpoot committed Nov 2, 2018
1 parent 43e086d commit d25c1a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions chargecontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,19 @@ def heartbeat():

heartbeat()

chargeState = False
while True:
# Start charging
chargeRelay.on()
# Stop charging
chargeRelay.off()
entry = { 'timestamp': str(datetime.now().timestamp()),
'event': 'Switch On'}
'event': 'Switch Off'}
db.logChargeRun(entry)

time.sleep(CHARGER_RUNTIME)
time.sleep(CHARGER_OFFTIME)

# Stop charging charging
chargerRelay.off()
# Start charging
chargeRelay.on()
entry = { 'timestamp': str(datetime.now().timestamp()),
'event': 'Switch Off'}
'event': 'Switch On'}
db.logChargeRun(entry)

time.sleep(CHARGER_OFFTIME)
time.sleep(CHARGER_RUNTIME)
2 changes: 1 addition & 1 deletion webtemplates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h3>System Status</h3>

<button onclick="window.open('/operation/runpump')">Run Pump Now</button>
<br />
<button onclick="startFeed()">Start Live Feed</button>
<button onclick="window.open('https://www.youtube.com/watch?v=9xeAiB_-MD0&feature=youtu.be')">Start Live Feed</button>
<h3>Recent Pump Logs (Auto-updates every 30secs)</h3>
<div id="pump-logs-div">

Expand Down

0 comments on commit d25c1a4

Please sign in to comment.