fix mocks to properly deal with the new way of reconfiguring
This commit is contained in:
parent
573a2c061a
commit
d529a27df1
@ -54,6 +54,7 @@ StateHandler::StateHandler(QObject *parent) :
|
|||||||
JsonHandler(parent)
|
JsonHandler(parent)
|
||||||
{
|
{
|
||||||
registerEnum<Types::Unit>();
|
registerEnum<Types::Unit>();
|
||||||
|
registerEnum<Types::IOType>();
|
||||||
registerObject<State>();
|
registerObject<State>();
|
||||||
registerObject<StateType>();
|
registerObject<StateType>();
|
||||||
|
|
||||||
|
|||||||
@ -133,6 +133,11 @@ void IntegrationPluginMock::discoverThings(ThingDiscoveryInfo *info)
|
|||||||
void IntegrationPluginMock::setupThing(ThingSetupInfo *info)
|
void IntegrationPluginMock::setupThing(ThingSetupInfo *info)
|
||||||
{
|
{
|
||||||
if (info->thing()->thingClassId() == mockThingClassId || info->thing()->thingClassId() == autoMockThingClassId) {
|
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 async = false;
|
||||||
bool broken = false;
|
bool broken = false;
|
||||||
if (info->thing()->thingClassId() == mockThingClassId) {
|
if (info->thing()->thingClassId() == mockThingClassId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user