checkLightLibrariesVersionsUpgradable(data: GetLightLibrariesDataParams)

Requires:
MiniKit≥3.7.6@tuya-miniapp/cloud-api≥1.0.5Mini Program Base Library≥2.18.1

Description

Verify whether the latest version of the library bound to the device or group is greater than the currently bound version. If so, an update is available; otherwise, no update is available. If libDataType is 0, the library is considered updatable if any data type has an update.

Parameters

ParameterTypeRequiredDescription
YesRequest parameters: bizId (business ID), bizType (business type: 0 = device, 1 = group), libType (library type: SCENE_LIB = scene library, MUSIC_LIB = music library, SCENE_IMAGE_LIB = scene image library), libDataType (library data type: 0 = all; if 0, the library is considered updatable if any data type has updates; 1 = basic data, provided by Tuya and bound at the panel uiId level; 2 = advanced data, maintained by users in the micro app backend).

Return Value

Type: Promise<boolean>
boolean

Valid Values

GetLightLibrariesDataParams.bizType
ValueDescriptionMiniKit Since
0--
1--
GetLightLibrariesDataParams.libType
ValueDescriptionMiniKit Since
SCENE_LIB--
MUSIC_LIB--
SCENE_IMAGE_LIB--
GetLightLibrariesDataParams.libDataType
ValueDescriptionMiniKit Since
0--
1--
2--

Examples

Request example

import { checkLightLibrariesVersionsUpgradable } from '@tuya-miniapp/cloud-api';

checkLightLibrariesVersionsUpgradable({
  bizId: 'vdevo167504******003',
  bizType: 0,
  libType: 'SCENE_LIB',
  libDataType: 0,
})
  .then((response) => {
    console.log(response);
  })
  .catch();

Response example

true