Skip to content

Commit 7e70c6f

Browse files
committed
Return action_attempts where it makes sense
1 parent 2710e93 commit 7e70c6f

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

generate-routes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ const endpointResources: Partial<
5454
> = {
5555
'/access_codes/generate_code': 'generated_code',
5656
'/access_codes/pull_backup_access_code': 'backup_access_code',
57-
'/acs/users/add_to_access_group': null,
58-
'/acs/users/remove_from_access_group': null,
5957
'/acs/access_groups/list_users': 'acs_users',
6058
'/acs/access_groups/remove_user': null,
59+
'/acs/users/add_to_access_group': null,
60+
'/acs/users/remove_from_access_group': null,
6161
'/connect_webviews/view': null,
6262
'/devices/list_device_providers': 'device_providers',
63-
'/locks/lock_door': null,
64-
'/locks/unlock_door': null,
65-
'/noise_sensors/noise_thresholds/create': null,
63+
'/locks/lock_door': 'action_attempt',
64+
'/locks/unlock_door': 'action_attempt',
65+
'/noise_sensors/noise_thresholds/create': null, // could return action action_attempt
6666
'/thermostats/cool': null,
6767
'/thermostats/heat': null,
6868
'/thermostats/heat_cool': null,

src/lib/seam/connect/routes/locks.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,26 @@ export class SeamHttpLocks {
8282
return data.locks
8383
}
8484

85-
async lockDoor(body: LocksLockDoorBody): Promise<void> {
86-
await this.client.request<LocksLockDoorResponse>({
85+
async lockDoor(
86+
body: LocksLockDoorBody,
87+
): Promise<LocksLockDoorResponse['action_attempt']> {
88+
const { data } = await this.client.request<LocksLockDoorResponse>({
8789
url: '/locks/lock_door',
8890
method: 'post',
8991
data: body,
9092
})
93+
return data.action_attempt
9194
}
9295

93-
async unlockDoor(body: LocksUnlockDoorBody): Promise<void> {
94-
await this.client.request<LocksUnlockDoorResponse>({
96+
async unlockDoor(
97+
body: LocksUnlockDoorBody,
98+
): Promise<LocksUnlockDoorResponse['action_attempt']> {
99+
const { data } = await this.client.request<LocksUnlockDoorResponse>({
95100
url: '/locks/unlock_door',
96101
method: 'post',
97102
data: body,
98103
})
104+
return data.action_attempt
99105
}
100106
}
101107

src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ export class SeamHttpNoiseSensorsNoiseThresholds {
6464
return new SeamHttpNoiseSensorsNoiseThresholds(opts)
6565
}
6666

67-
async create(body: NoiseSensorsNoiseThresholdsCreateBody): Promise<void> {
68-
await this.client.request<NoiseSensorsNoiseThresholdsCreateResponse>({
69-
url: '/noise_sensors/noise_thresholds/create',
70-
method: 'post',
71-
data: body,
72-
})
67+
async create(
68+
body: NoiseSensorsNoiseThresholdsCreateBody,
69+
): Promise<NoiseSensorsNoiseThresholdsCreateResponse['action_attempt']> {
70+
const { data } =
71+
await this.client.request<NoiseSensorsNoiseThresholdsCreateResponse>({
72+
url: '/noise_sensors/noise_thresholds/create',
73+
method: 'post',
74+
data: body,
75+
})
76+
return data.action_attempt
7377
}
7478

7579
async delete(body: NoiseSensorsNoiseThresholdsDeleteBody): Promise<void> {

0 commit comments

Comments
 (0)