ReferenceHTTP API
daylightPhase
The daylightPhase router: 3 methods of the daylight-phase capability, with tier, scope, input and output.
Capability daylight-phase · scope system · mode singleton · source packages/types/src/capabilities/daylight-phase.cap.ts:34.
Every method is called at /trpc/daylightPhase.<method> — queries with GET, mutations with POST. See How to call and Authorization.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
getPhase | query | protected | view | no |
getSettings | query | protected | view | no |
setSettings | mutation | admin | admin only | no |
daylightPhase.getPhase
- Kind: query —
GET /trpc/daylightPhase.getPhase - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitydaylight-phase, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=daylightPhase.getPhaseon your hub
Input
{}Output
DaylightStatusSchemaShapes: DaylightStatusSchema
daylightPhase.getSettings
- Kind: query —
GET /trpc/daylightPhase.getSettings - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitydaylight-phase, or categorysystem - Viewer: no
- Try it: open
/system/api-explorer?method=daylightPhase.getSettingson your hub
Input
{}Output
{ source: "sun" } | { source: "sensor"; deviceId: number; cap: string; fieldPath: string; darkBelow: number; hysteresis: number; minDwellMin: number }daylightPhase.setSettings
- Kind: mutation —
POST /trpc/daylightPhase.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=daylightPhase.setSettingson your hub
Input
{ source: "sun" } | { source: "sensor"; deviceId: number; cap: string; fieldPath: string; darkBelow: number; hysteresis: number; minDwellMin: number }Output
DaylightStatusSchemaShapes: DaylightStatusSchema