ReferenceHTTP API
powerSource
The powerSource router: 4 methods of the power-source capability, with tier, scope, input and output.
Capability power-source · scope device · mode singleton · source packages/types/src/capabilities/power-source.cap.ts:183.
Every method is called at /trpc/powerSource.<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 |
powerOn | mutation | protected | create | yes |
powerOff | mutation | protected | create | yes |
forceRestart | mutation | protected | create | yes |
powerSource.getStatus
- Kind: query —
GET /trpc/powerSource.getStatus - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitypower-source, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=powerSource.getStatuson your hub
Input
{ deviceId: number }Output
PowerSourceInfoSchemaShapes: PowerSourceInfoSchema
powerSource.powerOn
- Kind: mutation —
POST /trpc/powerSource.powerOn - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilitypower-source, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=powerSource.powerOnon your hub
Input
{ deviceId: number }Output
PowerSourceActionResultSchemaShapes: PowerSourceActionResultSchema
powerSource.powerOff
- Kind: mutation —
POST /trpc/powerSource.powerOff - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilitypower-source, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=powerSource.powerOffon your hub
Input
{ deviceId: number }Output
PowerSourceActionResultSchemaShapes: PowerSourceActionResultSchema
powerSource.forceRestart
- Kind: mutation —
POST /trpc/powerSource.forceRestart - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
createon capabilitypower-source, or categorydevice, or a device grant coveringdeviceId - Viewer: yes
- Try it: open
/system/api-explorer?method=powerSource.forceRestarton your hub
Input
{ deviceId: number }Output
PowerSourceActionResultSchemaShapes: PowerSourceActionResultSchema