Shelly: Mark devices offline on any polling network error

This commit is contained in:
Michael Zanetti 2023-05-22 22:04:19 +02:00
parent 4acddd2219
commit 53f59049a4

View File

@ -1305,7 +1305,7 @@ void IntegrationPluginShelly::fetchStatusGen1(Thing *thing)
connect(reply, &QNetworkReply::finished, thing, [this, thing, reply](){
if (reply->error() != QNetworkReply::NoError) {
qCWarning(dcShelly()) << "Unable to update status for" << thing->name() << reply->error() << reply->errorString();
if (reply->error() == QNetworkReply::HostNotFoundError && !thing->hasState("batteryLevel")) {
if (!thing->hasState("batteryLevel")) {
thing->setStateValue("connected", false);
foreach (Thing *child, myThings().filterByParentId(thing->id())) {
child->setStateValue("connected", false);