Modified something

This commit is contained in:
Dawit Gulino 20013954
2018-06-27 10:31:41 +02:00
parent 7e1feb6939
commit e8c2de7d84
3 changed files with 31 additions and 12 deletions

View File

@@ -6,27 +6,39 @@ import java.util.HashSet;
import java.util.Set;
public class TestSensor {
Sensor sensor = new Sensor(5);
Hue lights = new Hue();
Sensor sensor = new Sensor(2);
Hue lights;
@Test
synchronized public void firstTestSensor() throws InterruptedException {
sensor.update(5);
sensor.update(2);
System.out.println(sensor.luminiscenceLevel());
}
@Test
public void secondTestSensor() throws InterruptedException {
sensor.update(5);
synchronized public void secondTestSensor() throws InterruptedException {
int i=0;
lights = new Hue();
Set<String> toRemove = new HashSet<>();
for(String str: lights.getNameLights())
if(!str.equals("4"))
toRemove.add(str);
lights.removeLights(toRemove);
lights.turnOn();
if(sensor.luminiscenceLevel() < 100) {
lights.turnOn();
lights.setBrightness(200);
while(i<999999) {
if (sensor.luminiscenceLevel() < 200) {
lights.getCurrentLuminiscence();
lights.setBrightness(200);
}
if (sensor.luminiscenceLevel() > 600) {
lights.setBrightness(0);
}
System.out.println(i+"-"+sensor.luminiscenceLevel());
sensor.update(100);
i++;
}
}
}