Improved color space checks by adding latest model ids.

Former-commit-id: db3b067eabeaf36a2a9ab329614892e79d5089c4
This commit is contained in:
Tim Niggemann 2015-03-03 15:54:50 +01:00
parent b2b4e17bb8
commit 7292922309

View File

@ -22,19 +22,21 @@ bool operator !=(CiColor p1, CiColor p2) {
PhilipsHueLight::PhilipsHueLight(unsigned int id, QString originalState, QString modelId) :
id(id), originalState(originalState) {
// Hue system model ids.
const std::set<QString> HUE_BULBS_MODEL_IDS = { "LCT001", "LCT002", "LCT003" };
const std::set<QString> LIVING_COLORS_MODEL_IDS = { "LLC001", "LLC005", "LLC006", "LLC007", "LLC011", "LLC012",
// Hue system model ids (http://www.developers.meethue.com/documentation/supported-lights).
// Light strips, color iris, ...
const std::set<QString> GAMUT_A_MODEL_IDS = { "LLC001", "LLC005", "LLC006", "LLC007", "LLC010", "LLC011", "LLC012",
"LLC013", "LST001" };
// Hue bulbs, spots, ...
const std::set<QString> GAMUT_B_MODEL_IDS = { "LCT001", "LCT002", "LCT003", "LLM001" };
// Find id in the sets and set the appropiate color space.
if (HUE_BULBS_MODEL_IDS.find(modelId) != HUE_BULBS_MODEL_IDS.end()) {
if (GAMUT_A_MODEL_IDS.find(modelId) != GAMUT_A_MODEL_IDS.end()) {
colorSpace.red = {0.703f, 0.296f};
colorSpace.green = {0.2151f, 0.7106f};
colorSpace.blue = {0.138f, 0.08f};
} else if (GAMUT_B_MODEL_IDS.find(modelId) != GAMUT_B_MODEL_IDS.end()) {
colorSpace.red = {0.675f, 0.322f};
colorSpace.green = {0.4091f, 0.518f};
colorSpace.blue = {0.167f, 0.04f};
} else if (LIVING_COLORS_MODEL_IDS.find(modelId) != LIVING_COLORS_MODEL_IDS.end()) {
colorSpace.red = {0.703f, 0.296f};
colorSpace.green = {0.214f, 0.709f};
colorSpace.blue = {0.139f, 0.081f};
} else {
colorSpace.red = {1.0f, 0.0f};
colorSpace.green = {0.0f, 1.0f};