Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
seambot committed Jan 21, 2025
1 parent 9718412 commit 4ce94b2
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/lib/seam/connect/models/events/devices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,27 @@ export type TemperatureReachedSetPointEvent = z.infer<
typeof temperature_reached_set_point_event
>

export const temperature_changed_event = device_event.extend({
event_type: z.literal('thermostat.temperature_changed_event'),
temperature_celsius: z
.number()
.describe(
'Temperature, in °C, reported by the [thermostat](https://docs.seam.co/latest/capability-guides/thermostats).',
),
temperature_fahrenheit: z
.number()
.describe(
'Temperature, in °F, reported by the [thermostat](https://docs.seam.co/latest/capability-guides/thermostats).',
),
}).describe(`
---
route_path: /thermostats
---
A [thermostat's](https://docs.seam.co/latest/capability-guides/thermostats) reported temperature changed by at least 1 °C.
`)

export type TemperatureChangedEvent = z.infer<typeof temperature_changed_event>

export const device_events = [
device_connected_event,
device_added_event,
Expand Down Expand Up @@ -662,4 +683,5 @@ export const device_events = [
temperature_threshold_exceeded_event,
temperature_threshold_no_longer_exceeded_event,
temperature_reached_set_point_event,
temperature_changed_event,
] as const
175 changes: 175 additions & 0 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11679,6 +11679,73 @@ export default {
type: 'object',
'x-route-path': '/thermostats',
},
{
description:
"A [thermostat's](https://docs.seam.co/latest/capability-guides/thermostats) reported temperature changed by at least 1 °C.",
properties: {
connected_account_id: {
description:
'ID of the [connected account](https://docs.seam.co/latest/core-concepts/connected-accounts).',
format: 'uuid',
type: 'string',
},
created_at: {
description: 'Date and time at which the event was created.',
format: 'date-time',
type: 'string',
},
device_id: {
description: 'ID of the device.',
format: 'uuid',
type: 'string',
},
event_id: {
description: 'ID of the event.',
format: 'uuid',
type: 'string',
},
event_type: {
enum: ['thermostat.temperature_changed_event'],
type: 'string',
},
occurred_at: {
description: 'Date and time at which the event occurred.',
format: 'date-time',
type: 'string',
},
temperature_celsius: {
description:
'Temperature, in °C, reported by the [thermostat](https://docs.seam.co/latest/capability-guides/thermostats).',
format: 'float',
type: 'number',
},
temperature_fahrenheit: {
description:
'Temperature, in °F, reported by the [thermostat](https://docs.seam.co/latest/capability-guides/thermostats).',
format: 'float',
type: 'number',
},
workspace_id: {
description:
'ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces).',
format: 'uuid',
type: 'string',
},
},
required: [
'event_id',
'workspace_id',
'created_at',
'occurred_at',
'device_id',
'connected_account_id',
'event_type',
'temperature_celsius',
'temperature_fahrenheit',
],
type: 'object',
'x-route-path': '/thermostats',
},
{
description:
'An [enrollment automation](https://docs.seam.co/latest/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#prepare-the-phones-for-a-user-identity-to-start-receiving-mobile-credentials-using-an-enrollment-aut) was deleted.',
Expand Down Expand Up @@ -22309,6 +22376,7 @@ export default {
'thermostat.temperature_threshold_exceeded',
'thermostat.temperature_threshold_no_longer_exceeded',
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed_event',
'enrollment_automation.deleted',
'phone.deactivated',
],
Expand Down Expand Up @@ -22389,6 +22457,7 @@ export default {
'thermostat.temperature_threshold_exceeded',
'thermostat.temperature_threshold_no_longer_exceeded',
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed_event',
'enrollment_automation.deleted',
'phone.deactivated',
],
Expand Down Expand Up @@ -25645,6 +25714,112 @@ export default {
'x-title': 'Set a Temperature Threshold',
},
},
'/thermostats/simulate/set_hvac_mode': {
post: {
operationId: 'thermostatsSimulateSetHvacModePost',
requestBody: {
content: {
'application/json': {
schema: {
discriminator: { propertyName: 'hvac_mode' },
oneOf: [
{
properties: {
device_id: { format: 'uuid', type: 'string' },
hvac_mode: { enum: ['off'], type: 'string' },
},
required: ['hvac_mode', 'device_id'],
type: 'object',
},
{
properties: {
cooling_set_point_celsius: {
format: 'float',
type: 'number',
},
cooling_set_point_fahrenheit: {
format: 'float',
type: 'number',
},
device_id: { format: 'uuid', type: 'string' },
hvac_mode: { enum: ['cool'], type: 'string' },
},
required: ['hvac_mode', 'device_id'],
type: 'object',
},
{
properties: {
device_id: { format: 'uuid', type: 'string' },
heating_set_point_celsius: {
format: 'float',
type: 'number',
},
heating_set_point_fahrenheit: {
format: 'float',
type: 'number',
},
hvac_mode: { enum: ['heat'], type: 'string' },
},
required: ['hvac_mode', 'device_id'],
type: 'object',
},
{
properties: {
cooling_set_point_celsius: {
format: 'float',
type: 'number',
},
cooling_set_point_fahrenheit: {
format: 'float',
type: 'number',
},
device_id: { format: 'uuid', type: 'string' },
heating_set_point_celsius: {
format: 'float',
type: 'number',
},
heating_set_point_fahrenheit: {
format: 'float',
type: 'number',
},
hvac_mode: { enum: ['heat_cool'], type: 'string' },
},
required: ['hvac_mode', 'device_id'],
type: 'object',
},
],
},
},
},
},
responses: {
200: {
content: {
'application/json': {
schema: {
properties: { ok: { type: 'boolean' } },
required: ['ok'],
type: 'object',
},
},
},
description: 'OK',
},
400: { description: 'Bad Request' },
401: { description: 'Unauthorized' },
},
security: [
{ api_key: [] },
{ pat_with_workspace: [] },
{ console_session_with_workspace: [] },
],
summary: '/thermostats/simulate/set_hvac_mode',
tags: ['/thermostats'],
'x-fern-sdk-group-name': ['thermostats', 'simulate'],
'x-fern-sdk-method-name': 'set_hvac_mode',
'x-response-key': null,
},
},
'/thermostats/simulate/temperature_reached': {
post: {
operationId: 'thermostatsSimulateTemperatureReachedPost',
Expand Down
73 changes: 73 additions & 0 deletions src/lib/seam/connect/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19876,6 +19876,25 @@ export interface Routes {
/** Desired temperature, in °F, defined by the [thermostat's](https://docs.seam.co/latest/capability-guides/thermostats) cooling or heating [set point](https://docs.seam.co/latest/capability-guides/thermostats/understanding-thermostat-concepts/set-points). */
desired_temperature_fahrenheit?: number | undefined
}
| {
/** ID of the event. */
event_id: string
/** ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces). */
workspace_id: string
/** Date and time at which the event was created. */
created_at: string
/** Date and time at which the event occurred. */
occurred_at: string
/** ID of the device. */
device_id: string
/** ID of the [connected account](https://docs.seam.co/latest/core-concepts/connected-accounts). */
connected_account_id: string
event_type: 'thermostat.temperature_changed_event'
/** Temperature, in °C, reported by the [thermostat](https://docs.seam.co/latest/capability-guides/thermostats). */
temperature_celsius: number
/** Temperature, in °F, reported by the [thermostat](https://docs.seam.co/latest/capability-guides/thermostats). */
temperature_fahrenheit: number
}
| {
/** ID of the event. */
event_id: string
Expand Down Expand Up @@ -19996,6 +20015,7 @@ export interface Routes {
| 'thermostat.temperature_threshold_exceeded'
| 'thermostat.temperature_threshold_no_longer_exceeded'
| 'thermostat.temperature_reached_set_point'
| 'thermostat.temperature_changed_event'
| 'enrollment_automation.deleted'
| 'phone.deactivated'
)
Expand Down Expand Up @@ -20074,6 +20094,7 @@ export interface Routes {
| 'thermostat.temperature_threshold_exceeded'
| 'thermostat.temperature_threshold_no_longer_exceeded'
| 'thermostat.temperature_reached_set_point'
| 'thermostat.temperature_changed_event'
| 'enrollment_automation.deleted'
| 'phone.deactivated'
>
Expand Down Expand Up @@ -21309,6 +21330,25 @@ export interface Routes {
/** Desired temperature, in °F, defined by the [thermostat's](https://docs.seam.co/latest/capability-guides/thermostats) cooling or heating [set point](https://docs.seam.co/latest/capability-guides/thermostats/understanding-thermostat-concepts/set-points). */
desired_temperature_fahrenheit?: number | undefined
}
| {
/** ID of the event. */
event_id: string
/** ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces). */
workspace_id: string
/** Date and time at which the event was created. */
created_at: string
/** Date and time at which the event occurred. */
occurred_at: string
/** ID of the device. */
device_id: string
/** ID of the [connected account](https://docs.seam.co/latest/core-concepts/connected-accounts). */
connected_account_id: string
event_type: 'thermostat.temperature_changed_event'
/** Temperature, in °C, reported by the [thermostat](https://docs.seam.co/latest/capability-guides/thermostats). */
temperature_celsius: number
/** Temperature, in °F, reported by the [thermostat](https://docs.seam.co/latest/capability-guides/thermostats). */
temperature_fahrenheit: number
}
| {
/** ID of the event. */
event_id: string
Expand Down Expand Up @@ -43180,6 +43220,39 @@ export interface Routes {
formData: {}
jsonResponse: {}
}
'/thermostats/simulate/set_hvac_mode': {
route: '/thermostats/simulate/set_hvac_mode'
method: 'POST'
queryParams: {}
jsonBody:
| {
hvac_mode: 'off'
device_id: string
}
| {
hvac_mode: 'cool'
device_id: string
cooling_set_point_celsius?: number | undefined
cooling_set_point_fahrenheit?: number | undefined
}
| {
hvac_mode: 'heat'
device_id: string
heating_set_point_celsius?: number | undefined
heating_set_point_fahrenheit?: number | undefined
}
| {
hvac_mode: 'heat_cool'
device_id: string
cooling_set_point_celsius?: number | undefined
cooling_set_point_fahrenheit?: number | undefined
heating_set_point_celsius?: number | undefined
heating_set_point_fahrenheit?: number | undefined
}
commonParams: {}
formData: {}
jsonResponse: {}
}
'/thermostats/simulate/temperature_reached': {
route: '/thermostats/simulate/temperature_reached'
method: 'POST'
Expand Down

0 comments on commit 4ce94b2

Please sign in to comment.