mirror of
https://github.com/OpenMTC/OpenMTC.git
synced 2025-01-27 14:19:20 +00:00
fixing type of timestamp
This commit is contained in:
parent
00a35a6080
commit
c445531989
@ -1,5 +1,6 @@
|
||||
from urllib.parse import urljoin
|
||||
import logging
|
||||
from datetime import datetime
|
||||
|
||||
import requests
|
||||
|
||||
@ -89,7 +90,8 @@ class OrionAPI(LoggerMixin):
|
||||
"type": self._get_type(data_senml["v"]),
|
||||
"metadata": {
|
||||
"timestamp": {
|
||||
"value": data_senml["t"],
|
||||
"value": datetime.fromtimestamp(float(data_senml["t"])).replace(microsecond=0).isoformat()
|
||||
if data_senml["t"] != "none" else data_senml["t"],
|
||||
"type": "String"
|
||||
},
|
||||
"bn": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user