diff --git a/config.yaml b/config.yaml index a7b0418..9d50983 100644 --- a/config.yaml +++ b/config.yaml @@ -1,6 +1,6 @@ name: Linky description: Sync Energy dashboards with your Linky smart meter -version: 1.3.0 +version: 1.3.1 slug: linky init: false url: https://github.com/bokub/ha-linky diff --git a/package.json b/package.json index 541a565..ae599e4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ha-linky", "private": true, - "version": "1.3.0", + "version": "1.3.1", "type": "module", "scripts": { "build": "tsc", diff --git a/src/index.ts b/src/index.ts index c93e579..05b3fd5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -101,9 +101,9 @@ async function main() { cron.schedule(`${randomSecond} ${randomMinute} 6,9 * * *`, async () => { await haClient.connect(); - for (const dataType in userConfig) { - if (userConfig[dataType]?.action === 'sync') { - await sync(userConfig[dataType]); + for (const config of userConfig.meters) { + if (config.action === 'sync') { + await sync(config); } } diff --git a/src/linky.ts b/src/linky.ts index f138c39..5033b19 100644 --- a/src/linky.ts +++ b/src/linky.ts @@ -13,7 +13,7 @@ export class LinkyClient { this.prm = prm; this.isProduction = isProduction; this.session = new Session(token, prm); - this.session.userAgent = 'ha-linky/1.3.0'; + this.session.userAgent = 'ha-linky/1.3.1'; } public async getEnergyData(firstDay: null | Dayjs): Promise {