From d2f3e87b12f1228806dacc41a3b4b2eab1c4c335 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tomas=20Wenstr=C3=B6m?= Date: Thu, 24 Aug 2017 22:07:18 +0200 Subject: [PATCH] Bugfix - switched min/max --- config.properties.template | 1 + src/kaka/cakelight/Configuration.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config.properties.template b/config.properties.template index a7e6633..77f6aeb 100644 --- a/config.properties.template +++ b/config.properties.template @@ -14,6 +14,7 @@ video.crop.bottom=18 # Supported types: apa102, ws2801 leds.type=apa102 +# Light level: 1-31 leds.level=31 leds.cols=32 leds.rows=17 diff --git a/src/kaka/cakelight/Configuration.java b/src/kaka/cakelight/Configuration.java index 4d727cc..286da18 100644 --- a/src/kaka/cakelight/Configuration.java +++ b/src/kaka/cakelight/Configuration.java @@ -104,7 +104,7 @@ public class Configuration { private LedConfiguration(Properties prop) { cols = Integer.parseInt(get(prop, "leds.cols")); rows = Integer.parseInt(get(prop, "leds.rows")); - level = Math.min(0, Math.max(31, Integer.parseInt(get(prop, "leds.level", "31")))); + level = Math.max(1, Math.min(31, Integer.parseInt(get(prop, "leds.level", "31")))); switch (get(prop, "leds.type", "").toUpperCase()) { case "WS2801": type = LedType.WS2801; -- 2.11.0