mirror of https://github.com/nymea/nymea.git
Add a getter method for thing classes to plugin api
parent
1acd8ca808
commit
f08cd6b09f
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ JSON_PROTOCOL_VERSION_MAJOR=5
|
|||
JSON_PROTOCOL_VERSION_MINOR=5
|
||||
JSON_PROTOCOL_VERSION="$${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}"
|
||||
LIBNYMEA_API_VERSION_MAJOR=7
|
||||
LIBNYMEA_API_VERSION_MINOR=0
|
||||
LIBNYMEA_API_VERSION_MINOR=1
|
||||
LIBNYMEA_API_VERSION_PATCH=0
|
||||
LIBNYMEA_API_VERSION="$${LIBNYMEA_API_VERSION_MAJOR}.$${LIBNYMEA_API_VERSION_MINOR}.$${LIBNYMEA_API_VERSION_PATCH}"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue