diff --git a/libnymea/devicemanager.cpp b/libnymea/devicemanager.cpp index 5a9f88cf..017780e8 100644 --- a/libnymea/devicemanager.cpp +++ b/libnymea/devicemanager.cpp @@ -1117,6 +1117,9 @@ void DeviceManager::loadPlugin(DevicePlugin *pluginIface) } } + // Call the init method of the plugin + pluginIface->init(); + m_devicePlugins.insert(pluginIface->pluginId(), pluginIface); connect(pluginIface, &DevicePlugin::emitEvent, this, &DeviceManager::eventTriggered); diff --git a/libnymea/plugin/deviceplugin.cpp b/libnymea/plugin/deviceplugin.cpp index e72c3fa1..f6752908 100644 --- a/libnymea/plugin/deviceplugin.cpp +++ b/libnymea/plugin/deviceplugin.cpp @@ -285,14 +285,12 @@ QList DevicePlugin::configurationDescription() const } /*! This will be called when the DeviceManager initializes the plugin and set up the things behind the scenes. - When implementing a new plugin, use \l{DevicePlugin::init()} instead in order to do initialisation work. */ + When implementing a new plugin, use \l{DevicePlugin::init()} instead in order to do initialisation work. + The \l{DevicePlugin::init()} method will be called once the plugin configuration has been loaded. */ void DevicePlugin::initPlugin(DeviceManager *deviceManager) { m_deviceManager = deviceManager; - loadMetaData(); - - init(); } QPair > DevicePlugin::parseParamTypes(const QJsonArray &array) const