Nanoleaf: Check for connection error before accessing status/body. Closes #4390

This commit is contained in:
morg
2024-10-30 23:14:40 +00:00
committed by Adam Honse
parent 43bd3774e8
commit 8b9f128881
2 changed files with 26 additions and 11 deletions

View File

@@ -41,7 +41,7 @@ void DetectNanoleafControllers()
}
catch(...)
{
LOG_DEBUG("[Nanoleaf] Could not connect to device at %s:%s using auth_token %s", device["ip"].get<std::string>().c_str(), device["port"].get<std::string>().c_str(), device["auth_token"].get<std::string>().c_str());
LOG_DEBUG("[Nanoleaf] Could not connect to device at %s:%d using auth_token %s", device["ip"].get<std::string>().c_str(), device["port"].get<int>(), device["auth_token"].get<std::string>().c_str());
}
}
}