Enhance DALI interface: add gateway parameter to scene and color methods for improved command handling

This commit is contained in:
Tony
2026-05-02 21:32:39 +08:00
parent 9f9628db39
commit 16907857c0
6 changed files with 199 additions and 37 deletions
+5 -5
View File
@@ -328,7 +328,7 @@ std::vector<int> DaliDT8::getColourRGB(int a) {
bool DaliDT8::storeSceneSnapshot(int address, int scene, int brightness,
Dt8SceneStoreColorMode colorMode, int colorTemperature, int red,
int green, int blue) {
int green, int blue, int /*gateway*/) {
const int sceneBrightness = std::clamp(brightness, 0, 255);
const int sceneIndex = std::clamp(scene, 0, 15);
@@ -465,8 +465,8 @@ std::optional<int> DaliDT8::getPrimaryTy(int a, int n) {
return getColourRaw(a, 66 + 3 * n);
}
std::optional<SceneColorReport> DaliDT8::getSceneColorReport(int a, int sense) {
const auto brightness = base_.getScene(a, sense);
std::optional<SceneColorReport> DaliDT8::getSceneColorReport(int a, int sense, int gateway) {
const auto brightness = base_.getScene(a, sense, gateway);
if (!brightness.has_value() || brightness.value() == 255) return std::nullopt;
const int colorTypeValue = getReportColourType(a).value_or(0);
@@ -489,8 +489,8 @@ std::optional<SceneColorReport> DaliDT8::getSceneColorReport(int a, int sense) {
return report;
}
std::vector<double> DaliDT8::getSceneColor(int a, int sense) {
const auto report = getSceneColorReport(a, sense);
std::vector<double> DaliDT8::getSceneColor(int a, int sense, int gateway) {
const auto report = getSceneColorReport(a, sense, gateway);
if (!report.has_value() || !report->colorType().xy() || !report->hasXy()) return {};
return report->xy;
}