Timestamp should be an integer.
This commit is contained in:
parent
31b5c55894
commit
04b69f1a49
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue