// create new Thing
var params = {
name: ThingName /* STRING */,
description: undefined /* STRING */,
thingTemplateName: "Timer" /* THINGTEMPLATENAME */,
tags: undefined /* TAGS */
};
Resources["EntityServices"].CreateThing(params);
// read initial configuration
// result: INFOTABLE
var configtable = Things[ThingName].GetConfigurationTable({tableName: "Settings"});
// update configuration with service parameters
configtable.updateRate = updateRate
configtable.runAsUser = user
// set new configuration table
var params = {
configurationTable: configtable /* INFOTABLE */,
persistent: true /* BOOLEAN */,
tableName: "Settings" /* STRING */
};
Things[ThingName].SetConfigurationTable(params);
I have currently a taks where this code is helpful but my quesiton here.
Do we need to set the thingname in the param json? like:
// create new Thing
var params = {
name: ThingName /* STRING */,
description: undefined /* STRING */,
thingTemplateName: "Timer" /* THINGTEMPLATENAME */,
tags: undefined /* TAGS */
};
params.name=ThingName;
Resources["EntityServices"].CreateThing(params);
....
or is already done in the param definition? Means the input parameter is used . No problem I will test it
