Skip to content

fix: support for restoreV4 #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/homebridge-hatch-baby-rest/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const knownProducts = [
Product.restMini,
Product.restore,
Product.restoreIot,
Product.restoreV4,
],
ignoredProducts = [
// Known, but not supported
Expand Down Expand Up @@ -233,6 +234,7 @@ export class HatchBabyApi {
restMinis: createDevices(Product.restMini, RestMini),
restores: createDevices(Product.restore, Restore),
restoreIots: createDevices(Product.restoreIot, RestIot),
restoreV4s: createDevices(Product.restoreV4, RestIot),
}
}
}
3 changes: 3 additions & 0 deletions packages/homebridge-hatch-baby-rest/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class HatchBabyRestPlatform implements DynamicPlatformPlugin {
restoreIots,
restIots,
restIotPluses,
restoreV4s,
} = hatchBabyApi
? await hatchBabyApi.getDevices()
: {
Expand All @@ -81,6 +82,7 @@ export class HatchBabyRestPlatform implements DynamicPlatformPlugin {
restIots: [],
restIotPluses: [],
restoreIots: [],
restoreV4s: [],
},
{ api } = this,
cachedAccessoryIds = Object.keys(this.homebridgeAccessories),
Expand All @@ -94,6 +96,7 @@ export class HatchBabyRestPlatform implements DynamicPlatformPlugin {
...restIotPluses,
...restores,
...restoreIots,
...restoreV4s,
]

this.log.info('Configuring Hatch Devices:')
Expand Down
1 change: 1 addition & 0 deletions packages/shared/hatch-sleep-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const enum Product {
restMini = 'restMini',
restore = 'restore',
restoreIot = 'restoreIot',
restoreV4 = 'restoreV4',
alexa = 'alexa',
grow = 'grow',
answeredReader = 'answeredReader',
Expand Down