cleaned up and corrected setValuesFromOptions
This commit is contained in:
parent
0f63e33da8
commit
41452fab63
|
@ -127,19 +127,15 @@ public abstract class BuntiDMXDevice extends BuntiDevice {
|
|||
public final boolean setValuesFromOptions(Map<String, Object> options) {
|
||||
|
||||
for (Entry<String, Object> opt : options.entrySet()) {
|
||||
try {
|
||||
int value = Integer.parseInt(opt.getValue().toString());
|
||||
|
||||
DMXChannel channel = dmxChannels.getChannelByName(opt.getKey());
|
||||
|
||||
if(channel != null) {
|
||||
try {
|
||||
int value = Integer.parseInt(opt.getValue().toString());
|
||||
|
||||
setChannelValueByName(channel.getName(), value);
|
||||
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(!setChannelValueByName(opt.getKey(), value)) {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue