Skip to content
Snippets Groups Projects
Commit 99819c55 authored by BRONES Romain's avatar BRONES Romain
Browse files

Fix GetNearest for scalar

* The return of the command is a tuple string, spearator ';'
* correctly convert timestamp and value
parent 4c8410df
Branches
Tags
Loading
...@@ -536,13 +536,13 @@ def _extract_scalar(attribute, method, date1, date2, db): ...@@ -536,13 +536,13 @@ def _extract_scalar(attribute, method, date1, date2, db):
# Unpack return # Unpack return
try: try:
_date, _value = cmdreturn _date, _value = cmdreturn.split(';')
except TypeError: except TypeError:
logger.error("Could not extract this chunk. Check the device extractor") logger.error("Could not extract this chunk. Check the device extractor")
return None return None
# Fabricate return pandas.Series # Fabricate return pandas.Series
d=pd.Series(index=[datetime.datetime.fromtimestamp(_date),], data=[_value,], name=attribute) d=pd.Series(index=[datetime.datetime.fromtimestamp(int(_date)/1000),], data=[float(_value),], name=attribute)
return d return d
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment