From d6a624be1454eab63980c45d04f6307b5b6d36cf Mon Sep 17 00:00:00 2001 From: owagner Date: Sun, 15 Mar 2015 00:01:45 +0100 Subject: [PATCH] - fixed log output - actually bump rev to 0.3 --- README.md | 4 ++-- build.gradle | 2 +- src/main/java/com/tellerulam/eno2mqtt/Device.java | 7 +++++++ src/main/java/com/tellerulam/eno2mqtt/Main.java | 2 +- src/main/java/com/tellerulam/eno2mqtt/TCM310Connector.java | 6 ++++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7c432b2..b1ee09f 100644 --- a/README.md +++ b/README.md @@ -70,13 +70,13 @@ EEP specifics ------------- * F6-02 -* F6-03 *** +* F6-03 Rocker switches. Publishes state to subtopics "AI", "AO" etc. as either 1 for pressed or 0 for released. The published messages are not retained, as those are one-shot events. Dual-button presses are reported on the respective dual-button topic, e.g. "AIBI". -* F6-10-00 *** +* F6-10-00 Window handle: val=0 down, val=1 left/right, val=2 up diff --git a/build.gradle b/build.gradle index ade48e2..26491dd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -version = '0.2' +version = '0.3' apply plugin: 'java' apply plugin: 'eclipse' diff --git a/src/main/java/com/tellerulam/eno2mqtt/Device.java b/src/main/java/com/tellerulam/eno2mqtt/Device.java index c4638b0..82fba7b 100644 --- a/src/main/java/com/tellerulam/eno2mqtt/Device.java +++ b/src/main/java/com/tellerulam/eno2mqtt/Device.java @@ -44,4 +44,11 @@ public synchronized void setState(String key,Object value) state=new HashMap<>(); state.put(key,value); } + + @SuppressWarnings("boxing") + @Override + public String toString() + { + return "{"+Long.toHexString(id)+"/"+name+"|"+eep.getClass().getName()+"}"; + } } \ No newline at end of file diff --git a/src/main/java/com/tellerulam/eno2mqtt/Main.java b/src/main/java/com/tellerulam/eno2mqtt/Main.java index f7289f6..1408ba1 100644 --- a/src/main/java/com/tellerulam/eno2mqtt/Main.java +++ b/src/main/java/com/tellerulam/eno2mqtt/Main.java @@ -54,8 +54,8 @@ public static void main(String[] args) throws MqttException, SecurityException, } System.setProperty("eno2mqtt."+sp[0],sp[1]); } - Logger.getLogger(Main.class.getName()).info("eno2mqtt V"+getVersion()+" (C) 2015 Oliver Wagner "); SyslogHandler.readConfig(); + Logger.getLogger(Main.class.getName()).info("eno2mqtt V"+getVersion()+" (C) 2015 Oliver Wagner "); DeviceManager.readDeviceList(); MQTTHandler.init(); TCM310Connector.setupConnections(); diff --git a/src/main/java/com/tellerulam/eno2mqtt/TCM310Connector.java b/src/main/java/com/tellerulam/eno2mqtt/TCM310Connector.java index 5ba0287..b45ff2d 100644 --- a/src/main/java/com/tellerulam/eno2mqtt/TCM310Connector.java +++ b/src/main/java/com/tellerulam/eno2mqtt/TCM310Connector.java @@ -209,6 +209,7 @@ private static class SerialConnector extends TCM310Connector { SerialConnector(String port) { + L.info("Using serial port "+port); NRSerialPort serial=new NRSerialPort(port,57600); serial.connect(); is=serial.getInputStream(); @@ -220,6 +221,7 @@ private static class NetworkConnector extends TCM310Connector { NetworkConnector(String hostspec) throws NumberFormatException, UnknownHostException, IOException { + L.info("Using network connection to "+hostspec); String spec[]=hostspec.split(":",2); @SuppressWarnings("resource") Socket s=new Socket(spec[0],spec.length==2?Integer.parseInt(spec[1]):23000); @@ -230,7 +232,7 @@ private static class NetworkConnector extends TCM310Connector static void setupConnections() throws NumberFormatException, UnknownHostException, IOException, InterruptedException { - String connectionspecs=System.getProperty("eno2mqtt.eno.usb300"); + String connectionspecs=System.getProperty("eno2mqtt.eno.tcm"); if(connectionspecs==null) throw new IllegalArgumentException("You must specify a serial or network connection to an USB300 device"); String specs[]=connectionspecs.split(","); @@ -247,6 +249,6 @@ static void setupConnections() throws NumberFormatException, UnknownHostExceptio } } - private final Logger L=Logger.getLogger(getClass().getName()); + private static final Logger L=Logger.getLogger(TCM310Connector.class.getName()); }