static Console.Command brightness() {
return command(new String[] {"b", "brightness"}, (console, args) -> {
if (args.length == 1) {
- int b = Integer.parseInt(args[0]);
+ int b = Integer.parseInt(args[0].replaceAll("\\+-", ""));
+ if (args[0].startsWith("+")) {
+ b = Math.min(console.getConfig().leds.brightness + b, 31);
+ } else if (args[0].startsWith("-")) {
+ b = Math.max(console.getConfig().leds.brightness - b, 0);
+ }
console.getConfig().leds.brightness = b;
console.out("setting brightness to " + b);
return true;