From 8ed31047ed5d6efd64cab5dae1dfe19a86e73b54 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Thu, 20 Aug 2026 21:58:05 +0000 Subject: [PATCH] feat: Sync with Seam API via 6657be5e74f559ba373e42c36ecc97bd2181c3a8 --- src/lib/seam/connect/models/devices/device.ts | 15 ++ src/lib/seam/connect/models/events/devices.ts | 7 + src/lib/seam/connect/openapi.ts | 58 ++++++ src/lib/seam/connect/route-types.ts | 168 ++++++++++++++++++ 4 files changed, 248 insertions(+) diff --git a/src/lib/seam/connect/models/devices/device.ts b/src/lib/seam/connect/models/devices/device.ts index 049d9a1c..d06c328a 100644 --- a/src/lib/seam/connect/models/devices/device.ts +++ b/src/lib/seam/connect/models/devices/device.ts @@ -625,6 +625,17 @@ const accessory_keypad_setup_required = common_device_warning.extend({ Indicates that the accessory keypad exists, but is not linked to the Igloohome Bridge. Online access code programming will fail until the keypad is linked to the Igloohome Bridge in the Igloohome app. `) +const accessory_keypad_low_battery = common_device_warning.extend({ + warning_code: z + .literal('accessory_keypad_low_battery') + .describe(warning_code_description), +}).describe(` + --- + variant_group_key: locks + --- + Indicates that the accessory keypad paired with this lock has a low or critically low battery. Replace its batteries so guests can keep entering their access codes. + `) + const unreliable_online_status = common_device_warning.extend({ warning_code: z .literal('unreliable_online_status') @@ -683,6 +694,7 @@ const device_warning = z.discriminatedUnion('warning_code', [ provider_issue, keynest_unsupported_locker, accessory_keypad_setup_required, + accessory_keypad_low_battery, unreliable_online_status, max_access_codes_reached, ]) @@ -741,6 +753,9 @@ export const device_warning_map = z.object({ accessory_keypad_setup_required: accessory_keypad_setup_required .optional() .nullable(), + accessory_keypad_low_battery: accessory_keypad_low_battery + .optional() + .nullable(), unreliable_online_status: unreliable_online_status.optional().nullable(), max_access_codes_reached: max_access_codes_reached.optional().nullable(), }) diff --git a/src/lib/seam/connect/models/events/devices.ts b/src/lib/seam/connect/models/events/devices.ts index d2cccdb2..c67008e9 100644 --- a/src/lib/seam/connect/models/events/devices.ts +++ b/src/lib/seam/connect/models/events/devices.ts @@ -45,6 +45,12 @@ const device_battery_status = z 'Battery status of the affected device, calculated from the numeric `battery_level` value.', ) +const battery_source = z + .enum(['lock', 'accessory_keypad']) + .describe( + "Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery.", + ) + const disconnection_error_code = z .enum(['account_disconnected', 'hub_disconnected', 'device_disconnected']) .describe('Error code associated with the disconnection event, if any.') @@ -176,6 +182,7 @@ export type DeviceTamperedEvent = z.infer export const device_low_battery_event = device_event.extend({ event_type: z.literal('device.low_battery'), battery_level, + battery_source: battery_source.optional(), }).describe(` --- route_path: /devices diff --git a/src/lib/seam/connect/openapi.ts b/src/lib/seam/connect/openapi.ts index 33de5940..d035bd96 100644 --- a/src/lib/seam/connect/openapi.ts +++ b/src/lib/seam/connect/openapi.ts @@ -17772,6 +17772,32 @@ const openapi: OpenAPISpec = { type: 'object', 'x-variant-group-key': 'locks', }, + { + description: + 'Indicates that the accessory keypad paired with this lock has a low or critically low battery. Replace its batteries so guests can keep entering their access codes.', + properties: { + created_at: { + description: + 'Date and time at which Seam created the warning.', + format: 'date-time', + type: 'string', + }, + message: { + description: + 'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.', + type: 'string', + }, + warning_code: { + description: + 'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.', + enum: ['accessory_keypad_low_battery'], + type: 'string', + }, + }, + required: ['message', 'created_at', 'warning_code'], + type: 'object', + 'x-variant-group-key': 'locks', + }, { description: 'Indicates that the device may optimistically be reported as online because the provider does not reliably report its online status.', @@ -26252,6 +26278,12 @@ const openapi: OpenAPISpec = { minimum: 0, type: 'number', }, + battery_source: { + description: + "Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery.", + enum: ['lock', 'accessory_keypad'], + type: 'string', + }, connected_account_custom_metadata: { additionalProperties: { oneOf: [{ type: 'string' }, { type: 'boolean' }], @@ -37770,6 +37802,32 @@ const openapi: OpenAPISpec = { type: 'object', 'x-variant-group-key': 'locks', }, + { + description: + 'Indicates that the accessory keypad paired with this lock has a low or critically low battery. Replace its batteries so guests can keep entering their access codes.', + properties: { + created_at: { + description: + 'Date and time at which Seam created the warning.', + format: 'date-time', + type: 'string', + }, + message: { + description: + 'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.', + type: 'string', + }, + warning_code: { + description: + 'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.', + enum: ['accessory_keypad_low_battery'], + type: 'string', + }, + }, + required: ['message', 'created_at', 'warning_code'], + type: 'object', + 'x-variant-group-key': 'locks', + }, { description: 'Indicates that the device may optimistically be reported as online because the provider does not reliably report its online status.', diff --git a/src/lib/seam/connect/route-types.ts b/src/lib/seam/connect/route-types.ts index 1ab1e0e2..c27b4825 100644 --- a/src/lib/seam/connect/route-types.ts +++ b/src/lib/seam/connect/route-types.ts @@ -15972,6 +15972,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -24381,6 +24389,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -52473,6 +52489,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -54581,6 +54605,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -56690,6 +56722,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -57513,6 +57553,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -60601,6 +60649,8 @@ export type Routes = { event_type: 'device.low_battery' /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */ battery_level: number + /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */ + battery_source?: ('lock' | 'accessory_keypad') | undefined } | { /** ID of the event. */ @@ -64977,6 +65027,8 @@ export type Routes = { event_type: 'device.low_battery' /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */ battery_level: number + /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */ + battery_source?: ('lock' | 'accessory_keypad') | undefined } | { /** ID of the event. */ @@ -70166,6 +70218,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -72025,6 +72085,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -74011,6 +74079,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -75869,6 +75945,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -86157,6 +86241,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -88015,6 +88107,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -102732,6 +102832,8 @@ export type Routes = { event_type: 'device.low_battery' /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */ battery_level: number + /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */ + battery_source?: ('lock' | 'accessory_keypad') | undefined } | { /** ID of the event. */ @@ -108404,6 +108506,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -117778,6 +117888,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -123903,6 +124021,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -125761,6 +125887,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -137073,6 +137207,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -138933,6 +139075,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -142380,6 +142530,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -146583,6 +146741,14 @@ export type Routes = { /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'accessory_keypad_setup_required' } + | { + /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ + message: string + /** Date and time at which Seam created the warning. */ + created_at: string + /** Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ + warning_code: 'accessory_keypad_low_battery' + } | { /** Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string @@ -150256,6 +150422,8 @@ export type Routes = { event_type: 'device.low_battery' /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */ battery_level: number + /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */ + battery_source?: ('lock' | 'accessory_keypad') | undefined } | { /** ID of the event. */