Skip to content

Commit

Permalink
Fix daily synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
bokub committed Feb 25, 2024
1 parent 3ef1a15 commit 679d986
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ha-linky",
"private": true,
"version": "1.3.0",
"version": "1.3.1",
"type": "module",
"scripts": {
"build": "tsc",
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/linky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<EnergyDataPoint[]> {
Expand Down

0 comments on commit 679d986

Please sign in to comment.