From 85400b46e13a8a60fb096facb1012f7cc61476af Mon Sep 17 00:00:00 2001 From: Laur Ivan Date: Thu, 31 Mar 2022 12:04:45 +0200 Subject: [PATCH] Fix following sonarlint. --- src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 2552e70..e60f08a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,11 +33,13 @@ async function main(evt: string, src: string, dest: string, value: Buffer) { const dpt: DPTAndAddressID = (await getDPTforAddress(dest)) + + const newLocal = (dpt.dpt.decoder(value) === 1) ? true : false; const document: MetricDocument = { address_id: dpt.addressId, dpt: dpt.id, timestamp: new Date().getTime(), - value: dpt.id.startsWith('DPT1.') ? (dpt.dpt.decoder(value) === 1) ? true : false : dpt.dpt.decoder(value) + value: dpt.id.startsWith('DPT1.') ? newLocal : dpt.dpt.decoder(value) } upsert(document)