I expect only the hard core plugin developers will be interested in this one...
I've got a number of plugins that deal with what I call "discovered" devices. These are ones where the plugin has to build a list of logical devices and maintain it separately from the list of Indigo devices that get created. For instance, the Ecobee plugin gets a list of devices associated with the user's account when it authenticates with the Ecobee servers. Or, to be more accurate, every time it gets a status update from the servers, since the response always includes all associated devices.
But the user might not have created Indigo devices for all possible Ecobee devices. So the plugin maintains a list of "discovered" (or "known) Ecobee devices, which it uses to populate the appropriate popup in the device creation dialog. This same scenario plays out in a bunch of plugins.
So here's the issue I'm running into. I was maintaining the list based on calls to startComm and stopComm for each device. startComm put that device in an active list, and stopComm deleted it from the list. And when I needed a list of available devices for a device creation dialog, I would just remove active from known and what was left was available.
Now take the situation where an Indigo device has been disabled, but not deleted. It's not in active, so should the user be able to create a new Indigo device based on it? If not, how do I know if that device still exists, but isn't running. I guess I would need to search indigo.devices looking for everything of that device type?
How do you other developers handle this?