non so
This commit is contained in:
@@ -53,10 +53,18 @@ public class Hue {
|
||||
}
|
||||
}
|
||||
|
||||
public void setAttribute(String attribute, String value){
|
||||
/*public void setAttribute(String attribute, String value){
|
||||
for (String light : allLights.keySet()) {
|
||||
String callURL = lightsURL + light + "/state";
|
||||
String body = "{ \""+attribute+"\" : "+value+" }";
|
||||
String body = "{ \"+attribute+\" : "+value+" }";
|
||||
Rest.put(callURL, body, "application/json");
|
||||
}
|
||||
}*/
|
||||
|
||||
public void colorLoop() {
|
||||
for (String light : allLights.keySet()) {
|
||||
String callURL = lightsURL + light + "/state";
|
||||
String body = "{ \"on\" : true, \"effect\" : \"colorloop\" }";
|
||||
Rest.put(callURL, body, "application/json");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public class TestLights {
|
||||
//Hue lights = new Hue("http://localhost/api/newdeveloper/");
|
||||
Hue lights = new Hue();
|
||||
|
||||
Set<String> toRemove = new HashSet<String>();
|
||||
Set<String> toRemove = new HashSet<>();
|
||||
for(String str: lights.getNameLights())
|
||||
if(!str.equals("4"))
|
||||
toRemove.add(str);
|
||||
@@ -24,15 +24,15 @@ public class TestLights {
|
||||
this.wait(0b1111101000); // 1000
|
||||
}
|
||||
|
||||
|
||||
lights.turnOn();
|
||||
for(int i=0; i<256; i++) {
|
||||
lights.setBrightness(i);
|
||||
this.wait(10);
|
||||
this.wait(2);
|
||||
}
|
||||
|
||||
for(int i=256; i>=0; i--) {
|
||||
lights.setBrightness(i);
|
||||
this.wait(10);
|
||||
}
|
||||
lights.colorLoop();
|
||||
this.wait(20);
|
||||
lights.turnOff();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user