Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.
Marian Pohling edited this page May 10, 2017 · 19 revisions

BCO Domotic Abstraction Layer Wiki

Build Status Build Status

Remote API Maven Artifact

<dependency>
    <groupId>org.openbase.bco</groupId>
    <artifactId>dal.remote</artifactId>
    <version>[1.3,1.4-SNAPSHOT)</version>
</dependency>

Code Examples

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
* [Complete Code Example](https://github.com/openbase/bco.dal/blob/master/example/src/main/java/org/openbase/bco/dal/example/HowToActivateASceneViaDAL.java)

Request the unit
```java
    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

Clone this wiki locally