Skip to content

Commit

Permalink
otaId fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Feb 4, 2024
1 parent 1beaf76 commit f5b75c4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/app/core/services/device-manager.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,28 @@ 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', 'otaId']
}).catch((reason) => {
if (reason instanceof LunaResponseError) {
return this.luna.call<SystemInfo>(device, 'luna://com.webos.service.tv.systemproperty/getSystemInfo', {
keys: ['firmwareVersion', 'modelName', 'sdkVersion']
});
}
throw reason;
});
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,
otaId: systemInfo.otaId || await this.luna.call<{
billingId?: string
}>(device, 'luna://com.webos.service.sdx/getDeviceUuid', {}).then((ret) => {
if (!ret.billingId) {
return undefined;
}
return new URLSearchParams(ret.billingId).get('modelName') ?? undefined;
}).catch(() => undefined),
firmwareVersion: systemInfo.firmwareVersion
};
}
Expand Down

0 comments on commit f5b75c4

Please sign in to comment.