From d25c1a441c6f60e4150c091786aaa5a2579e6c53 Mon Sep 17 00:00:00 2001 From: Ankit Rajpoot Date: Fri, 2 Nov 2018 16:54:32 +0530 Subject: [PATCH] Fix chargecontroller syntax error. --- chargecontroller.py | 17 ++++++++--------- webtemplates/index.html | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/chargecontroller.py b/chargecontroller.py index 9a2643e..8669942 100644 --- a/chargecontroller.py +++ b/chargecontroller.py @@ -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) \ No newline at end of file + time.sleep(CHARGER_RUNTIME) diff --git a/webtemplates/index.html b/webtemplates/index.html index 26f8d0e..4f348a2 100644 --- a/webtemplates/index.html +++ b/webtemplates/index.html @@ -96,7 +96,7 @@

System Status


- +

Recent Pump Logs (Auto-updates every 30secs)