Fix wrong sign of attributes

This commit is contained in:
Stephan Hadinger 2020-06-05 18:24:31 +02:00
parent 9d86c15685
commit 0ebcbc76dc
2 changed files with 2 additions and 2 deletions

View File

@ -1397,7 +1397,7 @@ int32_t Z_ApplyConverter(const class ZCLFrame *zcl, uint16_t shortaddr, JsonObje
if (multiplier > 0) { if (multiplier > 0) {
json[new_name] = ((float)value) * multiplier; json[new_name] = ((float)value) * multiplier;
} else { } else {
json[new_name] = ((float)value) / multiplier; json[new_name] = ((float)value) / (-multiplier);
} }
} }

View File

@ -483,7 +483,7 @@ void ZbSendReportWrite(const JsonObject &val_pubwrite, uint16_t device, uint16_t
if (multiplier > 0) { // inverse of decoding if (multiplier > 0) { // inverse of decoding
val_f = val_f / multiplier; val_f = val_f / multiplier;
} else { } else {
val_f = val_f * multiplier; val_f = val_f * (-multiplier);
} }
use_val = false; use_val = false;
} }