fixing type of timestamp

This commit is contained in:
aor-fokus 2019-02-05 16:23:04 +01:00
parent 00a35a6080
commit c445531989

View File

@ -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": {