cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

AddPropertyDefinition: Invalid pushType

SOLVED
Participant

AddPropertyDefinition: Invalid pushType

I am attempting to programmatically add a property to a remote thing. I need to set the push type to "Always pushed", but passing a value of "Always pushed" as a parameter yields the following error:

 

Error executing service <Service>. Message :: Invalid Push Type : [Always pushed] - See Script Error Log for more details.

 

I've experimented with every variation of "Always pushed" I can think of with no luck. What is the proper string input needed to specify the push type?

 

 

The code for the service is below: 

 

try{
Things["myThing"].property = 0;

}catch(err){
var error=err.message;
if(error.match(/not found on myThing/)!=null){
var params = {
defaultValue: undefined /* STRING */,
remoteBindingAspects: undefined /* JSON */,
description: undefined /* STRING */,
readOnly: false /* BOOLEAN */,
type: "STRING" /* BASETYPENAME */,
remote: true /* BOOLEAN */,
remotePropertyName: 'remotepropertyname' /* STRING */,
timeout: undefined /* INTEGER */,
pushType: 'Always pushed' /* STRING */,
dataChangeThreshold: undefined /* NUMBER */,
logged: undefined /* BOOLEAN */,
name: "property" /* STRING */,
pushThreshold: undefined /* NUMBER */,
dataChangeType: undefined /* STRING */,
category: undefined /* STRING */,
persistent: true /* BOOLEAN */,
dataShape: undefined /* DATASHAPENAME */
};

// no return
Things["myThing"].AddPropertyDefinition(params);

// no return
Things["myThing"].RestartThing();

}
}

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: AddPropertyDefinition: Invalid pushType

Instead of pushType, Try 


"dataChangeType": "ALWAYS"

 

 

 

1 REPLY 1
Highlighted

Re: AddPropertyDefinition: Invalid pushType

Instead of pushType, Try 


"dataChangeType": "ALWAYS"