Skip to content

Commit

Permalink
displays OTA ID
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Jan 7, 2024
1 parent f9102b8 commit 8f018a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/app/core/services/device-manager.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ export class DeviceManagerService extends BackendClient {

async getDeviceInfo(device: DeviceLike): Promise<Partial<DeviceInfo>> {
const systemInfo = await this.luna.call<SystemInfo>(device, 'luna://com.webos.service.tv.systemproperty/getSystemInfo', {
keys: ['firmwareVersion', 'modelName', 'sdkVersion']
keys: ['firmwareVersion', 'modelName', 'sdkVersion', 'otaId']
});
const osInfo = await this.luna.call<Partial<OsInfo>>(device, 'luna://com.webos.service.systemservice/osInfo/query', {
parameters: ['webos_manufacturing_version', 'webos_release']
}).catch(() => null);
return {
modelName: systemInfo.modelName,
osVersion: osInfo?.webos_release || systemInfo.sdkVersion,
otaId: systemInfo.otaId,
firmwareVersion: systemInfo.firmwareVersion
};
}
Expand Down Expand Up @@ -227,5 +228,6 @@ export class CrashReport implements CrashReportEntry {
export interface DeviceInfo {
modelName: string;
osVersion?: string;
otaId?: string;
firmwareVersion: string;
}
13 changes: 9 additions & 4 deletions src/app/info/info.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@
<div class="card-body">
<h5 class="card-title">Device - {{deviceInfo.modelName}}</h5>
<p class="card-text">
<strong>Firmware version: </strong><span>{{deviceInfo.firmwareVersion}}</span>
<strong>Firmware version: </strong>
<span class="user-select-text">{{deviceInfo.firmwareVersion}}</span>
<ng-container *ngIf="deviceInfo.osVersion as osVersion">
<br>
<strong>webOS version: </strong><span>{{osVersion}}</span>
<strong>webOS version: </strong><span class="user-select-text">{{osVersion}}</span>
</ng-container>
<ng-container *ngIf="deviceInfo.otaId as otaId">
<br>
<strong>OTA ID: </strong><span class="user-select-text">{{otaId}}</span>
</ng-container>
</p>
<div class="btn-group">
<button class="btn btn-primary" (click)="takeScreenshot()" *ngIf="device.username === 'root'">Take Screenshot
<div class="btn-group" *ngIf="device.username === 'root'">
<button class="btn btn-primary" (click)="takeScreenshot()">Take Screenshot
</button>
<div class="btn-group" ngbDropdown container="body" display="dynamic" role="group"
aria-label="More options">
Expand Down
1 change: 1 addition & 0 deletions src/app/types/luna-apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export declare interface SystemInfo extends LunaResponse {
firmwareVersion: string;
modelName: string;
sdkVersion: string;
otaId: string;
}

export declare interface OsInfo extends LunaResponse {
Expand Down

0 comments on commit 8f018a0

Please sign in to comment.