Dominevo
ReferenceHTTP API

dayNight

The dayNight router: 3 methods of the day-night capability, with tier, scope, input and output.

Capability day-night · scope device · mode singleton · source packages/types/src/capabilities/day-night.cap.ts:84.

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

MethodKindTierToken scopeViewer
getStatusqueryprotectedviewyes
getOptionsqueryprotectedviewyes
setSettingsmutationadminadmin onlyno

dayNight.getStatus

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

Input

{ deviceId: number }

Output

DayNightStatusSchema

Shapes: DayNightStatusSchema

dayNight.getOptions

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

Input

{ deviceId: number }

Output

DayNightOptionsSchema

Shapes: DayNightOptionsSchema

dayNight.setSettings

  • Kind: mutation — POST /trpc/dayNight.setSettings
  • 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=dayNight.setSettings on your hub

Input

{ deviceId: number; settings: DayNightSettingsPatchSchema }

Output

void

Shapes: DayNightSettingsPatchSchema