--- title: "Device" slug: "081-core-device" updated: 2025-05-23T22:33:05Z published: 2025-05-23T22:33:05Z canonical: "docs.developer.comcast.com/081-core-device" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.developer.comcast.com/llms.txt > Use this file to discover all available pages before exploring further. # Device **Device Module 0.8.1 | Core SDK** ## Overview A module for querying about the device and it's capabilities. ## OpenRPC Firebolt APIs are maintained in the [rdkcentral/firebolt-core-sdk](https://github.com/rdkcentral/firebolt-core-sdk) GitHub repository. You can see this API in the [device.json](https://github.com/rdkcentral/firebolt-core-sdk/blob/main/src/modules/device.json) OpenRPC JSON-Schema document. ## Table of Contents - [Device Module](/docs/081-core-device#device-module) - [Overview](/docs/081-core-device#overview) - [OpenRPC](/docs/081-core-device#openrpc) - [Table of Contents](/docs/081-core-device#table-of-contents) - [Usage](/docs/081-core-device#usage) - [Methods](/docs/081-core-device#methods) - [audio](/docs/081-core-device#audio) - [distributor](/docs/081-core-device#distributor) - [hdcp](/docs/081-core-device#hdcp) - [hdr](/docs/081-core-device#hdr) - [id](/docs/081-core-device#id) - [listen](/docs/081-core-device#listen) - [make](/docs/081-core-device#make) - [model](/docs/081-core-device#model) - [name](/docs/081-core-device#name) - [network](/docs/081-core-device#network) - [once](/docs/081-core-device#once) - [platform](/docs/081-core-device#platform) - [screenResolution](/docs/081-core-device#screenresolution) - [sku](/docs/081-core-device#sku) - [type](/docs/081-core-device#type) - [uid](/docs/081-core-device#uid) - [version](/docs/081-core-device#version) - [videoResolution](/docs/081-core-device#videoresolution) - [Events](/docs/081-core-device#events) - [deviceNameChanged](/docs/081-core-device#devicenamechanged) - [Additional events](/docs/081-core-device#additional-events) - [Schemas](/docs/081-core-device#schemas) - [Resolution](/docs/081-core-device#resolution) - [NetworkType](/docs/081-core-device#networktype) - [NetworkState](/docs/081-core-device#networkstate) - [AudioProfiles](/docs/081-core-device#audioprofiles) ## Usage To use the Device module, you can import it into your project from the Firebolt SDK: ``` import { Device } from '@firebolt-js/sdk' ``` ## Methods ### audio Get the supported audio profiles To get the value, call the method with no parameters: ``` function audio(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | [`AudioProfiles`](/docs/081-core-device#audioprofiles) | the 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 `supportedAudioProfiles`: ``` { "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 notifications when the value changes, pass a function as the only parameter: ``` function audio(subscriber: (supportedAudioProfiles: AudioProfiles) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `subscriber` | `Function` | Yes | A callback that gets invoked when the value for audio changes | Promise resolution: | Type | Summary | | --- | --- | | `listenerId` | The id of the listener that can be used with Device.clear(listenerId) to unsubscribe | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `supportedAudioProfiles` | [`AudioProfiles`](/docs/081-core-device#audioprofiles) | Yes | the supported audio profiles | **Examples** Getting the supported audio profiles JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.audio(supportedAudioProfiles => { // property value was changed console.log(supportedAudioProfiles) }).then(listenerId => { // you can clear this listener w/ Device.clear(listenerId) }) ``` value of `supportedAudioProfiles`: ``` { "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 } } ``` --- ### distributor Get the distributor ID for this device To get the value, call the method with no parameters: ``` function distributor(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | `string` | the distributor ID | **Examples** Getting the distributor ID JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.distributor() .then(distributorId => { console.log(distributorId) }) ``` Value of `distributorId`: ``` "Company" ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "device.distributor", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "Company" } ``` ### hdcp Get the supported HDCP profiles To get the value, call the method with no parameters: ``` function hdcp(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | [`BooleanMap`](/docs/081-core-Types-schemas#booleanmap) | the 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 `supportedHdcpProfiles`: ``` { "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 notifications when the value changes, pass a function as the only parameter: ``` function hdcp(subscriber: (supportedHdcpProfiles: BooleanMap) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `subscriber` | `Function` | Yes | A callback that gets invoked when the value for hdcp changes | Promise resolution: | Type | Summary | | --- | --- | | `listenerId` | The id of the listener that can be used with Device.clear(listenerId) to unsubscribe | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `supportedHdcpProfiles` | [`BooleanMap`](/docs/081-core-Types-schemas#booleanmap) | Yes | the supported HDCP profiles | **Examples** Getting the supported HDCP profiles JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.hdcp(supportedHdcpProfiles => { // property value was changed console.log(supportedHdcpProfiles) }).then(listenerId => { // you can clear this listener w/ Device.clear(listenerId) }) ``` value of `supportedHdcpProfiles`: ``` { "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 value, call the method with no parameters: ``` function hdr(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | [`BooleanMap`](/docs/081-core-Types-schemas#booleanmap) | the 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 `supportedHdrProfiles`: ``` { "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 notifications when the value changes, pass a function as the only parameter: ``` function hdr(subscriber: (supportedHdrProfiles: BooleanMap) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `subscriber` | `Function` | Yes | A callback that gets invoked when the value for hdr changes | Promise resolution: | Type | Summary | | --- | --- | | `listenerId` | The id of the listener that can be used with Device.clear(listenerId) to unsubscribe | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `supportedHdrProfiles` | [`BooleanMap`](/docs/081-core-Types-schemas#booleanmap) | Yes | the supported HDR profiles | **Examples** Getting the supported HDR profiles JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.hdr(supportedHdrProfiles => { // property value was changed console.log(supportedHdrProfiles) }).then(listenerId => { // you can clear this listener w/ Device.clear(listenerId) }) ``` value of `supportedHdrProfiles`: ``` { "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 } } ``` --- ### id Get the platform back-office device identifier To get the value, call the method with no parameters: ``` function id(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | `string` | the id | **Examples** Default Example JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.id() .then(id => { console.log(id) }) ``` Value of `id`: ``` "123" ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "device.id", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "123" } ``` ### listen Listen for events from this module. To listen to a specific event pass the event name as the first parameter: ``` Device.listen(event: string, (data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event to listen for, see [Events](/docs/081-core-device#events). | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Device.clear(id)` | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/081-core-device#events). | To listen to all events from this module pass only a callback, without specifying an event name: ``` Device.listen((event: string, data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. The event data depends on which event is firing, see [Events](/docs/081-core-device#events). | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event that has occured listen for, see [Events](/docs/081-core-device#events). | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/081-core-device#events). | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Device.clear(id)` | See [Listening for events](/docs/listening-for-events/) for more information and examples. --- ### make Get the device make To get the value, call the method with no parameters: ``` function make(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | `string` | the device make | **Examples** Getting the device make JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.make() .then(make => { console.log(make) }) ``` Value of `make`: ``` "Arris" ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "device.make", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "Arris" } ``` ### model Get the device model To get the value, call the method with no parameters: ``` function model(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | `string` | the device model | **Examples** Getting the device model JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.model() .then(model => { console.log(model) }) ``` Value of `model`: ``` "xi6" ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "device.model", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "xi6" } ``` ### name The human readable name of the device To get the value, call the method with no parameters: ``` function name(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | `string` | the 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 notifications when the value changes, pass a function as the only parameter: ``` function name(subscriber: (value: string) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `subscriber` | `Function` | Yes | A callback that gets invoked when the value for name changes | Promise resolution: | Type | Summary | | --- | --- | | `listenerId` | The id of the listener that can be used with Device.clear(listenerId) to unsubscribe | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `value` | `string` | Yes | the device friendly-name | **Examples** Example value for device name JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.name(value => { // property value was changed console.log(value) }).then(listenerId => { // you can clear this listener w/ Device.clear(listenerId) }) ``` 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 value, call the method with no parameters: ``` function network(): Promise ``` Promise resolution: the status and type | Field | Type | Description | | --- | --- | --- | | `state` | [`NetworkState`](/docs/081-core-device#networkstate) | | | `type` | [`NetworkType`](/docs/081-core-device#networktype) | | **Examples** Getting the network info JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.network() .then(networkInfo => { console.log(networkInfo) }) ``` Value of `networkInfo`: ``` { "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 notifications when the value changes, pass a function as the only parameter: ``` function network(subscriber: (networkInfo: object) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `subscriber` | `Function` | Yes | A callback that gets invoked when the value for network changes | Promise resolution: | Type | Summary | | --- | --- | | `listenerId` | The id of the listener that can be used with Device.clear(listenerId) to unsubscribe | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `networkInfo` | `object` | Yes | the status and type | **Examples** Getting the network info JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.network(networkInfo => { // property value was changed console.log(networkInfo) }).then(listenerId => { // you can clear this listener w/ Device.clear(listenerId) }) ``` value of `networkInfo`: ``` { "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" } } ``` --- ### once Listen for only one occurance of an event from this module. The callback will be cleared after one event. To listen to a specific event pass the event name as the first parameter: ``` Device.once(event: string, (data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event to listen for, see [Events](/docs/081-core-device#events). | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Device.clear(id)` | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/081-core-device#events). | To listen to all events from this module pass only a callback, without specifying an event name: ``` Device.once((event: string, data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. The event data depends on which event is firing, see [Events](/docs/081-core-device#events). | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event that has occured listen for, see [Events](/docs/081-core-device#events). | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/081-core-device#events). | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Device.clear(id)` | See [Listening for events](/docs/listening-for-events/) for more information and examples. --- ### platform Get the platform ID for this device To get the value, call the method with no parameters: ``` function platform(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | `string` | the platform ID | **Examples** Getting the platform ID JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.platform() .then(platformId => { console.log(platformId) }) ``` Value of `platformId`: ``` "WPE" ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "device.platform", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "WPE" } ``` ### screenResolution Get the current screen resolution To get the value, call the method with no parameters: ``` function screenResolution(): Promise<[number, number]> ``` Promise resolution: | Type | Description | | --- | --- | | `[number, number]` | the resolution | **Examples** Getting the screen resolution JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.screenResolution() .then(screenResolution => { console.log(screenResolution) }) ``` Value of `screenResolution`: ``` [ 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 notifications when the value changes, pass a function as the only parameter: ``` function screenResolution(subscriber: (screenResolution: [number, number]) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `subscriber` | `Function` | Yes | A callback that gets invoked when the value for screenResolution changes | Promise resolution: | Type | Summary | | --- | --- | | `listenerId` | The id of the listener that can be used with Device.clear(listenerId) to unsubscribe | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `screenResolution` | `[number, number]` | Yes | the resolution | **Examples** Getting the screen resolution JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.screenResolution(screenResolution => { // property value was changed console.log(screenResolution) }).then(listenerId => { // you can clear this listener w/ Device.clear(listenerId) }) ``` value of `screenResolution`: ``` [ 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 ] } ``` --- ### sku Get the device sku To get the value, call the method with no parameters: ``` function sku(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | `string` | the device sku | **Examples** Getting the device sku JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.sku() .then(sku => { console.log(sku) }) ``` Value of `sku`: ``` "AX061AEI" ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "device.sku", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "AX061AEI" } ``` ### type Get the device type To get the value, call the method with no parameters: ``` function type(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | `string` | the device type | **Examples** Getting the device type JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.type() .then(deviceType => { console.log(deviceType) }) ``` Value of `deviceType`: ``` "STB" ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "device.type", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "STB" } ``` ### uid Gets a unique id for the current app & device To get the value, call the method with no parameters: ``` function uid(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | `string` | a unique ID | **Examples** Getting the unique ID JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.uid() .then(uniqueId => { console.log(uniqueId) }) ``` Value of `uniqueId`: ``` "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" } ``` ### version Get the SDK, OS and other version info To get the value, call the method with no parameters: ``` function version(): Promise ``` Promise resolution: the versions | Field | Type | Description | | --- | --- | --- | | `sdk` | [`SemanticVersion`](/docs/081-core-Types-schemas#semanticversion) | The Firebolt SDK version | | `api` | [`SemanticVersion`](/docs/081-core-Types-schemas#semanticversion) | The lateset Firebolt API vresion supported by the curent device. | | `firmware` | [`SemanticVersion`](/docs/081-core-Types-schemas#semanticversion) | The device firmware version. | | `os` | [`SemanticVersion`](/docs/081-core-Types-schemas#semanticversion) | **Deprecated** | | `debug` | `string` | Detail version as a string, for debugging purposes | **Examples** Getting the os and sdk versions JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.version() .then(versions => { console.log(versions) }) ``` Value of `versions`: ``` { "sdk": { "major": 0, "minor": 8, "patch": 0, "readable": "Firebolt JS SDK v0.8.0" }, "api": { "major": 0, "minor": 8, "patch": 0, "readable": "Firebolt API v0.8.0" }, "firmware": { "major": 1, "minor": 2, "patch": 3, "readable": "Device Firmware v1.2.3" }, "os": { "major": 0, "minor": 1, "patch": 0, "readable": "Firebolt OS v0.1.0" }, "debug": "Non-parsable build info for error logging only." } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "device.version", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": { "sdk": { "major": 0, "minor": 8, "patch": 0, "readable": "Firebolt JS SDK v0.8.0" }, "api": { "major": 0, "minor": 8, "patch": 0, "readable": "Firebolt API v0.8.0" }, "firmware": { "major": 1, "minor": 2, "patch": 3, "readable": "Device Firmware v1.2.3" }, "os": { "major": 0, "minor": 1, "patch": 0, "readable": "Firebolt OS v0.1.0" }, "debug": "Non-parsable build info for error logging only." } } ``` ### videoResolution Get the current video resolution To get the value, call the method with no parameters: ``` function videoResolution(): Promise<[number, number]> ``` Promise resolution: | Type | Description | | --- | --- | | `[number, number]` | the resolution | **Examples** Getting the video resolution JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.videoResolution() .then(videoResolution => { console.log(videoResolution) }) ``` Value of `videoResolution`: ``` [ 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 notifications when the value changes, pass a function as the only parameter: ``` function videoResolution(subscriber: (videoResolution: [number, number]) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `subscriber` | `Function` | Yes | A callback that gets invoked when the value for videoResolution changes | Promise resolution: | Type | Summary | | --- | --- | | `listenerId` | The id of the listener that can be used with Device.clear(listenerId) to unsubscribe | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `videoResolution` | `[number, number]` | Yes | the resolution | **Examples** Getting the video resolution JavaScript: ``` import { Device } from '@firebolt-js/sdk' Device.videoResolution(videoResolution => { // property value was changed console.log(videoResolution) }).then(listenerId => { // you can clear this listener w/ Device.clear(listenerId) }) ``` value of `videoResolution`: ``` [ 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 ] } ``` --- ## Events ### deviceNameChanged This API is **deprecated** since version 0.6.0. Use `Device.name()` instead. Get the human readable name of the device See also: [listen()](/docs/081-core-device#listen), [once()](/docs/081-core-device#listen), [clear()](/docs/081-core-device#listen). Event value: | Type | Description | | --- | --- | | `string` | the device friendly-name | **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" } ``` --- ### Additional events The following events are documented as part of a related set of method APIs. For more information, follow the links under the "Documentation" column. | JavaScript | RPC | Payload | Documentation | | --- | --- | --- | --- | | hdcpChanged | onHdcpChanged | [BooleanMap](/docs/081-core-Types-schemas#booleanmap) | [hdcp](/docs/081-core-device#hdcp) | | hdrChanged | onHdrChanged | [BooleanMap](/docs/081-core-Types-schemas#booleanmap) | [hdr](/docs/081-core-device#hdr) | | audioChanged | onAudioChanged | [AudioProfiles](/docs/081-core-device#audioprofiles) | [audio](/docs/081-core-device#audio) | | screenResolutionChanged | onScreenResolutionChanged | [number, number] | [screenResolution](/docs/081-core-device#screenresolution) | | videoResolutionChanged | onVideoResolutionChanged | [number, number] | [videoResolution](/docs/081-core-device#videoresolution) | | nameChanged | onNameChanged | string | [name](/docs/081-core-device#name) | | networkChanged | onNetworkChanged | object | [network](/docs/081-core-device#network) | ## Schemas ### Resolution ``` type Resolution = [number, number] ``` --- ### NetworkType The type of network that is currently active ``` type NetworkType = 'wifi' | 'ethernet' | 'hybrid' ``` --- ### NetworkState The type of network that is currently active ``` type NetworkState = 'connected' | 'disconnected' ``` --- ### AudioProfiles ``` type AudioProfiles = { stereo: boolean "dolbyDigital5.1": boolean "dolbyDigital7.1": boolean "dolbyDigital5.1+": boolean "dolbyDigital7.1+": boolean dolbyAtmos: boolean } ``` See also: - [BooleanMap](/docs/081-core-Types-schemas#booleanmap) - [AudioProfile](/docs/081-core-Types-schemas#audioprofile) ---