fix for issue #4 - switched back from iso date to unix epoch

This commit is contained in:
Your Name 2018-08-30 22:44:36 +00:00 committed by Martin/Geno
parent 8b1385d9e1
commit 9aeffeca9f
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
1 changed files with 1 additions and 2 deletions

View File

@ -8,7 +8,6 @@
# to make sure that everything does not happen at once
import time
import datetime
# json and raspi imports
import json
# for using GPIO pins of the raspi
@ -33,7 +32,7 @@ def switched(pos):
wert_des_schalters = not bool(GPIO.input(pin_number))
if pos != wert_des_schalters:
journal.write("state changed to: %s " %wert_des_schalters)
chn_time = datetime.datetime.now().isoformat()
chn_time = time.time()
icons = data.get("state").get('icon')
data.update({'state':{'open':wert_des_schalters,'lastchange':chn_time, "icon":icons}})
currentState = wert_des_schalters