28 lines
644 B
Java
28 lines
644 B
Java
package de.ctdo.bunti.devices;
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import de.ctdo.bunti.DeviceChangedEvent;
|
|
import de.ctdo.bunti.model.BuntiSwitchingDevice;
|
|
|
|
|
|
@Component
|
|
public class DeviceMixerImpl implements DeviceMixer {
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
@Override
|
|
public void onApplicationEvent(DeviceChangedEvent arg0) {
|
|
|
|
if( arg0.getDevice() instanceof BuntiSwitchingDevice) {
|
|
|
|
BuntiSwitchingDevice switchDev = (BuntiSwitchingDevice)arg0.getDevice();
|
|
switchDev.setValuesFromOptions(arg0.getOptions());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|