getLightRhythmsCityInfo(data: CommonLonLatParams)

Requires:
@tuya-miniapp/cloud-api≥1.0.5

Description

Retrieve city information for the specified location.

Parameters

ParameterTypeRequiredDescription
YesRequest parameters: bizId (business ID), bizType (business type: 0 = device, 1 = group), lon (longitude), lat (latitude).

Return Value

Type: Promise<GetLightRhythmsCityInfoResult>
Includes country, province, and city.

Referenced Types

interfaceGetLightRhythmsCityInfoResult
PropertyTypeDescription
countrystringCountry
provincestringProvince
citystringCity

Valid Values

CommonLonLatParams.bizType
ValueDescriptionSince
0--
1--

Examples

Request example

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

getLightRhythmsCityInfo({
  bizId: 'vdevo167504******003',
  bizType: 0,
  lon: '112.233',
  lat: '30.233',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

Response example

{
  "country": "China",
  "city": "Yiyang City",
  "province": "Hunan Province"
}

FAQ

Why does the biological rhythm cloud capability call fail?

Biological rhythm must have advanced capabilities enabled on the Tuya Developer Platform product feature definition page. Otherwise cloud capability calls will fail.