Skip to content

Commit

Permalink
feat: add connected endpoint (#87)
Browse files Browse the repository at this point in the history
Co-authored-by: arc-alex <ac@omnivox.dk>
  • Loading branch information
alex-Arc and alex-Arc authored Sep 4, 2023
1 parent 0528e36 commit 2b40358
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ export class CompanionSatelliteClient extends EventEmitter<CompanionSatelliteCli
public get port(): number {
return this._port
}
public get connected(): boolean {
return this._connected
}

/**
* Until 2.4 of Companion it does not support rotary encoders.
Expand Down
3 changes: 3 additions & 0 deletions src/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export class RestServer {
this.router.get('/api/port', (ctx) => {
ctx.body = this.client.port
})
this.router.get('/api/connected', (ctx) => {
ctx.body = this.client.connected
})
this.router.get('/api/config', (ctx) => {
ctx.body = { host: this.client.host, port: this.client.port }
})
Expand Down

0 comments on commit 2b40358

Please sign in to comment.