diff --git a/generate-routes.ts b/generate-routes.ts index b68a2cd0..1431fd62 100644 --- a/generate-routes.ts +++ b/generate-routes.ts @@ -54,15 +54,15 @@ const endpointResources: Partial< > = { '/access_codes/generate_code': 'generated_code', '/access_codes/pull_backup_access_code': 'backup_access_code', - '/acs/users/add_to_access_group': null, - '/acs/users/remove_from_access_group': null, '/acs/access_groups/list_users': 'acs_users', '/acs/access_groups/remove_user': null, + '/acs/users/add_to_access_group': null, + '/acs/users/remove_from_access_group': null, '/connect_webviews/view': null, '/devices/list_device_providers': 'device_providers', - '/locks/lock_door': null, - '/locks/unlock_door': null, - '/noise_sensors/noise_thresholds/create': null, + '/locks/lock_door': 'action_attempt', + '/locks/unlock_door': 'action_attempt', + '/noise_sensors/noise_thresholds/create': null, // could return action action_attempt '/thermostats/cool': null, '/thermostats/heat': null, '/thermostats/heat_cool': null, diff --git a/src/lib/seam/connect/routes/locks.ts b/src/lib/seam/connect/routes/locks.ts index e227997a..311b7732 100644 --- a/src/lib/seam/connect/routes/locks.ts +++ b/src/lib/seam/connect/routes/locks.ts @@ -82,20 +82,26 @@ export class SeamHttpLocks { return data.locks } - async lockDoor(body: LocksLockDoorBody): Promise { - await this.client.request({ + async lockDoor( + body: LocksLockDoorBody, + ): Promise { + const { data } = await this.client.request({ url: '/locks/lock_door', method: 'post', data: body, }) + return data.action_attempt } - async unlockDoor(body: LocksUnlockDoorBody): Promise { - await this.client.request({ + async unlockDoor( + body: LocksUnlockDoorBody, + ): Promise { + const { data } = await this.client.request({ url: '/locks/unlock_door', method: 'post', data: body, }) + return data.action_attempt } } diff --git a/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts b/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts index 5846a4ca..54f01030 100644 --- a/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +++ b/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts @@ -64,12 +64,16 @@ export class SeamHttpNoiseSensorsNoiseThresholds { return new SeamHttpNoiseSensorsNoiseThresholds(opts) } - async create(body: NoiseSensorsNoiseThresholdsCreateBody): Promise { - await this.client.request({ - url: '/noise_sensors/noise_thresholds/create', - method: 'post', - data: body, - }) + async create( + body: NoiseSensorsNoiseThresholdsCreateBody, + ): Promise { + const { data } = + await this.client.request({ + url: '/noise_sensors/noise_thresholds/create', + method: 'post', + data: body, + }) + return data.action_attempt } async delete(body: NoiseSensorsNoiseThresholdsDeleteBody): Promise {