Fixed brightness 0 issues

This commit is contained in:
stijnb1234 2020-05-19 11:00:06 +02:00
parent 86217acca6
commit 90bb05a4c5

View file

@ -79,7 +79,7 @@ public class MCTPAudioCmd implements CommandExecutor {
return true; return true;
} }
int brightness = 0; Integer brightness = null;
if (args.length == 7) { if (args.length == 7) {
try { try {
brightness = Integer.parseInt(args[6]); brightness = Integer.parseInt(args[6]);
@ -88,7 +88,7 @@ public class MCTPAudioCmd implements CommandExecutor {
return true; return true;
} }
if (brightness < 0 || brightness > 255) { if (brightness < 0 || brightness > 254) {
sender.sendMessage(prefix + args[6] + " is geen correcte brightness."); sender.sendMessage(prefix + args[6] + " is geen correcte brightness.");
return true; return true;
} }
@ -125,7 +125,7 @@ public class MCTPAudioCmd implements CommandExecutor {
data.put("task", "HUE"); data.put("task", "HUE");
data.put("rgb", r + ":" + g + ":" + b); data.put("rgb", r + ":" + g + ":" + b);
data.put("type", type.name()); data.put("type", type.name());
if (brightness != 0) data.put("brightness", brightness); if (brightness != null) data.put("brightness", brightness);
data.put("uuid", p.getUniqueId().toString().replace("-", "")); data.put("uuid", p.getUniqueId().toString().replace("-", ""));
Main.getClient().sendData(data); Main.getClient().sendData(data);
} }