Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: devicedb: update responses #212

Merged
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
5 changes: 4 additions & 1 deletion src/lib/seam/devicedb/public-models/device-model-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const smartlock = z.object({
'cylinder',
'padlock',
'locker',
'unknown',
]),
has_physical_key: z.boolean(),
has_camera: z.boolean(),
Expand Down Expand Up @@ -52,6 +53,8 @@ const thermostat = z.object({
}),
})

export type ThermostatPropertiesV1 = z.infer<typeof thermostat>

const relay = z.object({
main_category: z.literal('relay'),
})
Expand All @@ -74,7 +77,7 @@ export const base_device_model_v1 = z.object({
slug: z.string(),
display_name: z.string(),
primary_color_hex: z.string().optional(),
manufacturer_sku: z.string(),
manufacturer_sku: z.string().optional(),
front_image: image_reference.optional(),
back_image: image_reference.optional(),
})
Expand Down
10 changes: 6 additions & 4 deletions src/lib/seam/devicedb/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export interface Routes {
is_device_supported: boolean
display_name: string
description: string
product_url: string
product_url?: string | undefined
main_connection_type: 'wifi' | 'zwave' | 'zigbee' | 'unknown'
aesthetic_variants: Array<{
slug: string
display_name: string
primary_color_hex?: string | undefined
manufacturer_sku: string
manufacturer_sku?: string | undefined
front_image?:
| {
url: string
Expand Down Expand Up @@ -69,6 +69,7 @@ export interface Routes {
| 'cylinder'
| 'padlock'
| 'locker'
| 'unknown'
has_physical_key: boolean
has_camera: boolean
}
Expand Down Expand Up @@ -150,13 +151,13 @@ export interface Routes {
is_device_supported: boolean
display_name: string
description: string
product_url: string
product_url?: string | undefined
main_connection_type: 'wifi' | 'zwave' | 'zigbee' | 'unknown'
aesthetic_variants: Array<{
slug: string
display_name: string
primary_color_hex?: string | undefined
manufacturer_sku: string
manufacturer_sku?: string | undefined
front_image?:
| {
url: string
Expand Down Expand Up @@ -191,6 +192,7 @@ export interface Routes {
| 'cylinder'
| 'padlock'
| 'locker'
| 'unknown'
has_physical_key: boolean
has_camera: boolean
}
Expand Down