mirror of
https://github.com/nymea/nymea-plugins.git
synced 2026-08-05 03:33:51 +02:00
fixed crash on avahi discovery
This commit is contained in:
parent
c028306b0b
commit
7ff668683a
@ -70,6 +70,10 @@ void IntegrationPluginWs2812fx::init()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NymeaLightTcpInterface *lightInterface = qobject_cast<NymeaLightTcpInterface *>(m_lights.value(thing)->parent());
|
NymeaLightTcpInterface *lightInterface = qobject_cast<NymeaLightTcpInterface *>(m_lights.value(thing)->parent());
|
||||||
|
if (!lightInterface) {
|
||||||
|
qCWarning(dcWs2812fx()) << "Invalid NymeaLightInterface pointer for" << thing;
|
||||||
|
return;
|
||||||
|
}
|
||||||
lightInterface->setAddress(entry.hostAddress());
|
lightInterface->setAddress(entry.hostAddress());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -106,8 +110,8 @@ void IntegrationPluginWs2812fx::setupThing(ThingSetupInfo *info)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NymeaLightTcpInterface *lightInterface = new NymeaLightTcpInterface(QHostAddress(interface));
|
NymeaLightTcpInterface *lightInterface = new NymeaLightTcpInterface(QHostAddress(interface), thing);
|
||||||
light = new NymeaLight(lightInterface, this);
|
light = new NymeaLight(lightInterface, lightInterface);
|
||||||
lightInterface->setParent(light);
|
lightInterface->setParent(light);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user