Timestamp should be an integer.

This commit is contained in:
Kyle Isom 2022-02-27 01:10:42 -08:00
parent 31b5c55894
commit 04b69f1a49
1 changed files with 5 additions and 2 deletions

View File

@ -38,10 +38,13 @@ class Reading:
def __str__(self):
return f'{self.time.strftime("%F %T %Z")},{self.time.timestamp()},{self.temp},{self.press},{self.hum}'
def timestamp(self):
return int(self.time.timestamp())
def list(self):
return [
self.time.strftime("%F %T %Z"),
self.time.timestamp(),
self.timestamp(),
self.temp,
self.press,
self.hum
@ -68,7 +71,7 @@ class Reading:
def json(self) -> bytes:
return bytes(json.dumps({
'timestamp': self.time.timestamp(),
'timestamp': self.timestamp(),
'temperature': self.temp,
'pressure': self.press,
'relative_humidity': self.hum,