saveDevProperty(params: ISaveDevProperty)

Requires:
@ray-js/ray≥1.5.2

Description

Write device property data set via custom settings; after saving, retrieve it with getDevProperty

Parameters

ParameterTypeRequiredDescription
YesRequest parameters

Return Value

Type: Promise<boolean>
Whether the save was successful

Examples

Basic usage

import { saveDevProperty } from '@ray-js/ray';

saveDevProperty({
  devId: 'your_device_id',
  bizType: 0,
  propertyList: JSON.stringify([
    { code: 'hello', value: 'world' },
    { code: 'foo', value: 'bar' },
  ]),
}).then((response) => {
  console.log('Save result:', response);
}).catch((err) => {
  console.error(err);
});