3 Commits
0.0.4 ... 0.0.7

Author SHA1 Message Date
863644fa56 casting 2023-05-23 13:36:45 +02:00
41ea343be2 another fix 2023-05-23 13:28:14 +02:00
f8f9449c99 another fix 2023-05-23 13:26:48 +02:00

View File

@ -63,7 +63,7 @@ class DbOp(object):
'unit': res[2]
}
logger.debug(f"{variable=}")
return application
return variable
except Exception as e:
logger.error(f"Error getting variable: {e}")
raise VariableNotFoundException(appId, converterId, deviceId, variableId)
@ -79,7 +79,7 @@ class DbOp(object):
with conn.cursor() as cur:
cur.execute("""
insert into measurement_t (time, application, variable, value, unit)
values (now(), %(application)s, %(variable)s, %(value)s, %(unit)s
values (now(), %(application)s, %(variable)s, %(value)s, %(unit)s)
""",
{
'application': measurement['application'],
@ -129,7 +129,7 @@ def mqttOnMessageCallback(client, userdata, message):
"application": variable["application"],
"variable": variable["variable"],
"unit": variable["unit"],
"value": payload
"value": float(payload)
}
logger.debug(f"{measurement=}")