From 755c6bc22eb4929267a5330d8f3c93a765db1c76 Mon Sep 17 00:00:00 2001 From: Lord-Grey Date: Sat, 14 Oct 2023 18:10:04 +0200 Subject: [PATCH] Skip non LED panels --- .../leddevice/dev_net/LedDeviceNanoleaf.cpp | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/libsrc/leddevice/dev_net/LedDeviceNanoleaf.cpp b/libsrc/leddevice/dev_net/LedDeviceNanoleaf.cpp index 0313429a..205227fe 100644 --- a/libsrc/leddevice/dev_net/LedDeviceNanoleaf.cpp +++ b/libsrc/leddevice/dev_net/LedDeviceNanoleaf.cpp @@ -210,7 +210,7 @@ int LedDeviceNanoleaf::getHwLedCount(const QJsonObject& jsonLayout) const case CONTROLLER_CAP: case POWER_CONNECTOR: case RHYTM: - DebugIf(verbose, _log, "Rhythm/Shape/lines Controller panel skipped."); + DebugIf(verbose, _log, "Rhythm/Shape/Lines Controller panel skipped."); break; default: ++hwLedCount; @@ -296,16 +296,20 @@ bool LedDeviceNanoleaf::initLedsConfiguration() panelY = posY; } - DebugIf(verbose, _log, "Panel [%d] (%d,%d) - Type: [%d]", panelId, panelX, panelY, panelshapeType); - - // Skip Rhythm and Shapes controller panels - if (panelshapeType != RHYTM && panelshapeType != SHAPES_CONTROLLER) + switch (panelshapeType) { + case SHAPES_CONTROLLER: + case LINES_CONECTOR: + case CONTROLLER_CAP: + case POWER_CONNECTOR: + case RHYTM: + // Skip non LED panel types + DebugIf(verbose, _log, "Skip Panel [%d] (%d,%d) - Type: [%d]", panelId, panelX, panelY, panelshapeType); + break; + default: panelMap[panelY][panelX] = panelId; - } - else - { // Reset non support/required features - Info(_log, "Rhythm/Shape Controller panel skipped."); + DebugIf(verbose, _log, "Use Panel [%d] (%d,%d) - Type: [%d] used", panelId, panelX, panelY, panelshapeType); + break; } }