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 @@ <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">