Merge pull request #8623 from s-hadinger/fix_zigbee_signs

Fix wrong sign of attributes
This commit is contained in:
Theo Arends 2020-06-06 08:20:11 +02:00 committed by GitHub
commit de354997a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {
json[new_name] = ((float)value) * multiplier;
} 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
val_f = val_f / multiplier;
} else {
val_f = val_f * multiplier;
val_f = val_f * (-multiplier);
}
use_val = false;
}