Hi all.
I'm running into a bit of a plugin design issue. In working on a Pioneer VSX-1021-K Receiver plugin, I'm not sure how best to perform initial connection status queries. As currently designed, the plugin stores a number of infrequently changed receiver parameters (such as display language, tuner preset names, and input source names) properties for the plugin device (i.e. in the data accessible in the pluginProps dictionary for a device). The method I created to query the receiver for this information is called from within the deviceStartComm method. The problem is that I get into a continuous loop when updating the device properties on the server because deviceStopComm and deviceStartComm are called each time the properties for a device are updated.
Is there a better place to put these initial data gathering method calls? Should I be storing those infrequently changed parameters as device states instead? I'm not familiar with multi-threading programming, so the less thread management (e.g. zero) that I have to do in this plugin, the better. I'm currently using the runConcurrentThread method to loop through a list of devices, calling the "connect" method I created to connect to the receiver associated with each Indigo device and reading data from their respective telnet connections each loop cycle. If I were to put the data gathering method calls within the runConcurrentThread method, what would be the best way to ensure such calls aren't executed more often than necessary?
Thanks for the help.