From 5db16bbd34cd3f25d5bb86c94ee98c0c8d0aa28c Mon Sep 17 00:00:00 2001 From: "S. Seegel" Date: Sun, 29 Apr 2018 23:38:15 +0200 Subject: [PATCH] Lacrosse add timestamps in JSON --- sensors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sensors.py b/sensors.py index 27111db..2782a3a 100644 --- a/sensors.py +++ b/sensors.py @@ -1,3 +1,5 @@ +import datetime + def crc8(buf): crc = 0 for j in range(5): @@ -18,6 +20,7 @@ def csum(data): class rawsensor(object): def __init__(self, data): self._data = {} + self._data['timestamp'] = datetime.datetime.now().replace(microsecond=0).isoformat() self.__raw = data def __str__(self):