mirror of
https://github.com/nymea/nymea-plugins.git
synced 2026-10-23 14:43:44 +02:00
Add authorization required return value on reconnect
This commit is contained in:
parent
40a435ee9c
commit
56d7ef3652
@ -413,7 +413,6 @@ void IntegrationPluginLgSmartTv::pairTvDevice(Thing *thing)
|
|||||||
qCDebug(dcLgSmartTv) << "Paired TV successfully.";
|
qCDebug(dcLgSmartTv) << "Paired TV successfully.";
|
||||||
tv->setPaired(true);
|
tv->setPaired(true);
|
||||||
loadAppList(thing);
|
loadAppList(thing);
|
||||||
|
|
||||||
refreshTv(thing);
|
refreshTv(thing);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -450,8 +449,12 @@ void IntegrationPluginLgSmartTv::refreshTv(Thing *thing)
|
|||||||
connect(reply, &QNetworkReply::finished, this, [=](){
|
connect(reply, &QNetworkReply::finished, this, [=](){
|
||||||
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||||
if (status != 200) {
|
if (status != 200) {
|
||||||
tv->setReachable(false);
|
if (status == 401) {
|
||||||
qCWarning(dcLgSmartTv) << "Refresh tv information request error:" << status << reply->errorString();
|
pairTvDevice(thing);
|
||||||
|
} else {
|
||||||
|
tv->setReachable(false);
|
||||||
|
qCWarning(dcLgSmartTv) << "Refresh tv information request error:" << status << reply->errorString();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user