ReferenceHTTP API
valve
The valve router: 5 methods of the valve capability, with tier, scope, input and output.
Capability valve · scope device · mode singleton · source packages/types/src/capabilities/valve.cap.ts:45.
Every method is called at /trpc/valve.<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 |
open | mutation | protected | create | yes |
close | mutation | protected | create | yes |
stop | mutation | protected | create | yes |
setPosition | mutation | protected | create | yes |
valve.getStatus
- Kind: query —
GET /trpc/valve.getStatus(added by the framework) - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilityvalve, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=valve.getStatuson your hub
Input
{ deviceId: number }Output
ValveStatusSchemaShapes: ValveStatusSchema
valve.open
- Kind: mutation —
POST /trpc/valve.open - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityvalve, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=valve.openon your hub
Input
{ deviceId: number }Output
voidvalve.close
- Kind: mutation —
POST /trpc/valve.close - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityvalve, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=valve.closeon your hub
Input
{ deviceId: number }Output
voidvalve.stop
- Kind: mutation —
POST /trpc/valve.stop - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityvalve, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=valve.stopon your hub
Input
{ deviceId: number }Output
voidvalve.setPosition
- Kind: mutation —
POST /trpc/valve.setPosition - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilityvalve, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=valve.setPositionon your hub
Input
{ deviceId: number; position: number }Output
void