Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/lib/seam/connect/models/devices/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,16 @@ const august_lock_not_authorized = common_device_error.extend({
Indicates that the user is not authorized to use the August lock.
`)

const low_battery = common_device_error.extend({
error_code: z.literal('low_battery').describe(error_code_description),
}).describe(`
---
resource_type: device
variant_group_key: locks
---
Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access.
`)

const salto_ks_subscription_limit_exceeded = common_device_error.extend({
error_code: z
.literal('salto_ks_subscription_limit_exceeded')
Expand Down Expand Up @@ -382,6 +392,7 @@ export const device_error = z
device_disconnected,
empty_backup_access_code_pool,
august_lock_not_authorized,
low_battery,
missing_device_credentials,
auxiliary_heat_running,
subscription_required,
Expand All @@ -398,6 +409,7 @@ export const device_error_map = z.object({
account_disconnected: account_disconnected.optional(),
empty_backup_access_code_pool: empty_backup_access_code_pool.optional(),
august_lock_not_authorized: august_lock_not_authorized.optional(),
low_battery: low_battery.optional(),
salto_ks_subscription_limit_exceeded:
salto_ks_subscription_limit_exceeded.optional(),
insufficient_permissions: insufficient_permissions.optional(),
Expand Down Expand Up @@ -706,6 +718,17 @@ const accessory_keypad_low_battery = common_device_warning.extend({
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 battery_replacement_recommended = common_device_warning.extend({
warning_code: z
.literal('battery_replacement_recommended')
.describe(warning_code_description),
}).describe(`
---
variant_group_key: locks
---
Indicates that the lock has about two weeks of battery life remaining or the provider otherwise recommends replacing the lock's batteries soon.
`)

const unreliable_online_status = common_device_warning.extend({
warning_code: z
.literal('unreliable_online_status')
Expand Down Expand Up @@ -787,6 +810,7 @@ const device_warning = z.discriminatedUnion('warning_code', [
keynest_unsupported_locker,
accessory_keypad_setup_required,
accessory_keypad_low_battery,
battery_replacement_recommended,
unreliable_online_status,
max_access_codes_reached,
subscription_required_for_additional_capabilities,
Expand Down Expand Up @@ -827,6 +851,7 @@ export const device_warning_map = z.object({
keynest_unsupported_locker: keynest_unsupported_locker.optional(),
accessory_keypad_setup_required: accessory_keypad_setup_required.optional(),
accessory_keypad_low_battery: accessory_keypad_low_battery.optional(),
battery_replacement_recommended: battery_replacement_recommended.optional(),
unreliable_online_status: unreliable_online_status.optional(),
max_access_codes_reached: max_access_codes_reached.optional(),
subscription_required_for_additional_capabilities:
Expand Down
268 changes: 268 additions & 0 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,44 @@ const openapi: OpenAPISpec = {
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description:
"Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access.",
properties: {
created_at: {
description:
'Date and time at which Seam created the error.',
format: 'date-time',
type: 'string',
},
error_code: {
description:
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
enum: ['low_battery'],
type: 'string',
},
is_device_error: {
description:
'Indicates that the error is a device error.',
enum: [true],
type: 'boolean',
},
message: {
description:
'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
},
required: [
'message',
'is_device_error',
'created_at',
'error_code',
],
type: 'object',
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description: 'Indicates that device credentials are missing.',
properties: {
Expand Down Expand Up @@ -16682,6 +16720,44 @@ const openapi: OpenAPISpec = {
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description:
"Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access.",
properties: {
created_at: {
description:
'Date and time at which Seam created the error.',
format: 'date-time',
type: 'string',
},
error_code: {
description:
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
enum: ['low_battery'],
type: 'string',
},
is_device_error: {
description:
'Indicates that the error is a device error.',
enum: [true],
type: 'boolean',
},
message: {
description:
'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
},
required: [
'message',
'is_device_error',
'created_at',
'error_code',
],
type: 'object',
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description: 'Indicates that device credentials are missing.',
properties: {
Expand Down Expand Up @@ -21213,6 +21289,32 @@ const openapi: OpenAPISpec = {
type: 'object',
'x-variant-group-key': 'locks',
},
{
description:
"Indicates that the lock has about two weeks of battery life remaining or the provider otherwise recommends replacing the lock's batteries soon.",
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: ['battery_replacement_recommended'],
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.',
Expand Down Expand Up @@ -34519,6 +34621,44 @@ const openapi: OpenAPISpec = {
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description:
"Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access.",
properties: {
created_at: {
description:
'Date and time at which Seam created the error.',
format: 'date-time',
type: 'string',
},
error_code: {
description:
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
enum: ['low_battery'],
type: 'string',
},
is_device_error: {
description:
'Indicates that the error is a device error.',
enum: [true],
type: 'boolean',
},
message: {
description:
'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
},
required: [
'message',
'is_device_error',
'created_at',
'error_code',
],
type: 'object',
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description: 'Indicates that device credentials are missing.',
properties: {
Expand Down Expand Up @@ -35438,6 +35578,32 @@ const openapi: OpenAPISpec = {
type: 'object',
'x-variant-group-key': 'locks',
},
{
description:
"Indicates that the lock has about two weeks of battery life remaining or the provider otherwise recommends replacing the lock's batteries soon.",
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: ['battery_replacement_recommended'],
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.',
Expand Down Expand Up @@ -38430,6 +38596,44 @@ const openapi: OpenAPISpec = {
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description:
"Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access.",
properties: {
created_at: {
description:
'Date and time at which Seam created the error.',
format: 'date-time',
type: 'string',
},
error_code: {
description:
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
enum: ['low_battery'],
type: 'string',
},
is_device_error: {
description:
'Indicates that the error is a device error.',
enum: [true],
type: 'boolean',
},
message: {
description:
'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
},
required: [
'message',
'is_device_error',
'created_at',
'error_code',
],
type: 'object',
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description: 'Indicates that device credentials are missing.',
properties: {
Expand Down Expand Up @@ -43026,6 +43230,44 @@ const openapi: OpenAPISpec = {
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description:
"Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access.",
properties: {
created_at: {
description:
'Date and time at which Seam created the error.',
format: 'date-time',
type: 'string',
},
error_code: {
description:
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
enum: ['low_battery'],
type: 'string',
},
is_device_error: {
description:
'Indicates that the error is a device error.',
enum: [true],
type: 'boolean',
},
message: {
description:
'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
},
required: [
'message',
'is_device_error',
'created_at',
'error_code',
],
type: 'object',
'x-resource-type': 'device',
'x-variant-group-key': 'locks',
},
{
description: 'Indicates that device credentials are missing.',
properties: {
Expand Down Expand Up @@ -44097,6 +44339,32 @@ const openapi: OpenAPISpec = {
type: 'object',
'x-variant-group-key': 'locks',
},
{
description:
"Indicates that the lock has about two weeks of battery life remaining or the provider otherwise recommends replacing the lock's batteries soon.",
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: ['battery_replacement_recommended'],
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.',
Expand Down
Loading
Loading