Fix Philip Hue APIv2 support without Entertainment group defined (#1743)

This commit is contained in:
LordGrey
2024-05-21 19:37:43 +02:00
committed by GitHub
parent 4a5b0b6bf2
commit e6714b21f9
5 changed files with 40 additions and 21 deletions

View File

@@ -30,7 +30,8 @@ enum HttpStatusCode {
BadRequest = 400,
UnAuthorized = 401,
Forbidden = 403,
NotFound = 404
NotFound = 404,
TooManyRequests = 429
};
} //End of constants
@@ -336,6 +337,15 @@ httpResponse ProviderRestApi::getResponse(QNetworkReply* const& reply)
case HttpStatusCode::NotFound:
advise = "Check Resource given";
break;
case HttpStatusCode::TooManyRequests:
{
QString retryAfterTime = response.getHeader("Retry-After");
if (!retryAfterTime.isEmpty())
{
advise = "Retry-After: " + response.getHeader("Retry-After");
}
}
break;
default:
advise = httpReason;
break;