I am confused about the way the following api's work , any one give me some clarity? I also can't get setDeviceState to work at all is this a bug, I did look at bug tracker but couldn't find anything. why are they implemented differently?
setDeviceState(deviceId, service, variable, value, options)
setDeviceStatePersistent(deviceId, service, variable, value, options)
setDeviceStateVariable(deviceId, service, variable, value, onSuccess, onFailure, context)
setDeviceStateVariablePersistent(deviceId, service, variable, value, onSuccess, onFailure, context)
So many questions and no answers.
The following does however work: -
function setDeviceStateVariable(DEVICE, SID, VARIABLE, VALUE)
{
api.setDeviceStatePersistent(DEVICE, SID, VARIABLE, VALUE,
{
'onSuccess': function()
{
ShowStatus('Data updated', false);
},
'onFailure': function()
{
ShowStatus("Failed to update data. Reload LuuP and try again", true);
}
});
}
Thanks