Fix following sonarlint.
This commit is contained in:
parent
7d8e207ffa
commit
85400b46e1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user