Merge PR #309: Don't call thingRemoved() on the plugin in case of reconfiguring

This commit is contained in:
Jenkins nymea 2020-10-28 19:07:24 +01:00
commit db98f60556
2 changed files with 5 additions and 3 deletions

View File

@ -402,9 +402,6 @@ ThingSetupInfo *ThingManagerImplementation::reconfigureThingInternal(Thing *thin
}
ParamList finalParams = buildParams(thing->thingClass().paramTypes(), params);
// first remove the thing in the plugin
plugin->thingRemoved(thing);
// mark setup as incomplete
thing->setSetupStatus(Thing::ThingSetupStatusInProgress, Thing::ThingErrorNoError);

View File

@ -133,6 +133,11 @@ void IntegrationPluginMock::discoverThings(ThingDiscoveryInfo *info)
void IntegrationPluginMock::setupThing(ThingSetupInfo *info)
{
if (info->thing()->thingClassId() == mockThingClassId || info->thing()->thingClassId() == autoMockThingClassId) {
if (m_daemons.contains(info->thing())) {
// We already have a daemon, seem's we're reconfiguring
delete m_daemons.take(info->thing());
}
bool async = false;
bool broken = false;
if (info->thing()->thingClassId() == mockThingClassId) {