From 7d8e207ffaceeb48fe567a46144001d8b3d3dff8 Mon Sep 17 00:00:00 2001 From: Laur Ivan Date: Thu, 17 Mar 2022 08:25:59 +0100 Subject: [PATCH] Fix bool for supabase. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)