parent
cfb6b41c57
commit
a2f7596188
@ -176,7 +176,7 @@ QString GuhSettings::consoleLogPath()
|
||||
QString organisationName = QCoreApplication::instance()->organizationName();
|
||||
|
||||
if (organisationName == "guh-test") {
|
||||
consoleLogPath = "/tmp/" + organisationName + "/guhd-test.logs";
|
||||
consoleLogPath = "/tmp/" + organisationName + "/guhd-test.log";
|
||||
} else if (GuhSettings::isRoot()) {
|
||||
consoleLogPath = "/var/log/guhd.log";
|
||||
} else {
|
||||
|
||||
@ -128,10 +128,10 @@ DeviceManager::DeviceError DevicePluginConrad::executeAction(Device *device, con
|
||||
// =======================================
|
||||
// send data to driver
|
||||
if(transmitData(delay, rawData, repetitions)){
|
||||
qCDebug(dcConrad) << "transmitted successfully" << pluginName() << device->name() << action.actionTypeId();
|
||||
qCDebug(dcConrad) << "Transmitted successfully" << device->name() << action.actionTypeId();
|
||||
return DeviceManager::DeviceErrorNoError;
|
||||
}else{
|
||||
qCWarning(dcConrad) << "could not transmitt" << pluginName() << device->name() << action.actionTypeId();
|
||||
qCWarning(dcConrad) << "Could not transmitt" << pluginName() << device->name() << action.actionTypeId();
|
||||
return DeviceManager::DeviceErrorHardwareNotAvailable;
|
||||
}
|
||||
}
|
||||
@ -186,5 +186,5 @@ void DevicePluginConrad::radioData(const QList<int> &rawData)
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(dcConrad) << "Conrad: " << binCode.left(binCode.length() - 24) << " ID = " << binCode.right(24);
|
||||
qCDebug(dcConrad) << binCode.left(binCode.length() - 24) << " ID = " << binCode.right(24);
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ QTime Countdown::currentTime() const
|
||||
void Countdown::onTimeout()
|
||||
{
|
||||
m_currentTime = m_currentTime.addSecs(-1);
|
||||
qCDebug(dcDateTime) << name() << m_currentTime.toString();
|
||||
//qCDebug(dcDateTime) << name() << m_currentTime.toString();
|
||||
if (m_currentTime == QTime(0,0)) {
|
||||
qCDebug(dcDateTime) << name() << "countdown timeout.";
|
||||
if (m_repeating) {
|
||||
|
||||
@ -149,18 +149,18 @@ DeviceManager::DeviceSetupStatus DevicePluginDateTime::setupDevice(Device *devic
|
||||
{
|
||||
// check timezone
|
||||
if(!m_timeZone.isValid()){
|
||||
qCWarning(dcDateTime) << "invalid time zone.";
|
||||
qCWarning(dcDateTime) << "Invalid time zone.";
|
||||
return DeviceManager::DeviceSetupStatusFailure;
|
||||
}
|
||||
|
||||
// date
|
||||
if (device->deviceClassId() == todayDeviceClassId) {
|
||||
if (m_todayDevice != 0) {
|
||||
qCWarning(dcDateTime) << "there is already a date device or not deleted correctly! this should never happen!!";
|
||||
qCWarning(dcDateTime) << "There is already a date device or not deleted correctly! this should never happen!!";
|
||||
return DeviceManager::DeviceSetupStatusFailure;
|
||||
}
|
||||
m_todayDevice = device;
|
||||
qCDebug(dcDateTime) << "create today device: current time" << m_currentDateTime.currentDateTime().toString();
|
||||
qCDebug(dcDateTime) << "Create today device: current time" << m_currentDateTime.currentDateTime().toString();
|
||||
}
|
||||
|
||||
// alarm
|
||||
@ -199,7 +199,7 @@ DeviceManager::DeviceSetupStatus DevicePluginDateTime::setupDevice(Device *devic
|
||||
connect(countdown, &Countdown::countdownTimeout, this, &DevicePluginDateTime::onCountdownTimeout);
|
||||
connect(countdown, &Countdown::runningStateChanged, this, &DevicePluginDateTime::onCountdownRunningChanged);
|
||||
|
||||
qCDebug(dcDateTime) << "setup countdown" << countdown->name() << countdown->time().toString();
|
||||
qCDebug(dcDateTime) << "Setup countdown" << countdown->name() << countdown->time().toString();
|
||||
m_countdowns.insert(device, countdown);
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ void DevicePluginDateTime::searchGeoLocation()
|
||||
QNetworkRequest request;
|
||||
request.setUrl(QUrl("http://ip-api.com/json"));
|
||||
|
||||
qCDebug(dcDateTime) << "request geo location.";
|
||||
qCDebug(dcDateTime) << "Requesting geo location.";
|
||||
|
||||
QNetworkReply *reply = networkManagerGet(request);
|
||||
m_locationReplies.append(reply);
|
||||
@ -403,12 +403,12 @@ void DevicePluginDateTime::processTimesData(const QByteArray &data)
|
||||
m_dusk = QDateTime(QDate::currentDate(), QTime::fromString(duskString, "h:m:s AP"), Qt::UTC).toTimeZone(m_timeZone);
|
||||
|
||||
// calculate the times in each alarm
|
||||
qCDebug(dcDateTime) << " dawn :" << m_dawn.toString();
|
||||
qCDebug(dcDateTime) << " sunrise :" << m_sunrise.toString();
|
||||
qCDebug(dcDateTime) << " noon :" << m_noon.toString();
|
||||
qCDebug(dcDateTime) << " sunset :" << m_sunset.toString();
|
||||
qCDebug(dcDateTime) << " dusk :" << m_dusk.toString();
|
||||
qCDebug(dcDateTime) << "---------------------------------------------";
|
||||
// qCDebug(dcDateTime) << " dawn :" << m_dawn.toString();
|
||||
// qCDebug(dcDateTime) << " sunrise :" << m_sunrise.toString();
|
||||
// qCDebug(dcDateTime) << " noon :" << m_noon.toString();
|
||||
// qCDebug(dcDateTime) << " sunset :" << m_sunset.toString();
|
||||
// qCDebug(dcDateTime) << " dusk :" << m_dusk.toString();
|
||||
// qCDebug(dcDateTime) << "---------------------------------------------";
|
||||
|
||||
updateTimes();
|
||||
}
|
||||
@ -460,7 +460,7 @@ void DevicePluginDateTime::onSecondChanged()
|
||||
|
||||
void DevicePluginDateTime::onMinuteChanged(const QDateTime &dateTime)
|
||||
{
|
||||
qCDebug(dcDateTime) << "minute changed" << dateTime.toString();
|
||||
//qCDebug(dcDateTime) << "minute changed" << dateTime.toString();
|
||||
|
||||
// validate alerts
|
||||
foreach (Alarm *alarm, m_alarms.values()) {
|
||||
@ -470,7 +470,8 @@ void DevicePluginDateTime::onMinuteChanged(const QDateTime &dateTime)
|
||||
|
||||
void DevicePluginDateTime::onHourChanged(const QDateTime &dateTime)
|
||||
{
|
||||
qCDebug(dcDateTime) << "hour changed" << dateTime.toString();
|
||||
Q_UNUSED(dateTime)
|
||||
//qCDebug(dcDateTime) << "hour changed" << dateTime.toString();
|
||||
// check every hour in case we are offline in the wrong moment
|
||||
searchGeoLocation();
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#ifdef BLUETOOTH_LE
|
||||
|
||||
#include "aveabulb.h"
|
||||
#include "extern-plugininfo.h"
|
||||
|
||||
AveaBulb::AveaBulb(const QBluetoothDeviceInfo &deviceInfo, const QLowEnergyController::RemoteAddressType &addressType, QObject *parent) :
|
||||
BluetoothLowEnergyDevice(deviceInfo, addressType, parent),
|
||||
@ -46,12 +47,12 @@ bool AveaBulb::isAvailable()
|
||||
void AveaBulb::serviceScanFinished()
|
||||
{
|
||||
if (!controller()->services().contains(m_colorSeviceUuid)) {
|
||||
qWarning() << "ERROR: Color service not found for device" << name() << address().toString();
|
||||
qCWarning(dcElgato) << "ERROR: Color service not found for device" << name() << address().toString();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_colorService || m_imageService) {
|
||||
qWarning() << "ERROR: Attention! bad implementation of service handling!!";
|
||||
qCWarning(dcElgato) << "ERROR: Attention! bad implementation of service handling!!";
|
||||
return;
|
||||
}
|
||||
|
||||
@ -59,7 +60,7 @@ void AveaBulb::serviceScanFinished()
|
||||
m_colorService = controller()->createServiceObject(m_colorSeviceUuid, this);
|
||||
|
||||
if (!m_colorService) {
|
||||
qWarning() << "ERROR: could not create color service for device" << name() << address().toString();
|
||||
qCWarning(dcElgato) << "ERROR: could not create color service for device" << name() << address().toString();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -73,7 +74,7 @@ void AveaBulb::serviceScanFinished()
|
||||
m_imageService = controller()->createServiceObject(m_imageSeviceUuid, this);
|
||||
|
||||
if (!m_imageService) {
|
||||
qWarning() << "ERROR: could not create color service for device" << name() << address().toString();
|
||||
qCWarning(dcElgato) << "ERROR: could not create color service for device" << name() << address().toString();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -111,32 +112,32 @@ void AveaBulb::serviceStateChanged(const QLowEnergyService::ServiceState &state)
|
||||
switch (state) {
|
||||
case QLowEnergyService::DiscoveringServices:
|
||||
if (service->serviceUuid() == m_colorService->serviceUuid()) {
|
||||
qDebug() << "start discovering color service...";
|
||||
qCDebug(dcElgato) << "start discovering color service...";
|
||||
} else if (service->serviceUuid() == m_imageService->serviceUuid()) {
|
||||
qDebug() << "start discovering image service...";
|
||||
qCDebug(dcElgato) << "start discovering image service...";
|
||||
}
|
||||
break;
|
||||
case QLowEnergyService::ServiceDiscovered:
|
||||
// check which service is discovered
|
||||
if (service->serviceUuid() == m_colorService->serviceUuid()) {
|
||||
qDebug() << "...color service discovered.";
|
||||
qCDebug(dcElgato) << "...color service discovered.";
|
||||
|
||||
m_colorCharacteristic = m_colorService->characteristic(m_colorCharacteristicUuid);
|
||||
|
||||
if (!m_colorCharacteristic.isValid()) {
|
||||
qWarning() << "ERROR: color characteristc not found for device " << name() << address().toString();
|
||||
qCWarning(dcElgato) << "ERROR: color characteristc not found for device " << name() << address().toString();
|
||||
return;
|
||||
}
|
||||
|
||||
m_imageService->discoverDetails();
|
||||
}
|
||||
if (service->serviceUuid() == m_imageService->serviceUuid()) {
|
||||
qDebug() << "...image service discovered.";
|
||||
qCDebug(dcElgato) << "...image service discovered.";
|
||||
|
||||
m_imageCharacteristic = m_imageService->characteristic(m_imageCharacteristicUuid);
|
||||
|
||||
if (!m_imageCharacteristic.isValid()) {
|
||||
qWarning() << "ERROR: image characteristc not found for device " << name() << address().toString();
|
||||
qCWarning(dcElgato) << "ERROR: image characteristc not found for device " << name() << address().toString();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -153,19 +154,19 @@ void AveaBulb::serviceStateChanged(const QLowEnergyService::ServiceState &state)
|
||||
|
||||
void AveaBulb::serviceCharacteristicChanged(const QLowEnergyCharacteristic &characteristic, const QByteArray &value)
|
||||
{
|
||||
qDebug() << "service characteristic changed" << characteristic.name() << value.toHex();
|
||||
qCDebug(dcElgato) << "service characteristic changed" << characteristic.name() << value.toHex();
|
||||
}
|
||||
|
||||
void AveaBulb::confirmedCharacteristicWritten(const QLowEnergyCharacteristic &characteristic, const QByteArray &value)
|
||||
{
|
||||
if (characteristic.handle() == m_colorCharacteristic.handle()) {
|
||||
//qDebug() << "color char written successfully" << value.toHex();
|
||||
//qCDebug(dcElgato) << "color char written successfully" << value.toHex();
|
||||
if (m_actions.contains(value.toHex())) {
|
||||
ActionId actionId = m_actions.take(value.toHex());
|
||||
emit actionExecutionFinished(actionId, true);
|
||||
}
|
||||
} else if (characteristic.handle() == m_imageCharacteristic.handle()) {
|
||||
//qDebug() << "image char written successfully" << value.toHex();
|
||||
//qCDebug(dcElgato) << "image char written successfully" << value.toHex();
|
||||
if (m_actions.contains(value.toHex())) {
|
||||
ActionId actionId = m_actions.take(value.toHex());
|
||||
emit actionExecutionFinished(actionId, true);
|
||||
@ -174,7 +175,7 @@ void AveaBulb::confirmedCharacteristicWritten(const QLowEnergyCharacteristic &ch
|
||||
if (characteristic.uuid() == m_currentRequest.characteristic().uuid()) {
|
||||
if (m_commandQueue.isEmpty()) {
|
||||
m_queueRunning = false;
|
||||
//qDebug() << "queue finished";
|
||||
//qCDebug(dcElgato) << "queue finished";
|
||||
}
|
||||
sendNextCommand();
|
||||
}
|
||||
@ -182,7 +183,7 @@ void AveaBulb::confirmedCharacteristicWritten(const QLowEnergyCharacteristic &ch
|
||||
|
||||
void AveaBulb::confirmedDescriptorWritten(const QLowEnergyDescriptor &descriptor, const QByteArray &value)
|
||||
{
|
||||
qDebug() << "descriptor:" << descriptor.name() << "value:" << value.toHex() << "written successfully";
|
||||
qCDebug(dcElgato) << "descriptor:" << descriptor.name() << "value:" << value.toHex() << "written successfully";
|
||||
}
|
||||
|
||||
void AveaBulb::serviceError(const QLowEnergyService::ServiceError &error)
|
||||
@ -205,7 +206,7 @@ void AveaBulb::serviceError(const QLowEnergyService::ServiceError &error)
|
||||
break;
|
||||
}
|
||||
|
||||
qWarning() << "ERROR: color service of " << name() << address().toString() << ":" << errorString;
|
||||
qCWarning(dcElgato) << "ERROR: color service of " << name() << address().toString() << ":" << errorString;
|
||||
}
|
||||
|
||||
void AveaBulb::enqueueCommand(QLowEnergyService *service, const QLowEnergyCharacteristic &characteristic, const QByteArray &value)
|
||||
@ -224,7 +225,7 @@ void AveaBulb::sendNextCommand()
|
||||
if (m_commandQueue.isEmpty())
|
||||
return;
|
||||
|
||||
//qDebug() << "send next command";
|
||||
//qCDebug(dcElgato) << "send next command";
|
||||
m_queueRunning = true;
|
||||
m_currentRequest = m_commandQueue.dequeue();
|
||||
|
||||
|
||||
@ -152,10 +152,10 @@ DeviceManager::DeviceError DevicePluginElro::executeAction(Device *device, const
|
||||
|
||||
// send data to hardware resource
|
||||
if (transmitData(delay, rawData)) {
|
||||
qCDebug(dcElro) << "transmitted" << pluginName() << device->name() << "power: " << action.param("power").value().toBool();
|
||||
qCDebug(dcElro) << "Transmitted" << pluginName() << device->name() << "power: " << action.param("power").value().toBool();
|
||||
return DeviceManager::DeviceErrorNoError;
|
||||
} else {
|
||||
qCWarning(dcElro) << "could not transmitt" << pluginName() << device->name() << "power: " << action.param("power").value().toBool();
|
||||
qCWarning(dcElro) << "Could not transmitt" << pluginName() << device->name() << "power: " << action.param("power").value().toBool();
|
||||
return DeviceManager::DeviceErrorHardwareNotAvailable;
|
||||
}
|
||||
}
|
||||
@ -207,7 +207,7 @@ void DevicePluginElro::radioData(const QList<int> &rawData)
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(dcElro) << "ELRO understands this protocol: " << binCode;
|
||||
qCDebug(dcElro) << "Understands this protocol: " << binCode;
|
||||
|
||||
if (binCode.left(20) == "00000100000000000001") {
|
||||
if (binCode.right(4) == "0100") {
|
||||
@ -257,5 +257,5 @@ void DevicePluginElro::radioData(const QList<int> &rawData)
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(dcElro) << "Elro:" << group << buttonCode << power;
|
||||
qCDebug(dcElro) << group << buttonCode << power;
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ void DevicePluginEQ3::startMonitoringAutoDevices()
|
||||
|
||||
DeviceManager::DeviceSetupStatus DevicePluginEQ3::setupDevice(Device *device)
|
||||
{
|
||||
qCDebug(dcEQ3) << "setupDevice" << device->params();
|
||||
qCDebug(dcEQ3) << "Setup device" << device->params();
|
||||
|
||||
if(device->deviceClassId() == cubeDeviceClassId){
|
||||
foreach (MaxCube *cube, m_cubes.keys()) {
|
||||
@ -344,8 +344,6 @@ void DevicePluginEQ3::wallThermostatDataUpdated()
|
||||
device->setStateValue(deviceModeStringStateTypeId, wallThermostat->deviceModeString());
|
||||
device->setStateValue(desiredTemperatureStateTypeId, wallThermostat->setpointTemperature());
|
||||
device->setStateValue(currentTemperatureStateTypeId, wallThermostat->currentTemperature());
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ void DevicePluginKodi::deviceRemoved(Device *device)
|
||||
{
|
||||
Kodi *kodi = m_kodis.key(device);
|
||||
m_kodis.remove(kodi);
|
||||
qCDebug(dcKodi) << "delete " << device->paramValue("name");
|
||||
qCDebug(dcKodi) << "Delete " << device->paramValue("name");
|
||||
kodi->deleteLater();
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ DeviceManager::DeviceError DevicePluginKodi::discoverDevices(const DeviceClassId
|
||||
{
|
||||
Q_UNUSED(params)
|
||||
Q_UNUSED(deviceClassId)
|
||||
qCDebug(dcKodi) << "start UPnP search";
|
||||
qCDebug(dcKodi) << "Start UPnP search";
|
||||
upnpDiscover();
|
||||
return DeviceManager::DeviceErrorAsync;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ void KodiJsonHandler::sendData(const QString &method, const QVariantMap ¶ms,
|
||||
|
||||
void KodiJsonHandler::processNotification(const QString &method, const QVariantMap ¶ms)
|
||||
{
|
||||
qCDebug(dcKodi) << "got notification" << method;
|
||||
//qCDebug(dcKodi) << "got notification" << method;
|
||||
|
||||
if (method == "Application.OnVolumeChanged") {
|
||||
QVariantMap data = params.value("data").toMap();
|
||||
@ -66,7 +66,7 @@ void KodiJsonHandler::processNotification(const QString &method, const QVariantM
|
||||
void KodiJsonHandler::processActionResponse(const KodiReply &reply, const QVariantMap &response)
|
||||
{
|
||||
if (response.contains("error")) {
|
||||
qCDebug(dcKodi) << QJsonDocument::fromVariant(response).toJson();
|
||||
//qCDebug(dcKodi) << QJsonDocument::fromVariant(response).toJson();
|
||||
qCWarning(dcKodi) << "got error response for action" << reply.method() << ":" << response.value("error").toMap().value("message").toString();
|
||||
emit actionExecuted(reply.actionId(), false);
|
||||
} else {
|
||||
@ -77,12 +77,12 @@ void KodiJsonHandler::processActionResponse(const KodiReply &reply, const QVaria
|
||||
void KodiJsonHandler::processRequestResponse(const KodiReply &reply, const QVariantMap &response)
|
||||
{
|
||||
if (response.contains("error")) {
|
||||
qCDebug(dcKodi) << QJsonDocument::fromVariant(response).toJson();
|
||||
//qCDebug(dcKodi) << QJsonDocument::fromVariant(response).toJson();
|
||||
qCWarning(dcKodi) << "got error response for request " << reply.method() << ":" << response.value("error").toMap().value("message").toString();
|
||||
}
|
||||
|
||||
if (reply.method() == "Application.GetProperties") {
|
||||
qCDebug(dcKodi) << "got update response" << reply.method();
|
||||
//qCDebug(dcKodi) << "got update response" << reply.method();
|
||||
emit updateDataReceived(response.value("result").toMap());
|
||||
}
|
||||
|
||||
|
||||
@ -175,10 +175,10 @@ DeviceManager::DeviceError DevicePluginLeynew::executeAction(Device *device, con
|
||||
// =======================================
|
||||
// send data to hardware resource
|
||||
if(transmitData(delay, rawData, repetitions)){
|
||||
qCDebug(dcLeynew) << "transmitted" << pluginName() << device->name() << action.id();
|
||||
qCDebug(dcLeynew) << "Transmitted" << pluginName() << device->name() << action.id();
|
||||
return DeviceManager::DeviceErrorNoError;
|
||||
}else{
|
||||
qCWarning(dcLeynew) << "could not transmitt" << pluginName() << device->name() << action.id();
|
||||
qCWarning(dcLeynew) << "Could not transmitt" << pluginName() << device->name() << action.id();
|
||||
return DeviceManager::DeviceErrorHardwareNotAvailable;
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,6 +104,7 @@ DeviceManager::DeviceError DevicePluginLgSmartTv::discoverDevices(const DeviceCl
|
||||
if(deviceClassId != lgSmartTvDeviceClassId){
|
||||
return DeviceManager::DeviceErrorDeviceClassNotFound;
|
||||
}
|
||||
qCDebug(dcLgSmartTv) << "Start discovering";
|
||||
upnpDiscover("udap:rootservice","UDAP/2.0");
|
||||
return DeviceManager::DeviceErrorAsync;
|
||||
}
|
||||
@ -152,7 +153,7 @@ void DevicePluginLgSmartTv::deviceRemoved(Device *device)
|
||||
}
|
||||
|
||||
TvDevice *tvDevice= m_tvList.key(device);
|
||||
qCDebug(dcLgSmartTv) << "remove device" << device->paramValue("name").toString();
|
||||
qCDebug(dcLgSmartTv) << "Remove device" << device->paramValue("name").toString();
|
||||
unpairTvDevice(device);
|
||||
m_tvList.remove(tvDevice);
|
||||
delete tvDevice;
|
||||
@ -182,7 +183,7 @@ DeviceManager::DeviceError DevicePluginLgSmartTv::executeAction(Device *device,
|
||||
TvDevice * tvDevice = m_tvList.key(device);
|
||||
|
||||
if (!tvDevice->reachable()) {
|
||||
qCWarning(dcLgSmartTv) << "not reachable";
|
||||
qCWarning(dcLgSmartTv) << "Device not reachable";
|
||||
return DeviceManager::DeviceErrorHardwareNotAvailable;
|
||||
}
|
||||
|
||||
@ -324,11 +325,11 @@ void DevicePluginLgSmartTv::networkManagerReplyReady(QNetworkReply *reply)
|
||||
Device *device = m_asyncSetup.take(reply);
|
||||
TvDevice *tv = m_tvList.key(device);
|
||||
if(status != 200) {
|
||||
qCWarning(dcLgSmartTv) << "pair TV request error:" << status << reply->errorString();
|
||||
qCWarning(dcLgSmartTv) << "Pair TV request error:" << status << reply->errorString();
|
||||
tv->setPaired(false);
|
||||
emit deviceSetupFinished(device, DeviceManager::DeviceSetupStatusFailure);
|
||||
} else {
|
||||
qCDebug(dcLgSmartTv) << "paired TV successfully.";
|
||||
qCDebug(dcLgSmartTv) << "Paired TV successfully.";
|
||||
tv->setPaired(true);
|
||||
refreshTv(device);
|
||||
emit deviceSetupFinished(device, DeviceManager::DeviceSetupStatusSuccess);
|
||||
@ -336,16 +337,16 @@ void DevicePluginLgSmartTv::networkManagerReplyReady(QNetworkReply *reply)
|
||||
} else if (m_deleteTv.contains(reply)) {
|
||||
m_deleteTv.removeAll(reply);
|
||||
if(status != 200) {
|
||||
qCWarning(dcLgSmartTv) << "end pairing TV (device deleted) request error:" << status << reply->errorString();
|
||||
qCWarning(dcLgSmartTv) << "Rnd pairing TV (device deleted) request error:" << status << reply->errorString();
|
||||
} else {
|
||||
qCDebug(dcLgSmartTv) << "end pairing TV (device deleted) successfully.";
|
||||
qCDebug(dcLgSmartTv) << "End pairing TV (device deleted) successfully.";
|
||||
}
|
||||
} else if (m_volumeInfoRequests.keys().contains(reply)) {
|
||||
Device *device = m_volumeInfoRequests.take(reply);
|
||||
TvDevice *tv = m_tvList.key(device);
|
||||
if(status != 200) {
|
||||
tv->setReachable(false);
|
||||
qCWarning(dcLgSmartTv) << "volume information request error:" << status << reply->errorString();
|
||||
qCWarning(dcLgSmartTv) << "Volume information request error:" << status << reply->errorString();
|
||||
} else {
|
||||
tv->setReachable(true);
|
||||
tv->onVolumeInformationUpdate(reply->readAll());
|
||||
@ -355,7 +356,7 @@ void DevicePluginLgSmartTv::networkManagerReplyReady(QNetworkReply *reply)
|
||||
TvDevice *tv = m_tvList.key(device);
|
||||
if(status != 200) {
|
||||
tv->setReachable(false);
|
||||
qCWarning(dcLgSmartTv) << "channel information request error:" << status << reply->errorString();
|
||||
qCWarning(dcLgSmartTv) << "Channel information request error:" << status << reply->errorString();
|
||||
} else {
|
||||
tv->setReachable(true);
|
||||
tv->onChannelInformationUpdate(reply->readAll());
|
||||
@ -364,7 +365,7 @@ void DevicePluginLgSmartTv::networkManagerReplyReady(QNetworkReply *reply)
|
||||
ActionId actionId = m_asyncActions.value(reply);
|
||||
if(status != 200) {
|
||||
emit actionExecutionFinished(actionId, DeviceManager::DeviceErrorHardwareNotAvailable);
|
||||
qCWarning(dcLgSmartTv) << "action request error:" << status << reply->errorString();
|
||||
qCWarning(dcLgSmartTv) << "Action request error:" << status << reply->errorString();
|
||||
} else {
|
||||
emit actionExecutionFinished(actionId, DeviceManager::DeviceErrorNoError);
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ QString TvDevice::printXmlData(const QByteArray &data)
|
||||
|
||||
void TvDevice::eventOccured(const QByteArray &data)
|
||||
{
|
||||
qCDebug(dcLgSmartTv) << "event handler data received" << printXmlData(data);
|
||||
qCDebug(dcLgSmartTv) << "Event handler data received" << printXmlData(data);
|
||||
|
||||
// if we got a channel changed event...
|
||||
if(data.contains("ChannelChanged")) {
|
||||
@ -317,7 +317,7 @@ void TvDevice::eventOccured(const QByteArray &data)
|
||||
// if the tv suspends, it will send a byebye message, which means
|
||||
// the pairing will be closed.
|
||||
if(data.contains("api type=\"pairing\"") && data.contains("byebye")) {
|
||||
qCDebug(dcLgSmartTv) << "ended pairing (host)";
|
||||
qCDebug(dcLgSmartTv) << "Ended pairing (host)";
|
||||
setPaired(false);
|
||||
setReachable(false);
|
||||
return;
|
||||
|
||||
@ -34,7 +34,7 @@ void TvEventHandler::incomingConnection(qintptr socket)
|
||||
{
|
||||
QTcpSocket* tcpSocket = new QTcpSocket(this);
|
||||
tcpSocket->setSocketDescriptor(socket);
|
||||
qCDebug(dcLgSmartTv) << "event handler -> incoming connection" << tcpSocket->peerAddress().toString() << tcpSocket->peerName();
|
||||
qCDebug(dcLgSmartTv) << "Event handler -> incoming connection" << tcpSocket->peerAddress().toString() << tcpSocket->peerName();
|
||||
|
||||
connect(tcpSocket, &QTcpSocket::readyRead, this, &TvEventHandler::readClient);
|
||||
connect(tcpSocket, &QTcpSocket::disconnected, this, &TvEventHandler::onDisconnected);
|
||||
@ -48,7 +48,7 @@ void TvEventHandler::readClient()
|
||||
if(socket->peerAddress() != m_host){
|
||||
socket->close();
|
||||
socket->deleteLater();
|
||||
qCWarning(dcLgSmartTv) << "event handler -> rejecting connection from " << socket->peerAddress().toString();
|
||||
qCWarning(dcLgSmartTv) << "Event handler -> rejecting connection from " << socket->peerAddress().toString();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ DevicePluginLircd::DevicePluginLircd()
|
||||
{
|
||||
m_lircClient = new LircClient(this);
|
||||
|
||||
m_lircClient->connect();
|
||||
//m_lircClient->connect();
|
||||
connect(m_lircClient, &LircClient::buttonPressed, this, &DevicePluginLircd::buttonPressed);
|
||||
}
|
||||
|
||||
|
||||
@ -294,7 +294,7 @@ void SmtpClient::setRecipient(const QString &rcpt)
|
||||
|
||||
void SmtpClient::socketError(QAbstractSocket::SocketError error)
|
||||
{
|
||||
qCWarning(dcMailNotification) << "ERROR: mail socket -> " << error << m_socket->errorString();
|
||||
qCWarning(dcMailNotification) << "Mail socket -> " << error << m_socket->errorString();
|
||||
}
|
||||
|
||||
void SmtpClient::send(const QString &data)
|
||||
|
||||
@ -341,7 +341,7 @@ void DevicePluginOpenweathermap::processWeatherData(const QByteArray &data, Devi
|
||||
QJsonParseError error;
|
||||
QJsonDocument jsonDoc = QJsonDocument::fromJson(data, &error);
|
||||
|
||||
qCDebug(dcOpenWeatherMap) << jsonDoc.toJson();
|
||||
//qCDebug(dcOpenWeatherMap) << jsonDoc.toJson();
|
||||
|
||||
if (error.error != QJsonParseError::NoError) {
|
||||
qCWarning(dcOpenWeatherMap) << "failed to parse weather data for device " << device->name() << ": " << data << ":" << error.errorString();
|
||||
|
||||
@ -66,7 +66,7 @@ DeviceManager::DeviceSetupStatus DevicePluginOsdomotics::setupDevice(Device *dev
|
||||
{
|
||||
|
||||
if (device->deviceClassId() == rplRouterDeviceClassId) {
|
||||
qCDebug(dcOsdomotics) << "setup RPL router" << device->paramValue("host").toString();
|
||||
qCDebug(dcOsdomotics) << "Setup RPL router" << device->paramValue("host").toString();
|
||||
QHostAddress address(device->paramValue("host").toString());
|
||||
|
||||
if (address.isNull()) {
|
||||
@ -83,7 +83,7 @@ DeviceManager::DeviceSetupStatus DevicePluginOsdomotics::setupDevice(Device *dev
|
||||
|
||||
return DeviceManager::DeviceSetupStatusAsync;
|
||||
} else if (device->deviceClassId() == merkurNodeDeviceClassId) {
|
||||
qCDebug(dcOsdomotics) << "setup Merkur node" << device->paramValue("host").toString();
|
||||
qCDebug(dcOsdomotics) << "Setup Merkur node" << device->paramValue("host").toString();
|
||||
device->setParentId(DeviceId(device->paramValue("router id").toString()));
|
||||
return DeviceManager::DeviceSetupStatusSuccess;
|
||||
}
|
||||
@ -215,7 +215,7 @@ void DevicePluginOsdomotics::parseNodes(Device *device, const QByteArray &data)
|
||||
url.setHost(nodeAddress.toString());
|
||||
url.setPath("/.well-known/core");
|
||||
|
||||
qCDebug(dcOsdomotics) << "discover node on" << url.toString();
|
||||
qCDebug(dcOsdomotics) << "Discover node on" << url.toString();
|
||||
|
||||
CoapReply *reply = m_coap->get(CoapRequest(url));
|
||||
if (reply->isFinished()) {
|
||||
|
||||
@ -552,7 +552,7 @@ void DevicePluginPhilipsHue::processInformationResponse(PairingInfo *pairingInfo
|
||||
QJsonParseError error;
|
||||
QJsonDocument jsonDoc = QJsonDocument::fromJson(data, &error);
|
||||
|
||||
qCDebug(dcPhilipsHue) << "Process information response" << pairingInfo->host().toString() << pairingInfo->apiKey();
|
||||
//qCDebug(dcPhilipsHue) << "Process information response" << pairingInfo->host().toString() << pairingInfo->apiKey();
|
||||
|
||||
// check JSON error
|
||||
if (error.error != QJsonParseError::NoError) {
|
||||
|
||||
@ -70,7 +70,7 @@ DeviceManager::HardwareResources DevicePluginWakeOnLan::requiredHardware() const
|
||||
DeviceManager::DeviceError DevicePluginWakeOnLan::executeAction(Device *device, const Action &action)
|
||||
{
|
||||
if(action.actionTypeId() == wolActionTypeId){
|
||||
qCDebug(dcWakeOnLan) << "wake up" << device->name();
|
||||
qCDebug(dcWakeOnLan) << "Wake up" << device->name();
|
||||
wakeup(device->paramValue("mac").toString());
|
||||
}
|
||||
return DeviceManager::DeviceErrorNoError;
|
||||
@ -83,7 +83,7 @@ void DevicePluginWakeOnLan::wakeup(QString mac)
|
||||
for(int i = 0; i < 16; ++i) {
|
||||
packet.append(QByteArray::fromHex(mac.remove(':').toLocal8Bit()));
|
||||
}
|
||||
qCDebug(dcWakeOnLan) << "created magic packet:" << packet.toHex();
|
||||
qCDebug(dcWakeOnLan) << "Created magic packet:" << packet.toHex();
|
||||
QUdpSocket udpSocket;
|
||||
udpSocket.writeDatagram(packet.data(), packet.size(), QHostAddress::Broadcast, 9);
|
||||
}
|
||||
|
||||
@ -300,7 +300,7 @@ HttpReply *DevicesResource::removeDevice(Device *device, const QVariantMap ¶
|
||||
if (!status.second.isEmpty()) {
|
||||
QVariantList ruleIdList;
|
||||
QVariantMap returns;
|
||||
returns.insert("deviceError", JsonTypes::deviceErrorToString(status.first));
|
||||
returns.insert("error", JsonTypes::deviceErrorToString(status.first));
|
||||
|
||||
foreach (const RuleId &ruleId, status.second) {
|
||||
ruleIdList.append(ruleId.toString());
|
||||
|
||||
@ -258,6 +258,7 @@ void TestRestDeviceClasses::discoverDevices()
|
||||
}
|
||||
|
||||
QNetworkRequest request(url);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
QNetworkReply *reply = nam->get(request);
|
||||
clientSpy.wait();
|
||||
QCOMPARE(clientSpy.count(), 1);
|
||||
@ -276,25 +277,25 @@ void TestRestDeviceClasses::discoverDevices()
|
||||
QVariantList foundDevices = jsonDoc.toVariant().toList();
|
||||
QCOMPARE(foundDevices.count(), resultCount);
|
||||
|
||||
qDebug() << jsonDoc.toJson();
|
||||
//qDebug() << jsonDoc.toJson();
|
||||
|
||||
// ADD the discovered device
|
||||
request.setUrl(QUrl("http://localhost:3333/api/v1/devices"));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
DeviceDescriptorId descriptorId = DeviceDescriptorId(foundDevices.first().toMap().value("id").toString());
|
||||
qDebug() << descriptorId;
|
||||
//qDebug() << descriptorId;
|
||||
params.clear();
|
||||
params.insert("deviceClassId", deviceClassId);
|
||||
params.insert("deviceDescriptorId", descriptorId.toString());
|
||||
|
||||
clientSpy.clear();
|
||||
QByteArray payload = QJsonDocument::fromVariant(params).toJson(QJsonDocument::Compact);
|
||||
qDebug() << payload;
|
||||
//qDebug() << payload;
|
||||
reply = nam->post(request, payload);
|
||||
clientSpy.wait();
|
||||
QCOMPARE(clientSpy.count(), 1);
|
||||
data = reply->readAll();
|
||||
qDebug() << data;
|
||||
//qDebug() << data;
|
||||
|
||||
statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
QCOMPARE(statusCode, expectedStatusCode);
|
||||
@ -309,7 +310,7 @@ void TestRestDeviceClasses::discoverDevices()
|
||||
// REMOVE added device
|
||||
|
||||
request = QNetworkRequest(QUrl(QString("http://localhost:3333/api/v1/devices/%1").arg(deviceId.toString())));
|
||||
qDebug() << request.url().toString();
|
||||
//qDebug() << request.url().toString();
|
||||
clientSpy.clear();
|
||||
reply = nam->deleteResource(request);
|
||||
clientSpy.wait();
|
||||
|
||||
@ -184,8 +184,8 @@ void TestRestDevices::addConfiguredDevice()
|
||||
|
||||
// Get all devices
|
||||
QNetworkRequest request;
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
request.setUrl(QUrl("http://localhost:3333/api/v1/devices"));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
QByteArray payload = QJsonDocument::fromVariant(params).toJson(QJsonDocument::Compact);
|
||||
qDebug() << "sending" << payload;
|
||||
@ -212,6 +212,7 @@ void TestRestDevices::addConfiguredDevice()
|
||||
QVERIFY2(!deviceId.isNull(),"invalid device id for removing");
|
||||
|
||||
request.setUrl(QUrl(QString("http://localhost:3333/api/v1/devices/%1").arg(deviceId.toString())));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->deleteResource(request);
|
||||
clientSpy.wait();
|
||||
@ -262,6 +263,7 @@ void TestRestDevices::addPushButtonDevices()
|
||||
|
||||
clientSpy.clear();
|
||||
QNetworkRequest request(url);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
QNetworkReply *reply = nam->get(request);
|
||||
clientSpy.wait();
|
||||
QCOMPARE(clientSpy.count(), 1);
|
||||
@ -285,6 +287,7 @@ void TestRestDevices::addPushButtonDevices()
|
||||
params.insert("deviceDescriptorId", deviceDescriptoId);
|
||||
|
||||
QNetworkRequest pairRequest(QUrl("http://localhost:3333/api/v1/devices/pair"));
|
||||
pairRequest.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->post(pairRequest, QJsonDocument::fromVariant(params).toJson(QJsonDocument::Compact));
|
||||
clientSpy.wait();
|
||||
@ -311,6 +314,7 @@ void TestRestDevices::addPushButtonDevices()
|
||||
params.insert("pairingTransactionId", pairingTransactionId.toString());
|
||||
|
||||
QNetworkRequest confirmPairingRequest(QUrl("http://localhost:3333/api/v1/devices/confirmpairing"));
|
||||
confirmPairingRequest.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->post(confirmPairingRequest, QJsonDocument::fromVariant(params).toJson(QJsonDocument::Compact));
|
||||
clientSpy.wait();
|
||||
@ -327,6 +331,7 @@ void TestRestDevices::addPushButtonDevices()
|
||||
DeviceId deviceId(jsonDoc.toVariant().toMap().value("id").toString());
|
||||
// delete it
|
||||
request.setUrl(QUrl(QString("http://localhost:3333/api/v1/devices/%1").arg(deviceId.toString())));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->deleteResource(request);
|
||||
clientSpy.wait();
|
||||
@ -377,6 +382,7 @@ void TestRestDevices::addDisplayPinDevices()
|
||||
|
||||
clientSpy.clear();
|
||||
QNetworkRequest request(url);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
QNetworkReply *reply = nam->get(request);
|
||||
clientSpy.wait();
|
||||
QCOMPARE(clientSpy.count(), 1);
|
||||
@ -400,6 +406,7 @@ void TestRestDevices::addDisplayPinDevices()
|
||||
params.insert("deviceDescriptorId", deviceDescriptoId);
|
||||
|
||||
QNetworkRequest pairRequest(QUrl("http://localhost:3333/api/v1/devices/pair"));
|
||||
pairRequest.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->post(pairRequest, QJsonDocument::fromVariant(params).toJson(QJsonDocument::Compact));
|
||||
clientSpy.wait();
|
||||
@ -423,6 +430,7 @@ void TestRestDevices::addDisplayPinDevices()
|
||||
params.insert("secret", secret);
|
||||
|
||||
QNetworkRequest confirmPairingRequest(QUrl("http://localhost:3333/api/v1/devices/confirmpairing"));
|
||||
confirmPairingRequest.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->post(confirmPairingRequest, QJsonDocument::fromVariant(params).toJson(QJsonDocument::Compact));
|
||||
clientSpy.wait();
|
||||
@ -439,6 +447,7 @@ void TestRestDevices::addDisplayPinDevices()
|
||||
DeviceId deviceId(jsonDoc.toVariant().toMap().value("id").toString());
|
||||
// delete it
|
||||
request.setUrl(QUrl(QString("http://localhost:3333/api/v1/devices/%1").arg(deviceId.toString())));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->deleteResource(request);
|
||||
clientSpy.wait();
|
||||
@ -491,6 +500,7 @@ void TestRestDevices::executeAction()
|
||||
payloadMap.insert("params", actionParams);
|
||||
|
||||
QNetworkRequest request(QUrl(QString("http://localhost:3333/api/v1/devices/%1/execute/%2").arg(deviceId.toString()).arg(actionTypeId.toString())));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
spy.clear();
|
||||
QNetworkReply *reply = nam.post(request, QJsonDocument::fromVariant(payloadMap).toJson(QJsonDocument::Compact));
|
||||
spy.wait();
|
||||
@ -503,6 +513,7 @@ void TestRestDevices::executeAction()
|
||||
// Fetch action execution history from mock device
|
||||
spy.clear();
|
||||
request = QNetworkRequest(QUrl(QString("http://localhost:%1/actionhistory").arg(m_mockDevice1Port)));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
reply = nam.get(request);
|
||||
spy.wait();
|
||||
QCOMPARE(spy.count(), 1);
|
||||
@ -512,6 +523,7 @@ void TestRestDevices::executeAction()
|
||||
// cleanup for the next run
|
||||
spy.clear();
|
||||
request.setUrl(QUrl(QString("http://localhost:%1/clearactionhistory").arg(m_mockDevice1Port)));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
reply = nam.get(request);
|
||||
spy.wait();
|
||||
QCOMPARE(spy.count(), 1);
|
||||
@ -519,6 +531,7 @@ void TestRestDevices::executeAction()
|
||||
|
||||
spy.clear();
|
||||
request.setUrl(QUrl(QString("http://localhost:%1/actionhistory").arg(m_mockDevice1Port)));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
reply = nam.get(request);
|
||||
spy.wait();
|
||||
QCOMPARE(spy.count(), 1);
|
||||
@ -552,6 +565,7 @@ void TestRestDevices::getStateValue()
|
||||
QSignalSpy clientSpy(nam, SIGNAL(finished(QNetworkReply*)));
|
||||
|
||||
QNetworkRequest request;
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
|
||||
if (!stateTypeId.isNull()) {
|
||||
request.setUrl(QUrl(QString("http://localhost:3333/api/v1/devices/%1/states/%2").arg(deviceId.toString()).arg(stateTypeId.toString())));
|
||||
@ -651,6 +665,7 @@ void TestRestDevices::editDevices()
|
||||
QSignalSpy clientSpy(nam, SIGNAL(finished(QNetworkReply*)));
|
||||
|
||||
QNetworkRequest request(QUrl(QString("http://localhost:3333/api/v1/devices")));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
|
||||
QNetworkReply *reply = nam->post(request, QJsonDocument::fromVariant(params).toJson(QJsonDocument::Compact));
|
||||
clientSpy.wait();
|
||||
@ -674,6 +689,7 @@ void TestRestDevices::editDevices()
|
||||
editParams.insert("deviceParams", newDeviceParams);
|
||||
|
||||
request.setUrl(QUrl(QString("http://localhost:3333/api/v1/devices/%1").arg(deviceId.toString())));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->put(request, QJsonDocument::fromVariant(editParams).toJson(QJsonDocument::Compact));
|
||||
clientSpy.wait();
|
||||
@ -684,8 +700,8 @@ void TestRestDevices::editDevices()
|
||||
|
||||
// if the edit should have been successfull
|
||||
if (expectedStatusCode == 200) {
|
||||
|
||||
request.setUrl(QUrl(QString("http://localhost:3333/api/v1/devices/%1").arg(deviceId.toString())));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->get(request);
|
||||
clientSpy.wait();
|
||||
@ -702,6 +718,7 @@ void TestRestDevices::editDevices()
|
||||
|
||||
// delete it
|
||||
request.setUrl(QUrl(QString("http://localhost:3333/api/v1/devices/%1").arg(deviceId.toString())));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
clientSpy.clear();
|
||||
reply = nam->deleteResource(request);
|
||||
clientSpy.wait();
|
||||
@ -752,6 +769,7 @@ void TestRestDevices::editByDiscovery()
|
||||
|
||||
clientSpy.clear();
|
||||
QNetworkRequest request(url);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
QNetworkReply *reply = nam->get(request);
|
||||
clientSpy.wait();
|
||||
QCOMPARE(clientSpy.count(), 1);
|
||||
@ -769,6 +787,7 @@ void TestRestDevices::editByDiscovery()
|
||||
|
||||
// add Discovered Device 1 port 55555
|
||||
request.setUrl(QUrl("http://localhost:3333/api/v1/devices"));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
DeviceDescriptorId descriptorId1;
|
||||
foreach (const QVariant &descriptor, foundDevices) {
|
||||
// find the device with port 55555
|
||||
@ -810,6 +829,7 @@ void TestRestDevices::editByDiscovery()
|
||||
query2.addQueryItem("params", QJsonDocument::fromVariant(discoveryParams).toJson(QJsonDocument::Compact));
|
||||
url.setQuery(query2);
|
||||
request = QNetworkRequest(url);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
reply = nam->get(request);
|
||||
clientSpy.wait();
|
||||
QCOMPARE(clientSpy.count(), 1);
|
||||
@ -842,6 +862,7 @@ void TestRestDevices::editByDiscovery()
|
||||
params.insert("deviceDescriptorId", descriptorId2);
|
||||
|
||||
request = QNetworkRequest(QUrl(QString("http://localhost:3333/api/v1/devices/%1").arg(deviceId.toString())));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "text/json");
|
||||
|
||||
clientSpy.clear();
|
||||
payload = QJsonDocument::fromVariant(params).toJson(QJsonDocument::Compact);
|
||||
|
||||
@ -99,7 +99,6 @@ void TestWebSocketServer::pingTest()
|
||||
socket->deleteLater();
|
||||
}
|
||||
|
||||
|
||||
void TestWebSocketServer::testBasicCall_data()
|
||||
{
|
||||
QTest::addColumn<QByteArray>("data");
|
||||
@ -142,7 +141,6 @@ void TestWebSocketServer::introspect()
|
||||
|
||||
QVariant TestWebSocketServer::injectSocketAndWait(const QString &method, const QVariantMap ¶ms)
|
||||
{
|
||||
|
||||
QVariantMap call;
|
||||
call.insert("id", m_socketCommandId);
|
||||
call.insert("method", method);
|
||||
|
||||
Reference in New Issue
Block a user