ReferenceHTTP API
fanControl
The fanControl router: 6 methods of the fan-control capability, with tier, scope, input and output.
Capability fan-control · scope device · mode singleton · source packages/types/src/capabilities/fan-control.cap.ts:277.
Every method is called at /trpc/fanControl.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
getStatus | query | protected | view | yes |
setPercentage | mutation | protected | create | yes |
setPreset | mutation | protected | create | yes |
setDirection | mutation | protected | create | yes |
setOscillating | mutation | protected | create | yes |
setOscillationAxis | mutation | protected | create | yes |
fanControl.getStatus
- Kind: query —
GET /trpc/fanControl.getStatus(added by the framework) - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityfan-control, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=fanControl.getStatuson your hub
Input
{ deviceId: number }Output
FanControlStatusSchemaShapes: FanControlStatusSchema
fanControl.setPercentage
- Kind: mutation —
POST /trpc/fanControl.setPercentage - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityfan-control, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=fanControl.setPercentageon your hub
Input
{ deviceId: number; speed: number }Output
voidfanControl.setPreset
- Kind: mutation —
POST /trpc/fanControl.setPreset - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityfan-control, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=fanControl.setPreseton your hub
Input
{ deviceId: number; preset: string }Output
voidfanControl.setDirection
- Kind: mutation —
POST /trpc/fanControl.setDirection - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityfan-control, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=fanControl.setDirectionon your hub
Input
{ deviceId: number; direction: FanDirectionSchema }Output
voidShapes: FanDirectionSchema
fanControl.setOscillating
- Kind: mutation —
POST /trpc/fanControl.setOscillating - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityfan-control, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=fanControl.setOscillatingon your hub
Input
{ deviceId: number; oscillating: boolean }Output
voidfanControl.setOscillationAxis
- Kind: mutation —
POST /trpc/fanControl.setOscillationAxis - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityfan-control, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=fanControl.setOscillationAxison your hub
Input
SetOscillationAxisInputSchemaOutput
FanOscillationAxisResultSchemaShapes: SetOscillationAxisInputSchema · FanOscillationAxisResultSchema