mirror of
https://github.com/Fishwaldo/qt-openzwave.git
synced 2025-03-15 11:31:33 +00:00
Fix Crash when values that have been deleted (#17)
* Allow Statistics Timeout to be adjustable * Fix Crash with Values that have been deleted/removed when the Notification Arrives at the app
This commit is contained in:
parent
47f4b61364
commit
72a55e5b38
3 changed files with 14 additions and 2 deletions
|
@ -1147,6 +1147,18 @@ bool QTOZWManager_Internal::convertValueID(quint64 vidKey) {
|
|||
|
||||
void QTOZWManager_Internal::pvt_valueAdded(quint64 vidKey)
|
||||
{
|
||||
try {
|
||||
OpenZWave::ValueID vid(this->homeId(), vidKey);
|
||||
if (!this->m_manager->IsValueValid(vid)) {
|
||||
qCWarning(notifications) << "ValueAdded Notification for Key " << vidKey << " Is Invalid. Key Probably Deleted";
|
||||
return;
|
||||
}
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
qCWarning(notifications) << "OZW Exception: " << e.GetMsg().c_str() << " at " << e.GetFile().c_str() <<":" << e.GetLine();
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
}
|
||||
|
||||
qCDebug(notifications) << "Notification pvt_valueAdded:" << vidKey;
|
||||
if (!this->m_validValues.contains(vidKey))
|
||||
this->m_validValues.push_back(vidKey);
|
||||
|
|
|
@ -785,7 +785,7 @@ void mqttpublisher::started(quint32 homeID) {
|
|||
QT2JS::SetString(this->m_ozwstatus, "Status", "started");
|
||||
QT2JS::SetUint(this->m_ozwstatus, "homeID", homeID);
|
||||
this->sendStatusUpdate();
|
||||
this->m_statsTimer.start(10000);
|
||||
this->m_statsTimer.start(settings->value("StatisticsUpdateInterval", 30000).toInt());
|
||||
}
|
||||
void mqttpublisher::stopped(quint32 homeID) {
|
||||
qCDebug(ozwmp) << "Publishing Event stopped";
|
||||
|
|
|
@ -73,7 +73,7 @@ ldd $EXECUTABLE | awk '{print $3}' |
|
|||
fi
|
||||
|
||||
done
|
||||
LIBS+=" /usr/local/lib/ozwdaemon"
|
||||
LIBS+=" /usr/local/bin/ozwdaemon"
|
||||
echo $LIBS
|
||||
sentry-cli --auth-token $SENTRY_TOKEN upload-dif -o openzwave -p qt-openzwave $LIBS --wait
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue