Question about Plugin Capabilities and Attributes

I’ve been loading Plugins that have been posted to see how they work. It seems sometimes data is passed thru Capabilities variables and sometimes passed thru Attributes variables.

What is the purpose of each? and is there any benefit to use one over the other?

Jerry

Capabilities are sets of standardized Attributes applied to devices. Take the LocationMode Capability as an example, when you add this capability to a device Home Remote will automatically generate 2 attributes, LocationMode & SupportedLocationModes. By using Capabilities it’s possible to develop plugins that are compatible with our standard default templates. When you use custom attributes you will typically have to create your own XAML files to monitor & control them. Generally speaking, use Capabilities when you can. But there will likely be scenarios where there isn’t an existing capability that fits what you’re trying to do. In those cases, use custom Attributes.

Hi Bill
Sorry about this question. How to make custom Attributes? Can I make them in Script?
Kevin

For custom attributes, all you need to do is add them to the Attributes property on the device object.

Thanks Bill. I have tried it, it is really useful
Kevin