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