diff --git a/src/lib/seam/connect/models/action-attempts/action-attempt.ts b/src/lib/seam/connect/models/action-attempts/action-attempt.ts index bbc39556..2a3aacb6 100644 --- a/src/lib/seam/connect/models/action-attempts/action-attempt.ts +++ b/src/lib/seam/connect/models/action-attempts/action-attempt.ts @@ -10,6 +10,7 @@ import { set_cool_action_attempt } from './set-cool.js' import { set_fan_mode_action_attempt } from './set-fan-mode.js' import { set_heat_action_attempt } from './set-heat.js' import { set_heat_cool_action_attempt } from './set-heat-cool.js' +import { set_hvac_mode_action_attempt } from './set-hvac-mode.js' import { set_thermostat_off_action_attempt } from './set-thermostat-off.js' import { unlock_door_action_attempt } from './unlock-door.js' @@ -24,6 +25,7 @@ export const action_attempt = z.union([ ...set_heat_cool_action_attempt.options, ...set_fan_mode_action_attempt.options, ...set_thermostat_off_action_attempt.options, + ...set_hvac_mode_action_attempt.options, ...activate_climate_preset_action_attempt.options, ...deprecated_action_attempts, ]) diff --git a/src/lib/seam/connect/models/action-attempts/set-hvac-mode.ts b/src/lib/seam/connect/models/action-attempts/set-hvac-mode.ts new file mode 100644 index 00000000..d4241d61 --- /dev/null +++ b/src/lib/seam/connect/models/action-attempts/set-hvac-mode.ts @@ -0,0 +1,33 @@ +import { z } from 'zod' + +import { + common_failed_action_attempt, + common_pending_action_attempt, + common_succeeded_action_attempt, +} from './common.js' + +const action_type = z.literal('SET_HVAC_MODE') + +const error = z.object({ + type: z.string(), + message: z.string(), +}) + +const result = z.object({}) + +export const set_hvac_mode_action_attempt = z.discriminatedUnion('status', [ + common_pending_action_attempt + .extend({ + action_type, + }) + .describe('Setting HVAC mode.'), + common_succeeded_action_attempt + .extend({ + action_type, + result, + }) + .describe('Setting HVAC mode succeeded.'), + common_failed_action_attempt + .extend({ action_type, error }) + .describe('Setting HVAC mode failed.'), +]) diff --git a/src/lib/seam/connect/openapi.ts b/src/lib/seam/connect/openapi.ts index 2bba651e..8819afd2 100644 --- a/src/lib/seam/connect/openapi.ts +++ b/src/lib/seam/connect/openapi.ts @@ -3488,6 +3488,82 @@ export default { ], type: 'object', }, + { + description: 'Setting HVAC mode.', + properties: { + action_attempt_id: { + description: 'The ID of the action attempt.', + format: 'uuid', + type: 'string', + 'x-title': 'Action Attempt ID', + }, + action_type: { enum: ['SET_HVAC_MODE'], type: 'string' }, + error: { nullable: true }, + result: { nullable: true }, + status: { enum: ['pending'], type: 'string' }, + }, + required: [ + 'action_attempt_id', + 'status', + 'result', + 'error', + 'action_type', + ], + type: 'object', + }, + { + description: 'Setting HVAC mode succeeded.', + properties: { + action_attempt_id: { + description: 'The ID of the action attempt.', + format: 'uuid', + type: 'string', + 'x-title': 'Action Attempt ID', + }, + action_type: { enum: ['SET_HVAC_MODE'], type: 'string' }, + error: { nullable: true }, + result: { properties: {}, type: 'object' }, + status: { enum: ['success'], type: 'string' }, + }, + required: [ + 'action_attempt_id', + 'status', + 'error', + 'action_type', + 'result', + ], + type: 'object', + }, + { + description: 'Setting HVAC mode failed.', + properties: { + action_attempt_id: { + description: 'The ID of the action attempt.', + format: 'uuid', + type: 'string', + 'x-title': 'Action Attempt ID', + }, + action_type: { enum: ['SET_HVAC_MODE'], type: 'string' }, + error: { + properties: { + message: { type: 'string' }, + type: { type: 'string' }, + }, + required: ['type', 'message'], + type: 'object', + }, + result: { nullable: true }, + status: { enum: ['error'], type: 'string' }, + }, + required: [ + 'action_attempt_id', + 'status', + 'result', + 'action_type', + 'error', + ], + type: 'object', + }, { description: 'Activating climate preset.', properties: { diff --git a/src/lib/seam/connect/route-types.ts b/src/lib/seam/connect/route-types.ts index 9c5d6fdc..d1d7babe 100644 --- a/src/lib/seam/connect/route-types.ts +++ b/src/lib/seam/connect/route-types.ts @@ -783,6 +783,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -1936,6 +1963,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -3319,6 +3373,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -4459,6 +4540,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -7170,6 +7278,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -8212,6 +8347,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -10798,6 +10960,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -11792,6 +11981,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -18721,6 +18937,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -19716,6 +19959,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -22321,6 +22591,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -23326,6 +23623,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -24370,6 +24694,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -25573,6 +25924,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -26574,6 +26952,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -28328,6 +28733,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -29333,6 +29765,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -31901,6 +32360,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -33071,6 +33557,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -34099,6 +34612,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string @@ -37245,6 +37785,33 @@ export interface Routes { message: string } } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'pending' + result: null + error: null + action_type: 'SET_HVAC_MODE' + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'success' + error: null + action_type: 'SET_HVAC_MODE' + result: {} + } + | { + /** The ID of the action attempt. */ + action_attempt_id: string + status: 'error' + result: null + action_type: 'SET_HVAC_MODE' + error: { + type: string + message: string + } + } | { /** The ID of the action attempt. */ action_attempt_id: string