Dominevo
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.

MethodKindTierToken scopeViewer
getStatusqueryprotectedviewyes
openmutationprotectedcreateyes
closemutationprotectedcreateyes
stopmutationprotectedcreateyes
setPositionmutationprotectedcreateyes

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: view on capability valve, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=valve.getStatus on your hub

Input

{ deviceId: number }

Output

ValveStatusSchema

Shapes: ValveStatusSchema

valve.open

  • Kind: mutation — POST /trpc/valve.open
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability valve, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=valve.open on your hub

Input

{ deviceId: number }

Output

void

valve.close

  • Kind: mutation — POST /trpc/valve.close
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability valve, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=valve.close on your hub

Input

{ deviceId: number }

Output

void

valve.stop

  • Kind: mutation — POST /trpc/valve.stop
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability valve, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=valve.stop on your hub

Input

{ deviceId: number }

Output

void

valve.setPosition

  • Kind: mutation — POST /trpc/valve.setPosition
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: create on capability valve, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=valve.setPosition on your hub

Input

{ deviceId: number; position: number }

Output

void