Enhance color handling in DaliDT8: add checks for color status based on code values

Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
Tony
2026-05-25 08:16:28 +08:00
parent ac73febc9c
commit faefde9467
+16
View File
@@ -280,6 +280,22 @@ std::optional<int> DaliDT8::getColourRaw(int a, int type) {
if ((code == 2 || code == 128 || code == 129 || code == 130 || code == 131) && !features->ctCapable()) { if ((code == 2 || code == 128 || code == 129 || code == 130 || code == 131) && !features->ctCapable()) {
return std::nullopt; return std::nullopt;
} }
if (code <= 15) {
const auto status = getColorStatus(a);
if (!status.has_value()) return std::nullopt;
if ((code == 0 || code == 1) && !status->xyActive()) {
return std::nullopt;
}
if (code == 2 && !status->ctActive()) {
return std::nullopt;
}
if (code >= 3 && code <= 8 && !status->primaryNActive()) {
return std::nullopt;
}
if (code >= 9 && code <= 15 && !status->rgbwafActive()) {
return std::nullopt;
}
}
bool is8bit = false; bool is8bit = false;
if (code == 82 || (code >= 9 && code <= 15) || (code >= 201 && code <= 207) || code == 208 || if (code == 82 || (code >= 9 && code <= 15) || (code >= 201 && code <= 207) || code == 208 ||