mirror of
https://github.com/nymea/nymea-plugins.git
synced 2026-07-17 00:36:35 +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.";
|
||||
tv->setPaired(true);
|
||||
loadAppList(thing);
|
||||
|
||||
refreshTv(thing);
|
||||
}
|
||||
});
|
||||
@ -450,8 +449,12 @@ void IntegrationPluginLgSmartTv::refreshTv(Thing *thing)
|
||||
connect(reply, &QNetworkReply::finished, this, [=](){
|
||||
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
if (status != 200) {
|
||||
tv->setReachable(false);
|
||||
qCWarning(dcLgSmartTv) << "Refresh tv information request error:" << status << reply->errorString();
|
||||
if (status == 401) {
|
||||
pairTvDevice(thing);
|
||||
} else {
|
||||
tv->setReachable(false);
|
||||
qCWarning(dcLgSmartTv) << "Refresh tv information request error:" << status << reply->errorString();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user