Skip to content

Commit

Permalink
Update capability.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x authored Feb 16, 2024
1 parent 91f7c92 commit 500cd9c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/capability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ export const handler: Handler<Options> = async ({ seam, logger }) => {
const devices = await seam.devices.list()

for (const device of devices) {
if ('can_program_online_access_codes' in device && !device.can_program_online_access_codes) {
const accessCodes = device.accessCodes.list({ device_id: device.device_id })

Check failure on line 20 in examples/capability.ts

View workflow job for this annotation

GitHub Actions / Typecheck (Node.js v18)

Property 'accessCodes' does not exist on type '{ device_id: string; device_type: "akuvox_lock" | "august_lock" | "brivo_access_point" | "butterflymx_panel" | "avigilon_alta_entry" | "doorking_lock" | "genie_door" | "igloo_lock" | ... 24 more ... | "android_phone"; ... 11 more ...; can_program_online_access_codes?: boolean | undefined; }'.

Check failure on line 20 in examples/capability.ts

View workflow job for this annotation

GitHub Actions / Typecheck (Node.js v20)

Property 'accessCodes' does not exist on type '{ device_id: string; device_type: "akuvox_lock" | "august_lock" | "brivo_access_point" | "butterflymx_panel" | "avigilon_alta_entry" | "doorking_lock" | "genie_door" | "igloo_lock" | ... 24 more ... | "android_phone"; ... 11 more ...; can_program_online_access_codes?: boolean | undefined; }'.
if (accessCodes.length > 0) continue
}

if (!device.can_program_online_access_codes) {
await seam.devices.update({
device_id: device.device_id,
Expand All @@ -26,7 +31,7 @@ export const handler: Handler<Options> = async ({ seam, logger }) => {

const unmanagedDevices = await seam.devices.list()

for (const device of unmanagedDevices) {
for (const device of unmanagedDevices) {
if (device.can_program_online_access_codes) {
await seam.devices.unmanaged.update({
device_id: device.device_id,
Expand Down

0 comments on commit 500cd9c

Please sign in to comment.