From aeef862ab4357368e76efeedb157e44e16e67137 Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Fri, 19 Aug 2016 16:02:50 +0200 Subject: [PATCH] bug fix --- .../hal/plugin/tellstick/TellstickSerialComm.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/se/hal/plugin/tellstick/TellstickSerialComm.java b/src/se/hal/plugin/tellstick/TellstickSerialComm.java index 014f93b5..b841c784 100755 --- a/src/se/hal/plugin/tellstick/TellstickSerialComm.java +++ b/src/se/hal/plugin/tellstick/TellstickSerialComm.java @@ -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