All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.zeroone3010.yahueapi.SceneImpl Maven / Gradle / Ivy

There is a newer version: 3.0.0-rc
Show newest version
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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy