ReferenceHTTP API
fanPresets
The fanPresets router: 4 methods of the fan-presets capability, with tier, scope, input and output.
Capability fan-presets · scope system · mode singleton · source packages/types/src/capabilities/fan-presets.cap.ts:140.
Every method is called at /trpc/fanPresets.<method> — queries with GET, mutations with POST. See How to call and Authorization.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
getPresets | query | protected | view | no |
setPresets | mutation | admin | admin only | no |
applyPreset | mutation | protected | create | no |
capturePreset | query | protected | view | no |
fanPresets.getPresets
- Kind: query —
GET /trpc/fanPresets.getPresets - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityfan-presets, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=fanPresets.getPresetson your hub
Input
{ deviceId: number }Output
FanPresetSchema[]Shapes: FanPresetSchema
fanPresets.setPresets
- Kind: mutation —
POST /trpc/fanPresets.setPresets - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=fanPresets.setPresetson your hub
Input
{ deviceId: number; presets: FanPresetSchema[] }Output
FanPresetsSetResultSchemaShapes: FanPresetSchema · FanPresetsSetResultSchema
fanPresets.applyPreset
- Kind: mutation —
POST /trpc/fanPresets.applyPreset - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityfan-presets, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=fanPresets.applyPreseton your hub
Input
{ deviceId: number; presetId: string }Output
FanPresetApplyResultSchemaShapes: FanPresetApplyResultSchema
fanPresets.capturePreset
- Kind: query —
GET /trpc/fanPresets.capturePreset - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityfan-presets, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=fanPresets.capturePreseton your hub
Input
{ deviceId: number; fields?: FanCaptureFieldSchema[] }Output
FanPresetCaptureResultSchemaShapes: FanCaptureFieldSchema · FanPresetCaptureResultSchema