Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Code Examples

Marian Pohling edited this page May 10, 2017 · 4 revisions

Java DAL Remote

For running any java examples you only need to include the dal remote dependency in your maven or gradle project description (see above).

How to activate a scene

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);

How to control a colorable light

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);

How to observe a location specific reed contact

How to observe service state changes

Java RSB

How to observe service state changes