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){
|
||||
if (sensorListener != null) {
|
||||
if (tellstickDevice instanceof HalSensorConfig)
|
||||
sensorListener.reportReceived((HalSensorConfig) tellstickDevice, deviceData);
|
||||
else if (tellstickDevice instanceof HalEventConfig)
|
||||
eventListener.reportReceived((HalEventConfig) tellstickDevice, deviceData);
|
||||
}
|
||||
if (sensorListener != null && tellstickDevice instanceof HalSensorConfig)
|
||||
sensorListener.reportReceived((HalSensorConfig) tellstickDevice, deviceData);
|
||||
else if (eventListener != null && tellstickDevice instanceof HalEventConfig)
|
||||
eventListener.reportReceived((HalEventConfig) tellstickDevice, deviceData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -214,14 +212,14 @@ public class TellstickSerialComm implements Runnable,
|
|||
if(event instanceof TellstickDevice)
|
||||
registeredDevices.add((TellstickDevice) event);
|
||||
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
|
||||
public void register(HalSensorConfig sensor) {
|
||||
if(sensor instanceof TellstickDevice)
|
||||
registeredDevices.add((TellstickDevice) sensor);
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue