Added missing json document compilation to states retrieval. (#321)

This commit is contained in:
ntim 2016-12-09 22:26:19 +01:00 committed by redPanther
parent 9f6edc0296
commit 2410c6021e
1 changed files with 2 additions and 1 deletions

View File

@ -338,7 +338,6 @@ void LedDevicePhilipsHue::saveStates(unsigned int nLights)
response = get("lights");
// Use QJsonDocument to parse reponse.
reader = QJsonDocument::fromJson(response, &error);
if (error.error != QJsonParseError::NoError)
{
throw std::runtime_error(("No lights found at " + getUrl("lights")).toStdString());
@ -374,6 +373,8 @@ void LedDevicePhilipsHue::saveStates(unsigned int nLights)
break;
}
json = reader.object();
// Get state object values which are subject to change.
QJsonObject state;
if (!json.contains("state"))