X-Git-Url: http://dolda2000.com/gitweb/?p=kaka%2Fcakelight.git;a=blobdiff_plain;f=src%2Fkaka%2Fcakelight%2FConfiguration.java;h=4d727cc6de67bd4f0e25897b562a42036b6d891d;hp=21c2072dee6f44a07384dd6d8f8c1e1ef25ba341;hb=f2eedb6d98ae638d65c9bfd1a9a339a060235592;hpb=14e552a7c3525d7d07aad4335465735537d12f52 diff --git a/src/kaka/cakelight/Configuration.java b/src/kaka/cakelight/Configuration.java index 21c2072..4d727cc 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.min(0, Math.max(31, Integer.parseInt(get(prop, "leds.level", "31")))); switch (get(prop, "leds.type", "").toUpperCase()) { case "WS2801": type = LedType.WS2801;