unifi: Add Qt6 support

This commit is contained in:
Simon Stürz 2025-08-11 14:54:30 +02:00
parent 5cbb2db471
commit 673a25ef8d
3 changed files with 11 additions and 12 deletions

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright 2013 - 2020, nymea GmbH * Copyright 2013 - 2025, nymea GmbH
* Contact: contact@nymea.io * Contact: contact@nymea.io
* *
* This file is part of nymea. * This file is part of nymea.
@ -262,7 +262,7 @@ void IntegrationPluginUnifi::setupThing(ThingSetupInfo *info)
QNetworkReply *reply = hardwareManager()->networkManager()->post(request, QJsonDocument::fromVariant(login).toJson()); QNetworkReply *reply = hardwareManager()->networkManager()->post(request, QJsonDocument::fromVariant(login).toJson());
connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater); connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater);
connect(reply, &QNetworkReply::finished, info, [this, info, reply](){ connect(reply, &QNetworkReply::finished, info, [info, reply](){
if (reply->error() != QNetworkReply::NoError) { if (reply->error() != QNetworkReply::NoError) {
qCWarning(dcUnifi()) << "SetupThing: Network request error:" << reply->error() << reply->errorString(); qCWarning(dcUnifi()) << "SetupThing: Network request error:" << reply->error() << reply->errorString();
info->finish(Thing::ThingErrorHardwareFailure); info->finish(Thing::ThingErrorHardwareFailure);

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright 2013 - 2020, nymea GmbH * Copyright 2013 - 2025, nymea GmbH
* Contact: contact@nymea.io * Contact: contact@nymea.io
* *
* This file is part of nymea. * This file is part of nymea.
@ -33,7 +33,7 @@
#include <QObject> #include <QObject>
#include "integrations/integrationplugin.h" #include <integrations/integrationplugin.h>
#include <QNetworkRequest> #include <QNetworkRequest>
@ -56,7 +56,6 @@ public:
void setupThing(ThingSetupInfo *info) override; void setupThing(ThingSetupInfo *info) override;
void postSetupThing(Thing *thing) override; void postSetupThing(Thing *thing) override;
void thingRemoved(Thing *thing) override; void thingRemoved(Thing *thing) override;
// void executeAction(ThingActionInfo *info) override;
private: private:
QNetworkRequest createRequest(const QString &address, uint port, const QString &path, const QString &prefix = QString()); QNetworkRequest createRequest(const QString &address, uint port, const QString &path, const QString &prefix = QString());

View File

@ -1,11 +1,11 @@
include(../plugins.pri) include(../plugins.pri)
QT += network QT *= network
HEADERS += \ HEADERS += \
integrationpluginunifi.h \ integrationpluginunifi.h
SOURCES += \ SOURCES += \
integrationpluginunifi.cpp \ integrationpluginunifi.cpp