Dominevo
ReferenceHTTP API

control

The control router: 6 methods of the control capability, with tier, scope, input and output.

Capability control · scope device · mode singleton · source packages/types/src/capabilities/control.cap.ts:104.

Every method is called at /trpc/control.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.

MethodKindTierToken scopeViewer
getStatusqueryprotectedviewyes
setValuemutationprotectedcreateyes
nextmutationprotectedcreateyes
previousmutationprotectedcreateyes
firstmutationprotectedcreateyes
lastmutationprotectedcreateyes

control.getStatus

  • Kind: query — GET /trpc/control.getStatus (added by the framework)
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability control, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=control.getStatus on your hub

Input

{ deviceId: number }

Output

ControlStatusSchema

Shapes: ControlStatusSchema

control.setValue

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

Input

{ deviceId: number; control: { kind: "numeric"; value: number } | { kind: "select"; value: string } | { kind: "text"; value: string } | { kind: "datetime"; value: string } }

Output

void

control.next

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

Input

{ deviceId: number; cycle?: boolean = true }

Output

void

control.previous

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

Input

{ deviceId: number; cycle?: boolean = true }

Output

void

control.first

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

Input

{ deviceId: number }

Output

void

control.last

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

Input

{ deviceId: number }

Output

void