Are there any methods on the command object? The developer docs page for this is blank/no documentation.
Stepping back... Specifically I'm trying to see if there is any way to query a device command from an app and see if it accepts parameters, and if so how many/type?
I know I can do a device.getSupportedCommands() to get the list of commands on a device (and I do), but I would really like to be able to see if any of those commands accept parameters, too...
From Groovy metaclass inspection in a test app (just something like myDevice.supportedCommands.each { cmd -> log.trace "$cmd"; cmd.metaClass.methods.name.unique().each {log.warn "method = $it"} }, I see that there is a getParameters() method, so you can do something like this:
It looks like getParameters() returns a List of Maps, just like how you can specify them for a custom command. You'll have to tease that apart, I suppose, for the type key, to get what you're really after.
But this is obviously all quite unofficial, so take staff's word instead should they reply. Just doing what I can see given that the documentation for this class is entirely nonexistent...
This was super helpful to me guys. I know it has been a long time since you posted this, but I am just now getting to this and the Command object is still not documented. I might try to add some documentation to the Wiki. Thanks again.
You'd probably be better off just posting feedback here; there is so much spam submitted for moderation to the MediaWiki platform that it's nearly impossible to wade through and find legitimate contributions, and this ability will likely not be a part of the documentation platform at all at some point in the future. I've been told that the developer docs in particular will also be regenerated (at least the ones that are just docs for objects/methods/etc.), presumably with missing notes added in, though I don't know the timeline for that. All this to say: I probably wouldn't spend much time on this, though the thought is appreciated!
If there are any glaring omissions in the meantime, posting here may be the best way to get something addressed. I'm not sure things like a getAllX() method that returns a List<X> is necessarily "glaring" (a lot of the technically "to be documented" methods are pretty straightforward, IMHO, though I know I'm biased given some familiarity with the platform...), but since I don't have a timeline for any of the above, I suppose it can't hurt.