Updated build gradle

Added functions ph. hue
This commit is contained in:
Giulia
2018-05-28 16:35:48 +02:00
parent 9a83a06215
commit b132736a8e
13 changed files with 350 additions and 343 deletions

View File

@@ -26,10 +26,18 @@ public class hue {
}
}
public void looping() {
public void setBrightness(int num) {
for (String light : allLights.keySet()) {
String callURL = lightsURL + light + "/state";
String body = "{ \"on\" : true, \"effect\" : \"colorloop\" }";
String body = "{ \"bri\" : "+num+" }";
rest.put(callURL, body, "application/json");
}
}
public void setAttribute(String attribute, String value){
for (String light : allLights.keySet()) {
String callURL = lightsURL + light + "/state";
String body = "{ \""+attribute+"\" : "+value+" }";
rest.put(callURL, body, "application/json");
}
}