Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Commit

Permalink
feat: new device type interface
Browse files Browse the repository at this point in the history
  • Loading branch information
nytamin committed May 3, 2019
1 parent e099f99 commit ef6fc5f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"dependencies": {
"mos-connection": "^0.8.1",
"tslib": "^1.9.3",
"tv-automation-server-core-integration": "1.0.0",
"tv-automation-server-core-integration": "1.1.0",
"underscore": "^1.9.1",
"winston": "^2.4.2"
}
Expand Down
16 changes: 12 additions & 4 deletions src/coreHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,10 @@ export class CoreHandler {
})
}
getCoreConnectionOptions (name: string, subDeviceId: string, parentProcess: boolean): CoreOptions {
let credentials
let credentials: {
deviceId: string
deviceToken: string
}

if (this._deviceOptions.deviceId && this._deviceOptions.deviceToken) {
credentials = {
Expand All @@ -482,11 +485,16 @@ export class CoreHandler {
} else {
credentials = CoreConnection.getCredentials(subDeviceId)
}
let options: CoreOptions = _.extend(credentials, {
deviceType: (parentProcess ? P.DeviceType.MOSDEVICE : P.DeviceType.OTHER),
let options: CoreOptions = {
...credentials,

deviceCategory: P.DeviceCategory.INGEST,
deviceType: P.DeviceType.MOS,
deviceSubType: (parentProcess ? 'mos_connection' : P.SUBTYPE_PROCESS),

deviceName: name,
watchDog: (this._coreConfig ? this._coreConfig.watchdog : true)
})
}
if (parentProcess) options.versions = this._getVersions()
return options
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5268,10 +5268,10 @@ tunnel-agent@^0.6.0:
dependencies:
safe-buffer "^5.0.1"

tv-automation-server-core-integration@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/tv-automation-server-core-integration/-/tv-automation-server-core-integration-1.0.0.tgz#0d9f2738f8f6153f20956e0d6d6e9748ff664bb3"
integrity sha512-UAFjZDakfzMK05WsXn+poP7ApRaIomfUCT3x1GZoAyMRWpBfrdhTvQpA80351I7tCiV5+8ioF3AjMWEg3y/IIQ==
tv-automation-server-core-integration@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/tv-automation-server-core-integration/-/tv-automation-server-core-integration-1.1.0.tgz#2aa00ebdbc478234ffd65a85ff7c32378902b65e"
integrity sha512-xM+YOKXgWs3iEBHKycfIu7sO8KhJ4djyanRr06OG/VpBBR+Ah2gkDxNdJWnWgKvsoc52M8lMdCAwx8FJow7Cdg==
dependencies:
data-store "3.1.0"
ddp "git+http://github.com/nytamin/node-ddp-client.git#v0.12.2-next2"
Expand Down

0 comments on commit ef6fc5f

Please sign in to comment.