Tellstic event bugfix. issue 15
Former-commit-id: eed3e3bacbb7adfb27f31f4f1c3a47f1b6e884fd
This commit is contained in:
parent
ff9709b6d2
commit
eceafa762c
5 changed files with 27 additions and 14 deletions
|
|
@ -19,9 +19,9 @@ public class TelstickSerialCommNexaOnOffTest {
|
|||
|
||||
NexaSelfLearning nexa = new NexaSelfLearning();
|
||||
//nexa.setHouse(11772006);
|
||||
nexa.setHouse(15087918);
|
||||
nexa.setHouse(14160770);
|
||||
nexa.setGroup(0);
|
||||
nexa.setUnit(0);
|
||||
nexa.setUnit(1);
|
||||
|
||||
System.out.println("Up and Running");
|
||||
while(true) {
|
||||
|
|
|
|||
|
|
@ -48,20 +48,26 @@ public class NexaSelfLearningTest {
|
|||
|
||||
@org.junit.Test
|
||||
public void decode_ON() throws Exception {
|
||||
NexaSelfLearning nexa = new NexaSelfLearning();
|
||||
nexa.decode(Converter.hexToByte("0x2CE81990"));
|
||||
NexaSelfLearning nexa = decode("0x2CE81990");
|
||||
|
||||
assertEquals("House Code", 11772006, nexa.getHouse());
|
||||
assertEquals("Unit Code", 1, nexa.getUnit());
|
||||
assertTrue("Enabled", nexa.isOn());
|
||||
|
||||
|
||||
}
|
||||
@org.junit.Test
|
||||
public void decode_OFF() throws Exception {
|
||||
NexaSelfLearning nexa = new NexaSelfLearning();
|
||||
nexa.decode(Converter.hexToByte("0x2CE81980"));
|
||||
NexaSelfLearning nexa = decode("0x2CE81980");
|
||||
|
||||
assertEquals("House Code", 11772006, nexa.getHouse());
|
||||
assertEquals("Unit Code", 1, nexa.getUnit());
|
||||
assertFalse("Enabled", nexa.isOn());
|
||||
}
|
||||
|
||||
private NexaSelfLearning decode(String data){
|
||||
NexaSelfLearning nexa = new NexaSelfLearning();
|
||||
nexa.decode(Converter.hexToByte(data));
|
||||
return nexa;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue