Skip to content

Commit

Permalink
update general
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Feb 28, 2024
1 parent dac7569 commit 02f6ff3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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

Expand All @@ -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: {},
});
Expand Down

0 comments on commit 02f6ff3

Please # to comment.