use of org.eclipse.smarthome.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID in project smarthome by eclipse.
the class DeviceStatusManagerImpl method unregisterDeviceListener.
@Override
public void unregisterDeviceListener(DeviceStatusListener deviceListener) {
if (deviceListener != null) {
String id = deviceListener.getDeviceStatusListenerID();
logger.debug("unregister DeviceListener with id: {}", id);
if (id.equals(DeviceStatusListener.DEVICE_DISCOVERY)) {
this.deviceDiscovery = null;
} else {
Device intDevice = strucMan.getDeviceByDSID(deviceListener.getDeviceStatusListenerID());
if (intDevice != null) {
intDevice.unregisterDeviceStatusListener();
} else {
Circuit intCircuit = strucMan.getCircuitByDSID(new DSID(deviceListener.getDeviceStatusListenerID()));
if (intCircuit != null) {
intCircuit.unregisterDeviceStatusListener();
if (deviceDiscovery != null) {
deviceDiscovery.onDeviceAdded(intCircuit);
}
}
}
}
}
}
use of org.eclipse.smarthome.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID in project smarthome by eclipse.
the class DeviceStatusManagerImpl method registerDeviceListener.
@Override
public void registerDeviceListener(DeviceStatusListener deviceListener) {
if (deviceListener != null) {
String id = deviceListener.getDeviceStatusListenerID();
if (id.equals(DeviceStatusListener.DEVICE_DISCOVERY)) {
this.deviceDiscovery = deviceListener;
logger.debug("register Device-Discovery ");
for (Device device : strucMan.getDeviceMap().values()) {
deviceDiscovery.onDeviceAdded(device);
}
for (Circuit circuit : strucMan.getCircuitMap().values()) {
deviceDiscovery.onDeviceAdded(circuit);
}
} else {
Device intDevice = strucMan.getDeviceByDSID(deviceListener.getDeviceStatusListenerID());
if (intDevice != null) {
logger.debug("register DeviceListener with id: {} to Device ", id);
intDevice.registerDeviceStatusListener(deviceListener);
} else {
Circuit intCircuit = strucMan.getCircuitByDSID(new DSID(deviceListener.getDeviceStatusListenerID()));
if (intCircuit != null) {
logger.debug("register DeviceListener with id: {} to Circuit ", id);
intCircuit.registerDeviceStatusListener(deviceListener);
} else {
deviceListener.onDeviceRemoved(null);
}
}
}
}
}
use of org.eclipse.smarthome.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID in project smarthome by eclipse.
the class DeviceImpl method setMeterDSID.
@Override
public synchronized void setMeterDSID(String meterDSID) {
this.meterDSID = new DSID(meterDSID);
informListenerAboutConfigChange(ChangeableDeviceConfigEnum.METER_DSID);
}
Aggregations