bitfocus / companion-module-ptzoptics-visca

MIT License
9 stars 13 forks source link

Figure out how to expose inquiries to users #45

Open jswalden opened 5 months ago

jswalden commented 5 months ago

After #33 and #42 we can send inquiries to the camera to get info about its current state. This isn't exposed to users, only used internally. It should be exposed.

Most ideal would be a "Custom inquiry" action letting you ask anything at all. But you need a way to expose the reply's parameter values. Writing to custom variables is plausible, but the "custom variable" option selector is deprecated. You could write to per-module variables for each parameter. But that doesn't work for a user who uses multiple custom inquiries, where the results of one inquiry might be overwritten by another inquiry (and the values have different meanings) before they can be consumed.

My best idea is to add actions that make PTZOptics-specified inquiries of instantaneous state, that write to per-module, per-specific-inquiry variables. For example, a "Determine Image Flip" inquiry action that writes to $image_flipped_horizontally and $image_flipped_vertically variables, that are written to by no other inquiry action. There's no problem having the action used multiple times by Companion: the variable always has the same semantics, and if you race, you just get more-up-to-date values.

Comments/ideas from others appreciated. I'll probably look into that "best idea" once the 3.0.0 release is done, but definitely not sooner.