X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fkaka%2Fcakelight%2FConfiguration.java;h=286da18bacb7a7da0fd2b3052b0c540d2956a228;hb=d2f3e87b12f1228806dacc41a3b4b2eab1c4c335;hp=21c2072dee6f44a07384dd6d8f8c1e1ef25ba341;hpb=aa9e49c2a448c4fa4c16d2afe373ea52eefdffd2;p=kaka%2Fcakelight.git diff --git a/src/kaka/cakelight/Configuration.java b/src/kaka/cakelight/Configuration.java index 21c2072..286da18 100644 --- a/src/kaka/cakelight/Configuration.java +++ b/src/kaka/cakelight/Configuration.java @@ -98,11 +98,13 @@ public class Configuration { public class LedConfiguration { public int cols; public int rows; + public int level; public LedType type; private LedConfiguration(Properties prop) { cols = Integer.parseInt(get(prop, "leds.cols")); rows = Integer.parseInt(get(prop, "leds.rows")); + 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;