This repository was archived by the owner on Oct 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Code Examples
Marian Pohling edited this page May 10, 2017
·
4 revisions
For running any java examples you only need to include the dal remote dependency in your maven or gradle project description (see above).
Request the unit
LOGGER.info("request the scene with the label \"WatchingTV\"");
testScene = Units.getUnitByLabel("WatchingTV", true, Units.SCENE);
Control the unit
LOGGER.info("activate the scene");
testScene.setActivationState(ActivationState.State.ACTIVE);
Request the unit
LOGGER.info("request the light unit with the label \"TestUnit_0\"");
testLight = Units.getUnitByLabel("TestUnit_0", true, Units.LIGHT_COLORABLE);
Control the unit
LOGGER.info("switch the light on");
testLight.setPowerState(PowerState.State.ON);
LOGGER.info("switch light color to blue");
testLight.setColor(Color.BLUE);