Open devMikeFrancis opened 8 months ago
The Snapshot commands did not exist when I wrote these modules. Have you tried naming the snapshot component in the designer window/properties (depending on the version of qsys you are using)?
Example of a non-named snapshot component and a named one:
It looks like it is possible to rename the component like you showed and it will function with the Component method, you just loose the ability to dynamically assign ramp time that you get with using the dedicated method. I am not sure if there are any other differences between the two.
Im going to assign this as an enhancement. I'll update this thread if its feasible or not.
So, I've used the Snapshot.Set methods in my other qsys modules. (They were undocumented at the time, and we had to call qsys).
One downside of them, there's no feedback with them like the component has. At least, not from what I've found. Which is quite handy for some scenarios (camera presets for example).
The QRC JSON command issued for Snapshots appears to be sending Component.Set method instead of Snapshot.Set methods.
Following the API guide for a Snapshot named "MySpecialBank" with a single bank:
{ "jsonrpc": "2.0", "method": "Snapshot.Load", "params": { "Name": "MySpecialBank", "Bank": 1, "Ramp": 8.5 }, "id": 1234 }
What the drivers are sending (from debug output):
{ "jsonrpc": "2.0", "id": "{\"app\":\"crestron\",\"caller\":\"MySpecialBank\",\"valueType\":\"value\",\"method\":\"load_1\",\"value\":1.0,\"stringValue\":\"1\",\"position\":0.0}", "method": "Component.Set", "params": { "Name": "MySpecialBank", "Controls": [ { "Name": "load_1", "Value": 1.0 } ] } }
which returns that the component does not exist.