Some robustness fixes and:

- Fixed Nexa send command
- Added UPS plugin for power consumption
- Added Autostartable Controller interface
This commit is contained in:
Ziver Koc 2016-05-25 14:27:11 +02:00
parent 5f0800897c
commit 7109abeea2
17 changed files with 219 additions and 32 deletions

View file

@ -12,7 +12,7 @@ public class TelstickSerialCommNexaOnOffTest {
System.out.println("Connecting to db...");
TellstickSerialComm comm = new TellstickSerialComm();
// http://developer.telldus.com/doxygen/TellStick.html
comm.connect("COM5");
comm.initialize("COM8");
//comm.connect("/dev/ttyUSB1");
Thread.sleep(1000);

View file

@ -48,7 +48,7 @@ public class TelstickSerialCommTest {
}
}
});
comm.connect("COM5");
comm.initialize("COM5");
//comm.connect("/dev/ttyUSB1");
logger.info("Up and Running");

View file

@ -41,18 +41,15 @@ public class NexaSelfLearningTest {
byte[] expected = Converter.toBytes(new char[]{
84, // T
127, 255, 24, 0, // timings
132, // length
134, // length
0xF9, // preamble
168, 168, 138, 168, 138, 138, 168, 168, 138, 138,
138, 168, 138, 168, 168, 168, 168, 168, 168, 138,
138, 168, 168, 138, 138, 168, 168, 138, 168, 168,
168, 168,
0x00, // postemble
/*154, 138, 136, 170, 136, 168, 170, 138, 136, 168,
168, 170, 136, 170, 138, 138, 138, 138, 138, 136,
168, 170, 138, 136, 168, 170, 138, 136, 170, 138,
136, 168, 170,*/
43}); // +
byte[] actual = nexa.encode().getBytes(StandardCharsets.ISO_8859_1);
@ -69,9 +66,8 @@ public class NexaSelfLearningTest {
assertEquals("House Code", 11772006, nexa.getHouse());
assertEquals("Unit Code", 0, nexa.getUnit());
assertTrue("Enabled", nexa.isOn());
}
@org.junit.Test
public void decode_OFF() throws Exception {
NexaSelfLearning nexa = decode("0x2CE81980");