From 02f6ff320070fb756e3ebf801825a2d8c89e5bc7 Mon Sep 17 00:00:00 2001 From: TA2k Date: Wed, 28 Feb 2024 08:41:51 -0800 Subject: [PATCH] update general --- main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 54f8ad2..2999a72 100644 --- a/main.js +++ b/main.js @@ -66,6 +66,9 @@ class Libre extends utils.Adapter { this.refreshTokenInterval = setInterval(() => { this.refreshToken(); }, 22 * 60 * 60 * 1000); + this.generalInterval = this.setInterval(() => { + this.getDeviceList(); + }, 23.9 * 60 * 60 * 1000); } } async login() { @@ -109,6 +112,7 @@ class Libre extends utils.Adapter { this.log.error("No user found. Please connect your FreeStyle Libre App with LibreLinkUp"); return; } + this.deviceArray = []; for (const device of res.data.data) { const id = device.patientId; // Alternative datapoint for serial number @@ -129,10 +133,10 @@ class Libre extends utils.Adapter { }, native: {}, }); - await this.setObjectNotExistsAsync(id + ".general", { + await this.extendObjectAsync(id + ".general", { type: "channel", common: { - name: "General Information", + name: "General Information. Update only once a day", }, native: {}, });