Commit 693b4518 authored by Kristian Tan's avatar Kristian Tan

convert seconds to kwh

parent 2b5993a0
...@@ -115,7 +115,13 @@ def create_entry(change_pin): ...@@ -115,7 +115,13 @@ 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) a = elapsed / 3600
print(a)
b = pins[change_pin]['Wattage'] * a
print(b)
c = b / 1000
print(c)
kwh = c
# 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