From 9aeffeca9f6d613575bbc4eeaa0d72217118a898 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 30 Aug 2018 22:44:36 +0000 Subject: [PATCH] fix for issue #4 - switched back from iso date to unix epoch --- schalter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/schalter.py b/schalter.py index 3bfeafb..51197e5 100755 --- a/schalter.py +++ b/schalter.py @@ -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