I suspect I am going a little crazy here and missing something obvious but I'll be damned if I can figure it out and wondering if anyone can help me.
All I want is a device with a slider on it and then when this slider is moved a script is called to do something (which may be to then some serial data). I have done this a number of times with plugins but for a couple of reasons I don't really want to use a plugin.
I create three VSPair's on a device, two buttons for on/off and another with the type of slider. All the pairs add correctly and have the right values, 0 for off, 100 for on and 1-99 for the dim level.
I know in a plugin then when the device is touched it will call into the SetIOMulti function of the plugin which matches the .interface property. I've done it countless times in a plugin and know from there to look at the data, potentially set the device value from there or do something about it.
I looked at the .ScriptName/.ScriptFunc properties however these seem to be only called when the value/string changes (eDeviceType_Script.Run_On_Value_Change etc).
I think the issue is that when the CAPI control is manipulated then the value is not changed and the .ScriptName function never gets called, I am not quite sure as to the purpose of that function in that case other than to call a script when something else changes that devices value? Not really sure how often that would happen in practice and you could not just use a callback instead.
I know there are commands like DeviceScriptButton_AddButton but I don't want a button for the dim I want a slider - surely it is possible to have a slider call a script?
Thanks guys...
All I want is a device with a slider on it and then when this slider is moved a script is called to do something (which may be to then some serial data). I have done this a number of times with plugins but for a couple of reasons I don't really want to use a plugin.
I create three VSPair's on a device, two buttons for on/off and another with the type of slider. All the pairs add correctly and have the right values, 0 for off, 100 for on and 1-99 for the dim level.
I know in a plugin then when the device is touched it will call into the SetIOMulti function of the plugin which matches the .interface property. I've done it countless times in a plugin and know from there to look at the data, potentially set the device value from there or do something about it.
I looked at the .ScriptName/.ScriptFunc properties however these seem to be only called when the value/string changes (eDeviceType_Script.Run_On_Value_Change etc).
I think the issue is that when the CAPI control is manipulated then the value is not changed and the .ScriptName function never gets called, I am not quite sure as to the purpose of that function in that case other than to call a script when something else changes that devices value? Not really sure how often that would happen in practice and you could not just use a callback instead.
I know there are commands like DeviceScriptButton_AddButton but I don't want a button for the dim I want a slider - surely it is possible to have a slider call a script?
Thanks guys...
Comment