io.github.zeroone3010.yahueapi.SceneImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yetanotherhueapi Show documentation
Show all versions of yetanotherhueapi Show documentation
A library for controlling Philips Hue lights.
package io.github.zeroone3010.yahueapi;
import java.util.function.Function;
final class SceneImpl implements Scene {
private final String id;
private final String name;
private final Function stateSetter;
SceneImpl(final String id, final String name, final Function stateSetter) {
this.id = id;
this.name = name;
this.stateSetter = stateSetter;
}
@Override
public void activate() {
stateSetter.apply(State.builder().scene(id).keepCurrentState());
}
@Override
public String getName() {
return name;
}
}