updateDeviceConfig(params: UpdateDeviceConfigParams)

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

Description

Modify device service configuration items

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<number>
Updated configId

Referenced Types

enumVisionEventType
ValueActual ValueDescription
VisionEventType.PRESET0Preset event
VisionEventType.CUSTOM1Custom event
enumDeviceServiceConfigState
ValueActual ValueDescription
DeviceServiceConfigState.Delete0Deleted
DeviceServiceConfigState.Available1Available
DeviceServiceConfigState.Unavailable2Unavailable

Valid Values

VisionEventType
ValueDescriptionSince
0Preset event-
1Custom event-
DeviceServiceConfigState
ValueDescriptionSince
0Deleted-
1Available-
2Unavailable-
UpdateDeviceConfigParams.serviceBusinessType
ValueDescriptionSince
aiSmartFreeEvent--
aiSmartFreeEventImage2Text--

Examples

Request example

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

updateDeviceConfig({
  devId: 'vdevo1',
  serviceBusinessType: 'aiSmartFreeEvent',
  configCode: 'person',
  configType: 0,
  enableState: 1,
})
  .then((id) => console.log(id))
  .catch(console.error);

Response example

1