Skip to content

Commit 0b34621

Browse files
authored
feat: Sync with Seam API via 98837e87c812aebb94792203f7bec0ddbb0075b6 (#2734)
1 parent c370662 commit 0b34621

File tree

7 files changed

+3378
-330
lines changed

7 files changed

+3378
-330
lines changed

src/lib/seam/connect/models/action-attempts/action-attempt.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { z } from 'zod'
22

33
import { activate_climate_preset_action_attempt } from './activate-climate-preset.js'
4+
import { configure_auto_lock_action_attempt } from './configure-auto-lock.js'
45
import { deprecated_action_attempts } from './deprecated.js'
56
import { encode_credential_action_attempt } from './encode-credential.js'
67
import { lock_door_action_attempt } from './lock-door.js'
@@ -25,6 +26,7 @@ export const action_attempt = z.union([
2526
...simulate_keypad_code_entry_action_attempt.options,
2627
...simulate_manual_lock_via_keypad_action_attempt.options,
2728
...push_thermostat_programs_action_attempt.options,
29+
...configure_auto_lock_action_attempt.options,
2830
...deprecated_action_attempts,
2931
]).describe(`
3032
---
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { z } from 'zod'
2+
3+
import {
4+
common_failed_action_attempt,
5+
common_pending_action_attempt,
6+
common_succeeded_action_attempt,
7+
} from './common.js'
8+
9+
const action_type = z
10+
.literal('CONFIGURE_AUTO_LOCK')
11+
.describe(
12+
'Action attempt to track the status of configuring the auto-lock on a lock.',
13+
)
14+
15+
const error = z
16+
.object({
17+
type: z.string().describe('Type of the error.'),
18+
message: z
19+
.string()
20+
.describe(
21+
'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
22+
),
23+
})
24+
.describe('Error associated with the action.')
25+
26+
const result = z.object({}).describe('Result of the action.')
27+
28+
export const configure_auto_lock_action_attempt = z.discriminatedUnion(
29+
'status',
30+
[
31+
common_pending_action_attempt
32+
.extend({
33+
action_type,
34+
})
35+
.describe('Configuring the auto-lock is pending.'),
36+
common_succeeded_action_attempt
37+
.extend({
38+
action_type,
39+
result,
40+
})
41+
.describe('Configuring the auto-lock succeeded.'),
42+
common_failed_action_attempt
43+
.extend({ action_type, error })
44+
.describe('Configuring the auto-lock failed.'),
45+
],
46+
)

src/lib/seam/connect/models/devices/capability-properties/lock.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,16 @@ export const lock_capability_properties = z.object({
2525
---
2626
Indicates whether the door is open.
2727
`),
28+
auto_lock_enabled: z.boolean().optional().describe(`
29+
---
30+
property_group_key: locks
31+
---
32+
Indicates whether automatic locking is enabled.
33+
`),
34+
auto_lock_delay_seconds: z.number().optional().describe(`
35+
---
36+
property_group_key: locks
37+
---
38+
The delay in seconds before the lock automatically locks after being unlocked.
39+
`),
2840
})

src/lib/seam/connect/models/devices/device-metadata.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ export const device_metadata = z
413413
wifi: z
414414
.boolean()
415415
.describe(`Indicates whether a TTLock device supports Wi-Fi.`),
416+
auto_lock_time_config: z
417+
.boolean()
418+
.describe(
419+
`Indicates whether a TTLock device supports auto-lock time configuration.`,
420+
),
416421
})
417422
.describe(`Features for a TTLock device.`),
418423
has_gateway: z

src/lib/seam/connect/models/devices/device.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const device_capability_flags = z
2929
can_simulate_hub_connection: z.boolean(),
3030
can_simulate_hub_disconnection: z.boolean(),
3131
can_simulate_paid_subscription: z.boolean(),
32+
can_configure_auto_lock: z.boolean(),
3233
})
3334
.partial()
3435

0 commit comments

Comments
 (0)