fixing type of timestamp

This commit is contained in:
aor-fokus 2019-02-05 16:23:04 +01:00
parent 7781b15c4e
commit c3ac4f9dfb

View File

@ -3,6 +3,7 @@ try:
except ImportError:
from urlparse import urljoin
import logging
from datetime import datetime
import requests
@ -92,7 +93,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": {