mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Removed saving of model ids. Save the corresponding color triangles instead for speedup.
Former-commit-id: 72e6031234e12a488a5425e80e73dc8b03ec364f
This commit is contained in:
parent
f5a8174783
commit
9269b0a1e3
@ -122,6 +122,7 @@ CGTriangle LedDevicePhilipsHue::getTriangle(QString modelId) {
|
|||||||
void LedDevicePhilipsHue::saveStates(unsigned int nLights) {
|
void LedDevicePhilipsHue::saveStates(unsigned int nLights) {
|
||||||
// Clear saved light states.
|
// Clear saved light states.
|
||||||
states.clear();
|
states.clear();
|
||||||
|
triangles.clear();
|
||||||
// Use json parser to parse reponse.
|
// Use json parser to parse reponse.
|
||||||
Json::Reader reader;
|
Json::Reader reader;
|
||||||
Json::FastWriter writer;
|
Json::FastWriter writer;
|
||||||
@ -142,12 +143,11 @@ void LedDevicePhilipsHue::saveStates(unsigned int nLights) {
|
|||||||
state["xy"] = json["state"]["xy"];
|
state["xy"] = json["state"]["xy"];
|
||||||
state["bri"] = json["state"]["bri"];
|
state["bri"] = json["state"]["bri"];
|
||||||
}
|
}
|
||||||
// Save id.
|
|
||||||
ids.push_back(QString(writer.write(json["modelid"]).c_str()).trimmed().replace("\"", ""));
|
|
||||||
// Save state object.
|
// Save state object.
|
||||||
states.push_back(QString(writer.write(state).c_str()).trimmed());
|
states.push_back(QString(writer.write(state).c_str()).trimmed());
|
||||||
// Determine triangle.
|
// Determine triangle.
|
||||||
triangles.push_back(getTriangle(ids.back()));
|
QString modelId = QString(writer.write(json["modelid"]).c_str()).trimmed().replace("\"", "");
|
||||||
|
triangles.push_back(getTriangle(modelId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,6 +165,7 @@ void LedDevicePhilipsHue::restoreStates() {
|
|||||||
}
|
}
|
||||||
// Clear saved light states.
|
// Clear saved light states.
|
||||||
states.clear();
|
states.clear();
|
||||||
|
triangles.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LedDevicePhilipsHue::areStatesSaved() {
|
bool LedDevicePhilipsHue::areStatesSaved() {
|
||||||
|
@ -65,8 +65,6 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
/// Array to save the light states.
|
/// Array to save the light states.
|
||||||
std::vector<QString> states;
|
std::vector<QString> states;
|
||||||
/// Array to save model ids.
|
|
||||||
std::vector<QString> ids;
|
|
||||||
/// Color triangles.
|
/// Color triangles.
|
||||||
std::vector<CGTriangle> triangles;
|
std::vector<CGTriangle> triangles;
|
||||||
/// Ip address of the bridge
|
/// Ip address of the bridge
|
||||||
|
Loading…
Reference in New Issue
Block a user