Merge PR #438: Add a getter method for thing classes to plugin api
This commit is contained in:
commit
0404240fb7
@ -152,6 +152,17 @@ ThingClasses IntegrationPlugin::supportedThings() const
|
||||
return m_metaData.thingClasses();
|
||||
}
|
||||
|
||||
/*! Returns a \l{ThingClass}{ThingClass} for the given \a thingClassId */
|
||||
ThingClass IntegrationPlugin::thingClass(const ThingClassId &thingClassId) const
|
||||
{
|
||||
foreach (const ThingClass &thingClass, supportedThings()) {
|
||||
if (thingClass.id() == thingClassId) {
|
||||
return thingClass;
|
||||
}
|
||||
}
|
||||
return ThingClass();
|
||||
}
|
||||
|
||||
/*! Override this if your plugin supports things with ThingClass::CreationMethodAuto.
|
||||
This will be called at startup, after the configured things have been loaded.
|
||||
This is the earliest time you should start emitting autoThingsAppeared(). If you
|
||||
|
||||
@ -93,6 +93,7 @@ public:
|
||||
QString pluginDisplayName() const;
|
||||
Vendors supportedVendors() const;
|
||||
ThingClasses supportedThings() const;
|
||||
ThingClass thingClass(const ThingClassId &thingClassId) const;
|
||||
|
||||
virtual void startMonitoringAutoThings();
|
||||
virtual void discoverThings(ThingDiscoveryInfo *info);
|
||||
|
||||
Reference in New Issue
Block a user