Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit db3b067

Browse files
author
Tim Niggemann
committed
Improved color space checks by adding latest model ids.
1 parent f9b3798 commit db3b067

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

libsrc/leddevice/LedDevicePhilipsHue.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,21 @@ bool operator !=(CiColor p1, CiColor p2) {
2222

2323
PhilipsHueLight::PhilipsHueLight(unsigned int id, QString originalState, QString modelId) :
2424
id(id), originalState(originalState) {
25-
// Hue system model ids.
26-
const std::set<QString> HUE_BULBS_MODEL_IDS = { "LCT001", "LCT002", "LCT003" };
27-
const std::set<QString> LIVING_COLORS_MODEL_IDS = { "LLC001", "LLC005", "LLC006", "LLC007", "LLC011", "LLC012",
25+
// Hue system model ids (http://www.developers.meethue.com/documentation/supported-lights).
26+
// Light strips, color iris, ...
27+
const std::set<QString> GAMUT_A_MODEL_IDS = { "LLC001", "LLC005", "LLC006", "LLC007", "LLC010", "LLC011", "LLC012",
2828
"LLC013", "LST001" };
29+
// Hue bulbs, spots, ...
30+
const std::set<QString> GAMUT_B_MODEL_IDS = { "LCT001", "LCT002", "LCT003", "LLM001" };
2931
// Find id in the sets and set the appropiate color space.
30-
if (HUE_BULBS_MODEL_IDS.find(modelId) != HUE_BULBS_MODEL_IDS.end()) {
32+
if (GAMUT_A_MODEL_IDS.find(modelId) != GAMUT_A_MODEL_IDS.end()) {
33+
colorSpace.red = {0.703f, 0.296f};
34+
colorSpace.green = {0.2151f, 0.7106f};
35+
colorSpace.blue = {0.138f, 0.08f};
36+
} else if (GAMUT_B_MODEL_IDS.find(modelId) != GAMUT_B_MODEL_IDS.end()) {
3137
colorSpace.red = {0.675f, 0.322f};
3238
colorSpace.green = {0.4091f, 0.518f};
3339
colorSpace.blue = {0.167f, 0.04f};
34-
} else if (LIVING_COLORS_MODEL_IDS.find(modelId) != LIVING_COLORS_MODEL_IDS.end()) {
35-
colorSpace.red = {0.703f, 0.296f};
36-
colorSpace.green = {0.214f, 0.709f};
37-
colorSpace.blue = {0.139f, 0.081f};
3840
} else {
3941
colorSpace.red = {1.0f, 0.0f};
4042
colorSpace.green = {0.0f, 1.0f};

0 commit comments

Comments
 (0)