Skip to content

Commit 92441ff

Browse files
authored
fix: Failed to apply calibration to ... when using an empty string (#8088)
1 parent bd38d99 commit 92441ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export function postProcessConvertedFromZigbeeMessage(definition: Definition, pa
304304
for (const [key, value] of Object.entries(payload)) {
305305
const definitionExposes = Array.isArray(definition.exposes) ? definition.exposes : definition.exposes(null, null);
306306
const expose = definitionExposes.find((e) => e.property === key);
307-
if (expose?.name in utils.calibrateAndPrecisionRoundOptionsDefaultPrecision && utils.isNumber(value)) {
307+
if (expose?.name in utils.calibrateAndPrecisionRoundOptionsDefaultPrecision && value !== '' && utils.isNumber(value)) {
308308
try {
309309
payload[key] = utils.calibrateAndPrecisionRoundOptions(value, options, expose.name);
310310
} catch (error) {

0 commit comments

Comments
 (0)