allow negative values from mbus

This commit is contained in:
Wolfgang Hottgenroth 2023-03-15 22:55:37 +01:00
parent b7071379b9
commit 13c8344276

View File

@ -218,7 +218,7 @@ static void parseAndPrintFrame() {
// mbusCommHandle.requestId,
// parsedVIB.name, parsedVIB.unit, parsedVIB.exponent);
if (parsedVIB.found) {
uint32_t value = strtol(mbus_data_record_value(record), NULL, 10);
int32_t value = strtol(mbus_data_record_value(record), NULL, 10);
float weightedValue = ((float) value) * powf(10.0, ((float) parsedVIB.exponent));
coloredMsg(LOG_YELLOW, false, "mbc papf [%d] %s is %.1f %s (%d * 10^%d)",
mbusCommHandle.requestId, parsedVIB.name, weightedValue, parsedVIB.unit,