mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
Merge pull request #8623 from s-hadinger/fix_zigbee_signs
Fix wrong sign of attributes
This commit is contained in:
commit
de354997a1
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user