Skip to content

Commit

Permalink
fix(api): Ping activate endpoint periodically to keep carrier api in …
Browse files Browse the repository at this point in the history
…sync with therm

This does not keep HomeKit in sync, however, since the plugin does not know how to push changes to
HK yet.

re #397
  • Loading branch information
grivkees committed Jan 15, 2023
1 parent 094e513 commit 8044dfb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ export class CarrierInfinityHomebridgePlatform implements DynamicPlatformPlugin
this.log.error('Could not discover devices: ' + error.message);
});
});

// Periodically ping the carrier api to keep it in sync with the thermostat.
// This does not keep HomeKit in sync, however, since the plugin does not
// know how to push changes to HK yet.
// TODO: try to move this into the api class when we have event based
setInterval(() => {
this.api_connection.activate();
}, 30 * 60 * 1000); // every 30 min
}

configureAccessory(accessory: PlatformAccessory): void {
Expand Down

0 comments on commit 8044dfb

Please sign in to comment.