fix for issue #4 - switched back from iso date to unix epoch
This commit is contained in:
parent
8b1385d9e1
commit
9aeffeca9f
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
# to make sure that everything does not happen at once
|
# to make sure that everything does not happen at once
|
||||||
import time
|
import time
|
||||||
import datetime
|
|
||||||
# json and raspi imports
|
# json and raspi imports
|
||||||
import json
|
import json
|
||||||
# for using GPIO pins of the raspi
|
# for using GPIO pins of the raspi
|
||||||
|
@ -33,7 +32,7 @@ def switched(pos):
|
||||||
wert_des_schalters = not bool(GPIO.input(pin_number))
|
wert_des_schalters = not bool(GPIO.input(pin_number))
|
||||||
if pos != wert_des_schalters:
|
if pos != wert_des_schalters:
|
||||||
journal.write("state changed to: %s " %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')
|
icons = data.get("state").get('icon')
|
||||||
data.update({'state':{'open':wert_des_schalters,'lastchange':chn_time, "icon":icons}})
|
data.update({'state':{'open':wert_des_schalters,'lastchange':chn_time, "icon":icons}})
|
||||||
currentState = wert_des_schalters
|
currentState = wert_des_schalters
|
||||||
|
|
Loading…
Reference in New Issue