File tree Expand file tree Collapse file tree 7 files changed +3378
-330
lines changed
Expand file tree Collapse file tree 7 files changed +3378
-330
lines changed Original file line number Diff line number Diff line change 11import { z } from 'zod'
22
33import { activate_climate_preset_action_attempt } from './activate-climate-preset.js'
4+ import { configure_auto_lock_action_attempt } from './configure-auto-lock.js'
45import { deprecated_action_attempts } from './deprecated.js'
56import { encode_credential_action_attempt } from './encode-credential.js'
67import { 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 ---
Original file line number Diff line number Diff line change 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+ )
Original file line number Diff line number Diff 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} )
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments