3 import iotruntime.slave.IoTSet;
4 import iotruntime.slave.IoTRelation;
5 import iotruntime.slave.IoTDeviceAddress;
6 import iotruntime.IoTUDP;
8 import java.io.IOException;
10 import iotcode.interfaces.LightBulbTest;
11 import iotcode.annotation.*;
13 import java.util.HashSet;
14 import java.util.Iterator;
19 import java.rmi.server.UnicastRemoteObject;
21 import iotcode.interfaces.LightBulbTest;
23 public class Lifxtest {
25 @config private IoTSet<LightBulbTest> lifx_light_bulb;
27 public void init() throws InterruptedException {
29 for(LightBulbTest lifx : lifx_light_bulb.values()) {
30 //Thread thread = new Thread(new Runnable() {
31 // public void run() {
38 for (int i = 0; i < 5; i++) {
40 System.out.println("Turning off!");
43 System.out.println("Turning on!");
48 for (int i = 2500; i < 9000; i += 100) {
49 System.out.println("Adjusting Temp: " + Integer.toString(i));
50 lifx.setTemperature(i);
54 for (int i = 9000; i > 2500; i -= 100) {
55 System.out.println("Adjusting Temp: " + Integer.toString(i));
56 lifx.setTemperature(i);
60 for (int i = 100; i > 0; i -= 10) {
61 System.out.println("Adjusting Brightness: " + Integer.toString(i));
62 lifx.setColor(lifx.getHue(), lifx.getSaturation(), i);
66 for (int i = 0; i < 100; i += 10) {
67 System.out.println("Adjusting Brightness: " + Integer.toString(i));
68 lifx.setColor(lifx.getHue(), lifx.getSaturation(), i);