diff --git a/src/index.ts b/src/index.ts index 6dd527f..2552e70 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,7 +37,7 @@ async function main(evt: string, src: string, dest: string, value: Buffer) { address_id: dpt.addressId, dpt: dpt.id, timestamp: new Date().getTime(), - value: dpt.dpt.decoder(value) + value: dpt.id.startsWith('DPT1.') ? (dpt.dpt.decoder(value) === 1) ? true : false : dpt.dpt.decoder(value) } upsert(document)