in s1e1-totally-lit/hue-lifx-java/src/main/java/com/awslabs/iot_all_the_things/special_projects_edition/totally_lit/lifx/LiFXDanceParty.java [25:40]
private static void run() {
// Initialize the LiFX client
LiFXShared.initializeLiFXClient();
// Require at least one light
LiFXShared.requireAtLeastOneLight();
// Loop forever so the dance party doesn't end
while (true) {
// For each light set a random color
LiFXShared.getLightStream()
.forEach(lfxLight -> lfxLight.setColor(getRandomColor()));
// Sleep a little bit to give the lights a rest
Shared.sleep(250);
}
}