diff --git a/src/main/java/de/ctdo/bunti/model/BuntiDMXDevice.java b/src/main/java/de/ctdo/bunti/model/BuntiDMXDevice.java index 12359f1..99c8859 100644 --- a/src/main/java/de/ctdo/bunti/model/BuntiDMXDevice.java +++ b/src/main/java/de/ctdo/bunti/model/BuntiDMXDevice.java @@ -14,7 +14,6 @@ public abstract class BuntiDMXDevice extends BuntiDevice { public BuntiDMXDevice(int deviceId, int startAddress, String name) { super(deviceId,name); this.startAddress = startAddress; - } public final long getLastSendOut() { @@ -37,13 +36,16 @@ public abstract class BuntiDMXDevice extends BuntiDevice { * Set channel value by given channel name. * @param name The channel name to change the value. * @param value The channel value to set. + * @return True on success, otherwise false */ - protected final void setChannelValueByName(String name, int value) { + protected final boolean setChannelValueByName(String name, int value) { DMXChannel dx = dmxChannels.getChannelByName(name); if(dx != null) { dx.setValue(DMX.sanitizeDMXValue(value)); + lastChangedNow(); + return true; } - lastChangedNow(); + return false; } /** @@ -145,9 +147,4 @@ public abstract class BuntiDMXDevice extends BuntiDevice { public final boolean addChannel(DMXChannel channel){ return dmxChannels.addChannel(channel); } - - @Override - public String toString() { - return "BuntiDMXDevice " + getDeviceId() + ", " + getDeviceName(); - } }