X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fkaka%2Fcakelight%2FCommands.java;h=1a6a850b79f914c828fc34966101237af6e24b65;hb=32ed05798d7051a4fe5db840ae6b6786f3b583d9;hp=f527c123c1877df1b8eb391593261fd9eed84266;hpb=cc124c322996f68454baf4405b2959c84e771296;p=kaka%2Fcakelight.git diff --git a/src/kaka/cakelight/Commands.java b/src/kaka/cakelight/Commands.java index f527c12..1a6a850 100644 --- a/src/kaka/cakelight/Commands.java +++ b/src/kaka/cakelight/Commands.java @@ -2,6 +2,7 @@ package kaka.cakelight; import kaka.cakelight.mode.AmbientMode; import kaka.cakelight.mode.SingleColorMode; +import kaka.cakelight.mode.SunriseMode; import kaka.cakelight.mode.TwoColorNoiseMode; import kaka.cakelight.mode.VideoMode; @@ -132,4 +133,17 @@ class Commands { } }); } + + static Console.Command sunriseMode() { + return command(new String[] {"sunrise"}, (console, args) -> { + if (args.length == 1) { + int durationSeconds = Integer.parseInt(args[0]); + console.getCakelight().setMode(new SunriseMode(durationSeconds)); + console.out("setting sunrise mode with duration " + durationSeconds); + return true; + } else { + return false; + } + }); + } }