How to know about LG WebOS TV version?

881 Views Asked by At

I set up a webOS TV project in my local system, how to identify which webOS version I am installed or using.

2

There are 2 best solutions below

0
Devin Chandrapala On

You can use this Luna Service API to get device information, which will contain the webOS version in its response.

luna://com.webos.service.tv.systemproperty

From the docs:

You can check your TV version on the following TV menu: Settings menu > General > TV Information > webOS TV version

You can also check your TV version using the following Luna API: sdkVersion parameter in the getSystemInfo() method

var request = webOS.service.request("luna://com.webos.service.tv.systemproperty", {
    method: "getSystemInfo",
    parameters: { 
        "keys": ["modelName", "firmwareVersion", "UHD", "sdkVersion"]
    },
    onComplete: function (inResponse) {
        var isSucceeded = inResponse.returnValue;
 
        if (isSucceeded){
            console.log("Result: " + JSON.stringify(inResponse));
            // To-Do something
        } else {
            console.log("Failed to get TV device information");
            // To-Do something
            return;
        }
    }
});

The sdkVersion parameter contains the webOS version - Example: "1.3.0", "2.0.0"

Refer:

0
Kiran On

You can use https://webostv.developer.lge.com/api/webostvjs/webos/?wos_flag=deviceInfo#deviceInfo

webOS.deviceInfo(function (device) {
 
    var version = device.version.split('.');
    if (Number(version[0]) > 3 || Number(device.versionMajor) > 3) {
        // do something
        if (Number(version[1]) > 2 || Number(device.versionMinor) > 2) {
            // do something
            if (Number(version[2]) > 13 || Number(device.versionDot) > 13) {
                // do something
            }
        }
    }
 
    var sdkVersion = device.sdkVersion.split('.');
    if (sdkVersion[0] === '3') {
        // do something
    }
});