Skip to content

Commit 1e80701

Browse files
committed
fix: reduce IoT client refresh interval to 50 minutes
AWS Cognito credentials expire after ~1 hour, but the MQTT client was only refreshing every 8 hours. This caused devices to silently stop responding to commands after credentials expired. Fixes #59
1 parent d34bfe4 commit 1e80701

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/full-horses-fail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'homebridge-hatch-baby-rest': patch
3+
---
4+
5+
Refresh aws token every 50 minutes instead of 8 hours

packages/homebridge-hatch-baby-rest/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const knownProducts: Product[] = [
4343
Product.grow,
4444
Product.answeredReader,
4545
],
46-
iotClientRefreshPeriod = 8 * 60 * 60 * 1000 // refresh client every 8 hours
46+
iotClientRefreshPeriod = 50 * 60 * 1000 // refresh client every 50 minutes (AWS Cognito credentials expire after ~1 hour)
4747

4848
export class HatchBabyApi {
4949
public readonly config

0 commit comments

Comments
 (0)