Commit 2b5993a0 authored by Kristian Tan's avatar Kristian Tan

convert seconds to kwh

parent d659bee8
...@@ -115,6 +115,7 @@ def create_entry(change_pin): ...@@ -115,6 +115,7 @@ def create_entry(change_pin):
elapsed = int((datetime.now() - start_time).total_seconds()) elapsed = int((datetime.now() - start_time).total_seconds())
start_date = pins[change_pin]['on_date'] start_date = pins[change_pin]['on_date']
kwh = pins[change_pin]['Wattage'] * (elapsed / 3600) / 1000 kwh = pins[change_pin]['Wattage'] * (elapsed / 3600) / 1000
print(kwh)
# If there is already an entry for today, update on time # If there is already an entry for today, update on time
# if latest_entry: # if latest_entry:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment