Removed "koc" from package names
Former-commit-id: 93e426a87e8a82a83783d68cf7a814c88df375aa
This commit is contained in:
parent
1ab72ffbc3
commit
5b2dffeb43
56 changed files with 2289 additions and 2313 deletions
49
test/se/hal/plugin/tellstick/TelstickSerialCommNexaOnOffTest.java
Executable file
49
test/se/hal/plugin/tellstick/TelstickSerialCommNexaOnOffTest.java
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
package se.hal.plugin.tellstick;
|
||||
|
||||
import se.hal.plugin.tellstick.protocols.NexaSelfLearning;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2015-11-19.
|
||||
*/
|
||||
public class TelstickSerialCommNexaOnOffTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println("Connecting to db...");
|
||||
TellstickSerialComm comm = new TellstickSerialComm();
|
||||
// http://developer.telldus.com/doxygen/TellStick.html
|
||||
comm.connect("COM5");
|
||||
//comm.connect("/dev/ttyUSB1");
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
NexaSelfLearning nexa = new NexaSelfLearning();
|
||||
//nexa.setHouse(11772006);
|
||||
nexa.setHouse(15087918);
|
||||
nexa.setGroup(0);
|
||||
nexa.setUnit(0);
|
||||
|
||||
System.out.println("Up and Running");
|
||||
while(true) {
|
||||
Thread.sleep(2000);
|
||||
nexa.turnOn();
|
||||
nexa.setUnit(0);
|
||||
comm.write(nexa);
|
||||
Thread.sleep(2000);
|
||||
nexa.setUnit(1);
|
||||
comm.write(nexa);
|
||||
Thread.sleep(2000);
|
||||
|
||||
|
||||
nexa.turnOff();
|
||||
nexa.setUnit(0);
|
||||
comm.write(nexa);
|
||||
Thread.sleep(2000);
|
||||
nexa.setUnit(1);
|
||||
comm.write(nexa);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue