-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add set_hvac_mode action attempt (#1302)
- Loading branch information
Showing
4 changed files
with
678 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/lib/seam/connect/models/action-attempts/set-hvac-mode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.'), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.