logilink: Add Qt6 support
parent
02739277e5
commit
9e5b735e14
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2024, 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.
|
||||||
|
|
@ -30,9 +30,10 @@
|
||||||
|
|
||||||
#include "integrationpluginlogilink.h"
|
#include "integrationpluginlogilink.h"
|
||||||
#include "plugininfo.h"
|
#include "plugininfo.h"
|
||||||
#include "plugintimer.h"
|
|
||||||
|
|
||||||
|
#include <plugintimer.h>
|
||||||
#include <network/networkaccessmanager.h>
|
#include <network/networkaccessmanager.h>
|
||||||
|
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QAuthenticator>
|
#include <QAuthenticator>
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
|
|
@ -243,30 +244,30 @@ void IntegrationPluginLogilink::getStates(Thing *thing)
|
||||||
}
|
}
|
||||||
thing->setStateValue(pdu8p01ConnectedStateTypeId, true);
|
thing->setStateValue(pdu8p01ConnectedStateTypeId, true);
|
||||||
if (xml.readNextStartElement()) {
|
if (xml.readNextStartElement()) {
|
||||||
if (xml.name() == "response") {
|
if (xml.name() == QString("response")) {
|
||||||
qCDebug(dcLogilink()) << "XML contains response";
|
qCDebug(dcLogilink()) << "XML contains response";
|
||||||
} else {
|
} else {
|
||||||
qCWarning(dcLogilink()) << "xml name" << xml.name();
|
qCWarning(dcLogilink()) << "xml name" << xml.name();
|
||||||
}
|
}
|
||||||
while(xml.readNextStartElement()) {
|
while(xml.readNextStartElement()) {
|
||||||
qCDebug(dcLogilink()) << "XML name" << xml.name();
|
qCDebug(dcLogilink()) << "XML name" << xml.name();
|
||||||
if (xml.name() == "curBan") {
|
if (xml.name() == QString("curBan")) {
|
||||||
auto current = xml.readElementText().toDouble();
|
auto current = xml.readElementText().toDouble();
|
||||||
qCDebug(dcLogilink()) << "Current" << current;
|
qCDebug(dcLogilink()) << "Current" << current;
|
||||||
thing->setStateValue(pdu8p01TotalLoadStateTypeId, current);
|
thing->setStateValue(pdu8p01TotalLoadStateTypeId, current);
|
||||||
} else if (xml.name() == "statBan") {
|
} else if (xml.name() == QString("statBan")) {
|
||||||
auto status = xml.readElementText();
|
auto status = xml.readElementText();
|
||||||
qCDebug(dcLogilink()) << "Status" << status;
|
qCDebug(dcLogilink()) << "Status" << status;
|
||||||
thing->setStateValue(pdu8p01StatusStateTypeId, status);
|
thing->setStateValue(pdu8p01StatusStateTypeId, status);
|
||||||
} else if (xml.name() == "tempBan") {
|
} else if (xml.name() == QString("tempBan")) {
|
||||||
auto temperature = xml.readElementText().toDouble();
|
auto temperature = xml.readElementText().toDouble();
|
||||||
qCDebug(dcLogilink()) << "Temperature" << temperature;
|
qCDebug(dcLogilink()) << "Temperature" << temperature;
|
||||||
thing->setStateValue(pdu8p01TemperatureStateTypeId, temperature);
|
thing->setStateValue(pdu8p01TemperatureStateTypeId, temperature);
|
||||||
} else if (xml.name() == "humBan") {
|
} else if (xml.name() == QString("humBan")) {
|
||||||
auto humidity = xml.readElementText().toDouble();
|
auto humidity = xml.readElementText().toDouble();
|
||||||
qCDebug(dcLogilink()) << "hummidity" << humidity;
|
qCDebug(dcLogilink()) << "hummidity" << humidity;
|
||||||
thing->setStateValue(pdu8p01HumidityStateTypeId, humidity);
|
thing->setStateValue(pdu8p01HumidityStateTypeId, humidity);
|
||||||
} else if (xml.name().startsWith("outletStat")){
|
} else if (xml.name().startsWith(QString("outletStat"))){
|
||||||
int socketNumber = xml.name().right(1).toInt();
|
int socketNumber = xml.name().right(1).toInt();
|
||||||
bool socketValue = xml.readElementText().startsWith("on");
|
bool socketValue = xml.readElementText().startsWith("on");
|
||||||
auto socketThing = myThings().filterByParentId(thing->id())
|
auto socketThing = myThings().filterByParentId(thing->id())
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2024, 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.
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef INTEGRATIONPLUGINLOGILINK_H
|
#ifndef INTEGRATIONPLUGINLOGILINK_H
|
||||||
#define INTEGRATIONPLUGINLOGILINK_H
|
#define INTEGRATIONPLUGINLOGILINK_H
|
||||||
|
|
||||||
#include "integrations/integrationplugin.h"
|
#include <integrations/integrationplugin.h>
|
||||||
|
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ include(../plugins.pri)
|
||||||
|
|
||||||
QT += network xml
|
QT += network xml
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(nymea_integrationpluginlogilink)
|
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
integrationpluginlogilink.cpp \
|
integrationpluginlogilink.cpp \
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue