This repository was archived by the owner on May 6, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ CGTriangle LedDevicePhilipsHue::getTriangle(QString modelId) {
122
122
void LedDevicePhilipsHue::saveStates (unsigned int nLights) {
123
123
// Clear saved light states.
124
124
states.clear ();
125
+ triangles.clear ();
125
126
// Use json parser to parse reponse.
126
127
Json::Reader reader;
127
128
Json::FastWriter writer;
@@ -142,12 +143,11 @@ void LedDevicePhilipsHue::saveStates(unsigned int nLights) {
142
143
state[" xy" ] = json[" state" ][" xy" ];
143
144
state[" bri" ] = json[" state" ][" bri" ];
144
145
}
145
- // Save id.
146
- ids.push_back (QString (writer.write (json[" modelid" ]).c_str ()).trimmed ().replace (" \" " , " " ));
147
146
// Save state object.
148
147
states.push_back (QString (writer.write (state).c_str ()).trimmed ());
149
148
// Determine triangle.
150
- triangles.push_back (getTriangle (ids.back ()));
149
+ QString modelId = QString (writer.write (json[" modelid" ]).c_str ()).trimmed ().replace (" \" " , " " );
150
+ triangles.push_back (getTriangle (modelId));
151
151
}
152
152
}
153
153
@@ -165,6 +165,7 @@ void LedDevicePhilipsHue::restoreStates() {
165
165
}
166
166
// Clear saved light states.
167
167
states.clear ();
168
+ triangles.clear ();
168
169
}
169
170
170
171
bool LedDevicePhilipsHue::areStatesSaved () {
Original file line number Diff line number Diff line change @@ -65,8 +65,6 @@ private slots:
65
65
private:
66
66
// / Array to save the light states.
67
67
std::vector<QString> states;
68
- // / Array to save model ids.
69
- std::vector<QString> ids;
70
68
// / Color triangles.
71
69
std::vector<CGTriangle> triangles;
72
70
// / Ip address of the bridge
You can’t perform that action at this time.
0 commit comments