/*public LifxLightBulb(IoTUDP udp, byte[] macAddress) {
communicationSockect = udp;
bulbMacAddress = macAddress;
- }
+ }*/
public LifxLightBulb(IoTSet<IoTDeviceAddress> _lb_addresses, String macAddress) {
this(macAddress);
lb_addresses = _lb_addresses;
- }*/
+ }
public LifxLightBulb(String macAddress) {
communicationSockect = null;
}
- /*public static void main(String[] args) throws Exception {
+ /* TODO: Uncomment this part to do light bulb test
+ public static void main(String[] args) throws Exception {
System.out.println("Executing main function!");
- IoTDeviceAddress iotDevAdd = new IoTDeviceAddress("192.168.2.126", 12345, 56700, false, false);
+ IoTDeviceAddress iotDevAdd = new IoTDeviceAddress(args[0], 12345, 56700, false, false);
Set<IoTDeviceAddress> set = new HashSet<IoTDeviceAddress>();
set.add(iotDevAdd);
IoTSet<IoTDeviceAddress> iotset = new IoTSet<IoTDeviceAddress>(set);
LifxLightBulb lb = new LifxLightBulb(iotset, "D073D5128E300000");
- lb.init();
+ try {
+ lb.init();
+ Thread.sleep(1000);
+ for (int i = 0; i < 2; i++) {
+ lb.turnOff();
+ System.out.println("Turning off!");
+ Thread.sleep(1000);
+ lb.turnOn();
+ System.out.println("Turning on!");
+ Thread.sleep(1000);
+ }
+ lb.turnOff();
+ } catch(Exception ex) {
+ ex.printStackTrace();
+ }
}*/
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-