bug fix
This commit is contained in:
parent
d692c30bd9
commit
aeef862ab4
1 changed files with 6 additions and 8 deletions
|
|
@ -174,12 +174,10 @@ public class TellstickSerialComm implements Runnable,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void reportEvent(TellstickDevice tellstickDevice, HalDeviceData deviceData){
|
private void reportEvent(TellstickDevice tellstickDevice, HalDeviceData deviceData){
|
||||||
if (sensorListener != null) {
|
if (sensorListener != null && tellstickDevice instanceof HalSensorConfig)
|
||||||
if (tellstickDevice instanceof HalSensorConfig)
|
sensorListener.reportReceived((HalSensorConfig) tellstickDevice, deviceData);
|
||||||
sensorListener.reportReceived((HalSensorConfig) tellstickDevice, deviceData);
|
else if (eventListener != null && tellstickDevice instanceof HalEventConfig)
|
||||||
else if (tellstickDevice instanceof HalEventConfig)
|
eventListener.reportReceived((HalEventConfig) tellstickDevice, deviceData);
|
||||||
eventListener.reportReceived((HalEventConfig) tellstickDevice, deviceData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -214,14 +212,14 @@ public class TellstickSerialComm implements Runnable,
|
||||||
if(event instanceof TellstickDevice)
|
if(event instanceof TellstickDevice)
|
||||||
registeredDevices.add((TellstickDevice) event);
|
registeredDevices.add((TellstickDevice) event);
|
||||||
else throw new IllegalArgumentException(
|
else throw new IllegalArgumentException(
|
||||||
"Device configuration is not an instance of "+TellstickDevice.class+": "+event.getClass());
|
"Device config is not an instance of "+TellstickDevice.class+": "+event.getClass());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void register(HalSensorConfig sensor) {
|
public void register(HalSensorConfig sensor) {
|
||||||
if(sensor instanceof TellstickDevice)
|
if(sensor instanceof TellstickDevice)
|
||||||
registeredDevices.add((TellstickDevice) sensor);
|
registeredDevices.add((TellstickDevice) sensor);
|
||||||
else throw new IllegalArgumentException(
|
else throw new IllegalArgumentException(
|
||||||
"Device configuration is not an instance of "+TellstickDevice.class+": "+sensor.getClass());
|
"Device config is not an instance of "+TellstickDevice.class+": "+sensor.getClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue