Skip to main content
Version: 0.6.0-alpha.2

Device Module


Version 0.6.0

OpenRPC

This document was generated from an OpenRPC JSON-Schema, and is intended to provide a human readable overview and examples of the methods contained in the module.

For the full schema, see the link below.

Schema
device.json

Table of Contents

Usage

To use the Device module, you can import it into your project from the Firebolt SDK:

import { Device } from '@firebolt-js/sdk'

Overview

A module for querying about the device and it's capabilities.

Events

deviceNameChanged

Get the human readable name of the device

// listen to deviceNameChanged
Device.listen('deviceNameChanged', (data: string) => void): Promise<bigint>

// listen to deviceNameChanged once
Device.once('deviceNameChanged', (data: string) => void): Promise<bigint>

// clear a listener
Device.clear(listenerId?: bigint): void

Event value

TypeDescription
stringthe device friendly-name

Promise Resolution

TypeDescription
bigintListener ID to clear() the callback method and stop receiving the event, e.g. Device.clear(id)

Examples

Getting the device name
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.listen('deviceNameChanged', value => {
console.log(value)
})

Value of value

"Living Room"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.onDeviceNameChanged",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "Living Room"
}
Listen to an event only once
JavaScript
Device.listen('deviceNameChanged', (value) => {
console.log(value)
}).then( (listenerId) => {
Device.clear(listenerId)
})

Alternately, simply call once():

Device.once('deviceNameChanged', (value) => {
console.log(value)
})
Clear all listeners for an event
JavaScript
Device.clear('deviceNameChanged')

Methods

id

Get the platform back-office device identifier

To get the property value, use id():

function id(): Promise<string>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
stringthe id

Examples

Default Example
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.id()
.then(id => {
console.log(id)
})

Value of value

"123"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.id",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "123"
}

distributor

Get the distributor ID for this device

To get the property value, use distributor():

function distributor(): Promise<string>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
stringthe distributor ID

Examples

Getting the distributor ID
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.distributor()
.then(distributorId => {
console.log(distributorId)
})

Value of value

"Company"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.distributor",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "Company"
}

platform

Get the platform ID for this device

To get the property value, use platform():

function platform(): Promise<string>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
stringthe platform ID

Examples

Getting the platform ID
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.platform()
.then(platformId => {
console.log(platformId)
})

Value of value

"WPE"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.platform",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "WPE"
}

uid

Gets a unique id for the current app & device

To get the property value, use uid():

function uid(): Promise<string>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
stringa unique ID

Examples

Getting the unique ID
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.uid()
.then(uniqueId => {
console.log(uniqueId)
})

Value of value

"ee6723b8-7ab3-462c-8d93-dbf61227998e"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.uid",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "ee6723b8-7ab3-462c-8d93-dbf61227998e"
}

type

Get the device type

To get the property value, use type():

function type(): Promise<string>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
stringthe device type

Examples

Getting the device type
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.type()
.then(deviceType => {
console.log(deviceType)
})

Value of value

"STB"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.type",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "STB"
}

model

Get the device model

To get the property value, use model():

function model(): Promise<string>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
stringthe device model

Examples

Getting the device model
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.model()
.then(model => {
console.log(model)
})

Value of value

"xi6"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.model",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "xi6"
}

sku

Get the device sku

To get the property value, use sku():

function sku(): Promise<string>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
stringthe device sku

Examples

Getting the device sku
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.sku()
.then(sku => {
console.log(sku)
})

Value of value

"AX061AEI"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.sku",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "AX061AEI"
}

make

Get the device make

To get the property value, use make():

function make(): Promise<string>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
stringthe device make

Examples

Getting the device make
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.make()
.then(make => {
console.log(make)
})

Value of value

"Arris"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.make",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "Arris"
}

version

Get the SDK, OS and other version info

To get the property value, use version():

function version(): Promise<object>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
objectthe versions

Examples

Getting the os and sdk versions
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.version()
.then(versions => {
console.log(versions)
})

Value of value

{
"sdk": {
"major": 0,
"minor": 5,
"patch": 0,
"readable": "Firebolt JS SDK v0.5.0"
},
"os": {
"major": 0,
"minor": 1,
"patch": 0,
"readable": "Firebolt OS v0.1.0"
},
"debug": ""
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.version",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"sdk": {
"major": 0,
"minor": 5,
"patch": 0,
"readable": "Firebolt JS SDK v0.5.0"
},
"os": {
"major": 0,
"minor": 1,
"patch": 0,
"readable": "Firebolt OS v0.1.0"
},
"debug": ""
}
}

hdcp

Get the supported HDCP profiles

To get the property value, use hdcp():

function hdcp(): Promise<BooleanMap>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
BooleanMapthe supported HDCP profiles

Examples

Getting the supported HDCP profiles
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.hdcp()
.then(supportedHdcpProfiles => {
console.log(supportedHdcpProfiles)
})

Value of value

{
"hdcp1.4": true,
"hdcp2.2": true
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.hdcp",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hdcp1.4": true,
"hdcp2.2": true
}
}

To subscribe to the property value, use hdcp(value => { }):

function hdcp(callback: (supportedHdcpProfiles: BooleanMap) => any): Promise<boolean>

Parameters

ParamTypeRequiredSummary
callbackfunctionYesA callback that gets invoked when the value for hdcp changes

Promise Resolution

TypeSummary
listenerIdThe id of the listener that can be used with Device.clear(listenerId) to unsubscribe

Callback Parameters

ParamTypeRequiredSummary
supportedHdcpProfilesBooleanMaptruethe supported HDCP profiles

Examples

Getting the supported HDCP profiles
JavaScript
Device.hdcp(value => {
console.log(value)
}).then(response => {
console.log(response)
})

Value of response

{}

Value of value

{
"hdcp1.4": true,
"hdcp2.2": true
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.onHdcpChanged",
"params": {
"listen": true
}
}
Response
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"listening": "true"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hdcp1.4": true,
"hdcp2.2": true
}
}

hdr

Get the supported HDR profiles

To get the property value, use hdr():

function hdr(): Promise<BooleanMap>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
BooleanMapthe supported HDR profiles

Examples

Getting the supported HDR profiles
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.hdr()
.then(supportedHdrProfiles => {
console.log(supportedHdrProfiles)
})

Value of value

{
"hdr10": true,
"hdr10Plus": true,
"dolbyVision": true,
"hlg": true
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.hdr",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hdr10": true,
"hdr10Plus": true,
"dolbyVision": true,
"hlg": true
}
}

To subscribe to the property value, use hdr(value => { }):

function hdr(callback: (supportedHdrProfiles: BooleanMap) => any): Promise<boolean>

Parameters

ParamTypeRequiredSummary
callbackfunctionYesA callback that gets invoked when the value for hdr changes

Promise Resolution

TypeSummary
listenerIdThe id of the listener that can be used with Device.clear(listenerId) to unsubscribe

Callback Parameters

ParamTypeRequiredSummary
supportedHdrProfilesBooleanMaptruethe supported HDR profiles

Examples

Getting the supported HDR profiles
JavaScript
Device.hdr(value => {
console.log(value)
}).then(response => {
console.log(response)
})

Value of response

{}

Value of value

{
"hdr10": true,
"hdr10Plus": true,
"dolbyVision": true,
"hlg": true
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.onHdrChanged",
"params": {
"listen": true
}
}
Response
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"listening": "true"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hdr10": true,
"hdr10Plus": true,
"dolbyVision": true,
"hlg": true
}
}

audio

Get the supported audio profiles

To get the property value, use audio():

function audio(): Promise<AudioProfiles>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
AudioProfilesthe supported audio profiles

Examples

Getting the supported audio profiles
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.audio()
.then(supportedAudioProfiles => {
console.log(supportedAudioProfiles)
})

Value of value

{
"stereo": true,
"dolbyDigital5.1": true,
"dolbyDigital5.1+": true,
"dolbyAtmos": true
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.audio",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"stereo": true,
"dolbyDigital5.1": true,
"dolbyDigital5.1+": true,
"dolbyAtmos": true
}
}

To subscribe to the property value, use audio(value => { }):

function audio(callback: (supportedAudioProfiles: AudioProfiles) => any): Promise<boolean>

Parameters

ParamTypeRequiredSummary
callbackfunctionYesA callback that gets invoked when the value for audio changes

Promise Resolution

TypeSummary
listenerIdThe id of the listener that can be used with Device.clear(listenerId) to unsubscribe

Callback Parameters

ParamTypeRequiredSummary
supportedAudioProfilesAudioProfilestruethe supported audio profiles

Examples

Getting the supported audio profiles
JavaScript
Device.audio(value => {
console.log(value)
}).then(response => {
console.log(response)
})

Value of response

{}

Value of value

{
"stereo": true,
"dolbyDigital5.1": true,
"dolbyDigital5.1+": true,
"dolbyAtmos": true
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.onAudioChanged",
"params": {
"listen": true
}
}
Response
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"listening": "true"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"stereo": true,
"dolbyDigital5.1": true,
"dolbyDigital5.1+": true,
"dolbyAtmos": true
}
}

screenResolution

Get the current screen resolution

To get the property value, use screenResolution():

function screenResolution(): Promise<[bigint, bigint]>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
[bigint, bigint]the resolution

Examples

Getting the screen resolution
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.screenResolution()
.then(screenResolution => {
console.log(screenResolution)
})

Value of value

[
1920,
1080
]
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.screenResolution",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
1920,
1080
]
}

To subscribe to the property value, use screenResolution(value => { }):

function screenResolution(callback: (screenResolution: [bigint, bigint]) => any): Promise<boolean>

Parameters

ParamTypeRequiredSummary
callbackfunctionYesA callback that gets invoked when the value for screenResolution changes

Promise Resolution

TypeSummary
listenerIdThe id of the listener that can be used with Device.clear(listenerId) to unsubscribe

Callback Parameters

ParamTypeRequiredSummary
screenResolution[bigint, bigint]truethe resolution

Examples

Getting the screen resolution
JavaScript
Device.screenResolution(value => {
console.log(value)
}).then(response => {
console.log(response)
})

Value of response

{}

Value of value

[
1920,
1080
]
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.onScreenResolutionChanged",
"params": {
"listen": true
}
}
Response
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"listening": "true"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": [
1920,
1080
]
}

videoResolution

Get the current video resolution

To get the property value, use videoResolution():

function videoResolution(): Promise<[bigint, bigint]>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
[bigint, bigint]the resolution

Examples

Getting the video resolution
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.videoResolution()
.then(videoResolution => {
console.log(videoResolution)
})

Value of value

[
1920,
1080
]
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.videoResolution",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
1920,
1080
]
}

To subscribe to the property value, use videoResolution(value => { }):

function videoResolution(callback: (videoResolution: [bigint, bigint]) => any): Promise<boolean>

Parameters

ParamTypeRequiredSummary
callbackfunctionYesA callback that gets invoked when the value for videoResolution changes

Promise Resolution

TypeSummary
listenerIdThe id of the listener that can be used with Device.clear(listenerId) to unsubscribe

Callback Parameters

ParamTypeRequiredSummary
videoResolution[bigint, bigint]truethe resolution

Examples

Getting the video resolution
JavaScript
Device.videoResolution(value => {
console.log(value)
}).then(response => {
console.log(response)
})

Value of response

{}

Value of value

[
1920,
1080
]
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.onVideoResolutionChanged",
"params": {
"listen": true
}
}
Response
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"listening": "true"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": [
1920,
1080
]
}

name

The human readable name of the device

To get the property value, use name():

function name(): Promise<string>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
stringthe device friendly-name

Examples

Example value for device name
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.name()
.then(value => {
console.log(value)
})

Value of value

"Living Room"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.name",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "Living Room"
}

To subscribe to the property value, use name(value => { }):

function name(callback: (value: string) => any): Promise<boolean>

Parameters

ParamTypeRequiredSummary
callbackfunctionYesA callback that gets invoked when the value for name changes

Promise Resolution

TypeSummary
listenerIdThe id of the listener that can be used with Device.clear(listenerId) to unsubscribe

Callback Parameters

ParamTypeRequiredSummary
valuestringtruethe device friendly-name

Examples

Example value for device name
JavaScript
Device.name(value => {
console.log(value)
}).then(response => {
console.log(response)
})

Value of response

{}

Value of value

"Living Room"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.onNameChanged",
"params": {
"listen": true
}
}
Response
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"listening": "true"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": "Living Room"
}

network

Get the current network status and type

To get the property value, use network():

function network(): Promise<object>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
objectthe status and type

Examples

Getting the network info
JavaScript
import { Device } from '@firebolt-js/sdk'

Device.network()
.then(networkInfo => {
console.log(networkInfo)
})

Value of value

{
"state": "connected",
"type": "wifi"
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.network",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"state": "connected",
"type": "wifi"
}
}

To subscribe to the property value, use network(value => { }):

function network(callback: (networkInfo: object) => any): Promise<boolean>

Parameters

ParamTypeRequiredSummary
callbackfunctionYesA callback that gets invoked when the value for network changes

Promise Resolution

TypeSummary
listenerIdThe id of the listener that can be used with Device.clear(listenerId) to unsubscribe

Callback Parameters

ParamTypeRequiredSummary
networkInfoobjecttruethe status and type

Examples

Getting the network info
JavaScript
Device.network(value => {
console.log(value)
}).then(response => {
console.log(response)
})

Value of response

{}

Value of value

{
"state": "connected",
"type": "wifi"
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "device.onNetworkChanged",
"params": {
"listen": true
}
}
Response
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"listening": "true"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"state": "connected",
"type": "wifi"
}
}

Schemas

Resolution

type Resolution = [bigint, bigint]

NetworkType

type NetworkType = 'wifi' | 'ethernet' | 'hybrid'

Details

The type of network that is currently active


NetworkState

type NetworkState = 'connected' | 'disconnected'

Details

The type of network that is currently active


AudioProfiles

type AudioProfiles = {
}

See also:


AudioProfile

type AudioProfile;

See also: