Skip to content
Snippets Groups Projects
Commit e59964ae authored by René Schöne's avatar René Schöne
Browse files

Merge branch 'learner' of git-st.inf.tu-dresden.de:OpenLicht/eraser into learner

parents cd308857 cd59cdb6
No related branches found
No related tags found
No related merge requests found
Showing
with 728 additions and 0 deletions
time,topic,qos,message
0,oh2/out/iris1_item/state,0,1
1,oh2/out/iris1_item/state,0,0
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
<Logger name="de.tudresden.inf.st.eraser.openhab2.mqtt" level="DEBUG" additivity="false">
<Appender-ref ref="Console"/>
</Logger>
</Loggers>
</Configuration>
Bundle resources go in here!
\ No newline at end of file
Bundle resources go in here!
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
<Logger name="de.tudresden.inf.st.eraser.openhab2.mqtt" level="DEBUG" additivity="false">
<Appender-ref ref="Console"/>
</Logger>
</Loggers>
</Configuration>
ThingType: id="hue:bridge" label="Hue Bridge" description="The hue bridge represents the Philips hue bridge." parameters=[] channelTypes=[] ;
ThingType: id="hue:0200" label="Color Light" description="A dimmable light with changeable colors." ;
ThingType: id="hue:0210" label="Extended Color Light" description="A dimmable light with changeable colors and tunable color temperature." parameters=[] channelTypes=[];
ThingType: id="skywriter-hat" label="SkyWriterHAT" description="SkyWriterHAT Gesture Recognition" parameters=["brokername"] channelTypes=["flick-type", "skywriter-x", "skywriter-y"] ;
Thing: id="hue:bridge:0017880adcf4" label="Philips hue (10.8.0.160)" type="hue:bridge" channels=[] ;
Thing: id="hue:0210:0017880adcf4:1" label="Wohnzimmer" type="hue:0210" channels=["hue:0210:0017880adcf4:1:color_temperature", "hue:0210:0017880adcf4:1:effect"] ;
Thing: id="hue:0200:0017880adcf4:5" label="Hue iris 1" type="hue:0200" channels=["hue:0210:0017880adcf4:4:color", "hue:0210:0017880adcf4:4:color_temperature", "hue:0210:0017880adcf4:4:alert", "hue:0210:0017880adcf4:4:effect"] ;
Thing: id="hue:0210:0017880adcf4:4" label="Hue go 1" type="hue:0210" channels=["hue:0200:0017880adcf4:5:color", "hue:0200:0017880adcf4:5:alert", "hue:0200:0017880adcf4:5:effect"] ;
Thing: id="skywriter1" label="Our skywriter" type="skywriter-hat" channels=["skywriter1-flick", "skywriter1-x", "skywriter1-y"] ;
ChannelType: id="hue:color" label="Color" description="The color channel allows to control the color of a light. It is also possible to dim values and switch the light on and off." itemType="Color" category="ColorLight" ;
ChannelType: id="hue:alert" label="Alert" description="The alert channel allows a temporary change to the bulb’s state." itemType="String" category="Unknown" ;
ChannelType: id="hue:effect" label="Color Loop" description="The effect channel allows putting the bulb in a color looping mode." itemType="Switch" category="ColorLight" ;
ChannelType: id="hue:color_temperature" label="Color Temperature" description="The color temperature channel allows to set the color temperature of a light from 0 (cold) to 100 (warm)." itemType="Dimmer" category="ColorLight" ;
ChannelType: id="flick-type" itemType="String" label="Last Flick" description="Last Flick detected (and its direction)" category="Motion" readOnly ;
ChannelType: id="skywriter-x" itemType="String" label="Current X coordinate" description="Current X coordinate" category="Motion" readOnly ;
ChannelType: id="skywriter-y" itemType="String" label="Current Y coordinate" description="Current Y coordinate" category="Motion" readOnly ;
Channel: id="hue:0210:0017880adcf4:1:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:1:effect" type="hue:effect" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color" type="hue:color" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:alert" type="hue:alert" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:effect" type="hue:effect" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:color" type="hue:color" links=["iris1_item"] ;
Channel: id="hue:0200:0017880adcf4:5:alert" type="hue:alert" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:effect" type="hue:color" links=[] ;
Channel: id="skywriter1-flick" type="flick-type" links=[];
Channel: id="skywriter1-x" type="skywriter-x" links=["skywriter1_x"];
Channel: id="skywriter1-y" type="skywriter-y" links=["skywriter1_y"];
Item: id="iris1_item" label="Iris 1" state="121,88,68" topic="iris1_item/state";
Item: id="skywriter1_x" label="X" state="0" topic="skywriter/x";
Item: id="skywriter1_y" label="Y" state="0" topic="skywriter/y";
Item: id="skywriter1_xyz" label="Y" state="0" topic="skywriter/xyz";
Group: id="Lights" items=["iris1_item"];
Group: id="Skywriter" items=["skywriter1_x", "skywriter1_y"];
Parameter: id="brokername" label="Broker Name" description="Name of the broker as defined in the &lt;broker&gt;.url in services/mqtt.cfg. See the MQTT Binding for more information on how to configure MQTT broker connections." type="Text" context="service" default="mosquitto" required ;
// MqttHost is set programmatically
Mqtt: incoming="oh2/out/" outgoing="oh2/in/" ;
ThingType: id="hue:bridge" label="Hue Bridge" description="The hue bridge represents the Philips hue bridge." parameters=[] channelTypes=[] ;
ThingType: id="hue:0200" label="Color Light" description="A dimmable light with changeable colors." ;
ThingType: id="hue:0210" label="Extended Color Light" description="A dimmable light with changeable colors and tunable color temperature." parameters=[] channelTypes=[];
ThingType: id="skywriter-hat" label="SkyWriterHAT" description="SkyWriterHAT Gesture Recognition" parameters=["brokername"] channelTypes=["flick-type", "skywriter-x", "skywriter-y"] ;
Thing: id="hue:bridge:0017880adcf4" label="Philips hue (10.8.0.160)" type="hue:bridge" channels=[] ;
Thing: id="hue:0210:0017880adcf4:1" label="Wohnzimmer" type="hue:0210" channels=["hue:0210:0017880adcf4:1:color_temperature", "hue:0210:0017880adcf4:1:effect"] ;
Thing: id="hue:0200:0017880adcf4:5" label="Hue iris 1" type="hue:0200" channels=["hue:0210:0017880adcf4:4:color", "hue:0210:0017880adcf4:4:color_temperature", "hue:0210:0017880adcf4:4:alert", "hue:0210:0017880adcf4:4:effect"] ;
Thing: id="hue:0210:0017880adcf4:4" label="Hue go 1" type="hue:0210" channels=["hue:0200:0017880adcf4:5:color", "hue:0200:0017880adcf4:5:alert", "hue:0200:0017880adcf4:5:effect"] ;
Thing: id="skywriter1" label="Our skywriter" type="skywriter-hat" channels=["skywriter1-flick", "skywriter1-x", "skywriter1-y"] ;
ChannelType: id="hue:color" label="Color" description="The color channel allows to control the color of a light. It is also possible to dim values and switch the light on and off." itemType="Color" category="ColorLight" ;
ChannelType: id="hue:alert" label="Alert" description="The alert channel allows a temporary change to the bulb’s state." itemType="String" category="Unknown" ;
ChannelType: id="hue:effect" label="Color Loop" description="The effect channel allows putting the bulb in a color looping mode." itemType="Switch" category="ColorLight" ;
ChannelType: id="hue:color_temperature" label="Color Temperature" description="The color temperature channel allows to set the color temperature of a light from 0 (cold) to 100 (warm)." itemType="Dimmer" category="ColorLight" ;
ChannelType: id="flick-type" itemType="String" label="Last Flick" description="Last Flick detected (and its direction)" category="Motion" readOnly ;
ChannelType: id="skywriter-x" itemType="String" label="Current X coordinate" description="Current X coordinate" category="Motion" readOnly ;
ChannelType: id="skywriter-y" itemType="String" label="Current Y coordinate" description="Current Y coordinate" category="Motion" readOnly ;
Channel: id="hue:0210:0017880adcf4:1:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:1:effect" type="hue:effect" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color" type="hue:color" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:alert" type="hue:alert" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:effect" type="hue:effect" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:color" type="hue:color" links=["iris1_item"] ;
Channel: id="hue:0200:0017880adcf4:5:alert" type="hue:alert" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:effect" type="hue:color" links=[] ;
Channel: id="skywriter1-flick" type="flick-type" links=[];
Channel: id="skywriter1-x" type="skywriter-x" links=["skywriter1_x"];
Channel: id="skywriter1-y" type="skywriter-y" links=["skywriter1_y"];
Item: id="iris1_item" label="Iris 1" state="121,88,68" topic="iris1_item/state";
Item: id="skywriter1_x" label="X" state="0" topic="skywriter/x";
Item: id="skywriter1_y" label="Y" state="0" topic="skywriter/y";
//Item: id="skywriter1_xyz" label="Y" state="0" topic="skywriter/xyz";
Group: id="Lights" items=["iris1_item"];
Group: id="Skywriter" items=["skywriter1_x", "skywriter1_y"];
Parameter: id="brokername" label="Broker Name" description="Name of the broker as defined in the &lt;broker&gt;.url in services/mqtt.cfg. See the MQTT Binding for more information on how to configure MQTT broker connections." type="Text" context="service" default="mosquitto" required ;
// MqttHost is set programmatically
Mqtt: incoming="oh2/out/" outgoing="oh2/in/" ;
ThingType: id="hue:bridge" label="Hue Bridge" description="The hue bridge represents the Philips hue bridge." parameters=[] channelTypes=[] ;
ThingType: id="hue:0200" label="Color Light" description="A dimmable light with changeable colors." ;
ThingType: id="hue:0210" label="Extended Color Light" description="A dimmable light with changeable colors and tunable color temperature." parameters=[] channelTypes=[];
ThingType: id="skywriter-hat" label="SkyWriterHAT" description="SkyWriterHAT Gesture Recognition" parameters=["brokername"] channelTypes=["flick-type", "skywriter-x", "skywriter-y"] ;
Thing: id="hue:bridge:0017880adcf4" label="Philips hue (10.8.0.160)" type="hue:bridge" channels=[] ;
Thing: id="hue:0210:0017880adcf4:1" label="Wohnzimmer" type="hue:0210" channels=["hue:0210:0017880adcf4:1:color_temperature", "hue:0210:0017880adcf4:1:effect"] ;
Thing: id="hue:0200:0017880adcf4:5" label="Hue iris 1" type="hue:0200" channels=["hue:0210:0017880adcf4:4:color", "hue:0210:0017880adcf4:4:color_temperature", "hue:0210:0017880adcf4:4:alert", "hue:0210:0017880adcf4:4:effect"] ;
Thing: id="hue:0210:0017880adcf4:4" label="Hue go 1" type="hue:0210" channels=["hue:0200:0017880adcf4:5:color", "hue:0200:0017880adcf4:5:alert", "hue:0200:0017880adcf4:5:effect"] ;
Thing: id="skywriter1" label="Our skywriter" type="skywriter-hat" channels=["skywriter1-flick", "skywriter1-x", "skywriter1-y"] ;
ChannelType: id="hue:color" label="Color" description="The color channel allows to control the color of a light. It is also possible to dim values and switch the light on and off." itemType="Color" category="ColorLight" ;
ChannelType: id="hue:alert" label="Alert" description="The alert channel allows a temporary change to the bulb’s state." itemType="String" category="Unknown" ;
ChannelType: id="hue:effect" label="Color Loop" description="The effect channel allows putting the bulb in a color looping mode." itemType="Switch" category="ColorLight" ;
ChannelType: id="hue:color_temperature" label="Color Temperature" description="The color temperature channel allows to set the color temperature of a light from 0 (cold) to 100 (warm)." itemType="Dimmer" category="ColorLight" ;
ChannelType: id="flick-type" itemType="String" label="Last Flick" description="Last Flick detected (and its direction)" category="Motion" readOnly ;
ChannelType: id="skywriter-x" itemType="String" label="Current X coordinate" description="Current X coordinate" category="Motion" readOnly ;
ChannelType: id="skywriter-y" itemType="String" label="Current Y coordinate" description="Current Y coordinate" category="Motion" readOnly ;
Channel: id="hue:0210:0017880adcf4:1:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:1:effect" type="hue:effect" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color" type="hue:color" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:alert" type="hue:alert" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:effect" type="hue:effect" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:color" type="hue:color" links=["iris1_item"] ;
Channel: id="hue:0200:0017880adcf4:5:alert" type="hue:alert" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:effect" type="hue:color" links=[] ;
Channel: id="skywriter1-flick" type="flick-type" links=[];
Channel: id="skywriter1-x" type="skywriter-x" links=["skywriter1_x"];
Channel: id="skywriter1-y" type="skywriter-y" links=["skywriter1_y"];
Item: id="iris1_item" label="Iris 1" state="121,88,68" topic="iris1_item/state";
Item: id="skywriter1_x" label="X" state="0" topic="skywriter/x";
Item: id="skywriter1_y" label="Y" state="0" topic="skywriter/y";
//Item: id="skywriter1_xyz" label="Y" state="0" topic="skywriter/xyz";
Group: id="Lights" items=["iris1_item"];
Group: id="Skywriter" items=["skywriter1_x", "skywriter1_y"];
Parameter: id="brokername" label="Broker Name" description="Name of the broker as defined in the &lt;broker&gt;.url in services/mqtt.cfg. See the MQTT Binding for more information on how to configure MQTT broker connections." type="Text" context="service" default="mosquitto" required ;
// MqttHost is set programmatically
Mqtt: incoming="oh2/out/" outgoing="oh2/in/" ;
/build/
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
apply plugin: 'java'
apply plugin: 'application'
dependencies {
compile project(':eraser-base')
compile project(':commons.color')
compile project(':feedbackloop.api')
compile project(':feedbackloop.monitor')
compile project(':feedbackloop.analyze')
compile project(':feedbackloop.plan')
compile project(':feedbackloop.execute')
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.8.1'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.10.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.10.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.hamcrest', name: 'hamcrest-junit', version: '1.0.0.0'
}
run {
mainClassName = 'de.tudresden.inf.st.eraser.smart_ankunft_integration.Main'
standardInput = System.in
if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)
}
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
}
package de.tudresden.inf.st.eraser.smart_ankunft_integration;
import beaver.Parser;
import de.tudresden.inf.st.eraser.commons.color.ColorUtils;
import de.tudresden.inf.st.eraser.commons.color.ColorUtils.RGBvalues;
import de.tudresden.inf.st.eraser.jastadd.model.Item;
import de.tudresden.inf.st.eraser.jastadd.model.Root;
import de.tudresden.inf.st.eraser.jastadd.model.Rule;
import de.tudresden.inf.st.eraser.openhab2.mqtt.MQTTUpdater;
import de.tudresden.inf.st.eraser.util.ParserUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import beaver.Parser;
import de.tudresden.inf.st.eraser.feedbackloop.analyze.AnalyzeImpl;
import de.tudresden.inf.st.eraser.feedbackloop.api.Analyze;
import de.tudresden.inf.st.eraser.feedbackloop.api.Execute;
import de.tudresden.inf.st.eraser.feedbackloop.api.Monitor;
import de.tudresden.inf.st.eraser.feedbackloop.api.Plan;
import de.tudresden.inf.st.eraser.feedbackloop.execute.ExecuteImpl;
import de.tudresden.inf.st.eraser.feedbackloop.monitor.MonitorImpl;
import de.tudresden.inf.st.eraser.feedbackloop.plan.PlanImpl;
public class Main {
private static Logger logger = LogManager.getLogger(Main.class);
/** Use thread to make random edits */
private static final boolean USE_RANDOM_EDITS = false;
/** Time to wait between random edits (only used, if USE_RANDOM_EDITS is true) */
private static final int STD_WAIT_IN_MILLI_SECONDS = 2 * 1000;
/** Use thread to read changes from openHAB */
private static final boolean USE_READ_FROM_OPENHAB = true;
/** Use real MQTT sender to propagate changes to openHAB */
private static final boolean SEND_TO_OPENHAB = true;
/** Host of MQTT broker (only used, if USE_READ_FROM_OPENHAB is true) */
//
private static final String MQTT_HOST = "localhost";
private static Analyze analyze;
private static Plan plan;
private static Execute execute;
// ignore, that result of System.in.read() is not used
@SuppressWarnings("ResultOfMethodCallIgnored")
public static void main(String[] args) throws IOException, Parser.Exception {
// use openHAB-eraser-connection to update hue (automatically done with UpdatingItem)
Root model = ParserUtils.load("smart_ankunft.eraser", Main.class);
System.out.println(model.currentActivity());
Item irisItem = model.resolveItem("iris1_item").orElseThrow(() ->
new NoSuchElementException("Iris1_item not found"));
Item userItem = model.resolveItem("user1").orElseThrow(() ->
new NoSuchElementException("User 1 not found"));
// define rule to switch color, based on xyz-to-rgb-to-hsb mapping
Rule userChanged = new Rule();
model.addRule(userChanged);
userChanged.addEventFor(userItem, "on/off changed");
// mapXYtoIrisState.addEventFor(skywriter1_y, "y changed");
userChanged.setCondition(root -> true); // always fire
userChanged.setAction(root -> updateBrightness(userItem, irisItem, model));
// get mqtt message directly from skywriter, not via binding (which is not working atm)
Lock abortLock = new ReentrantLock();
Condition abortCondition = abortLock.newCondition();
Thread readFromOpenHABThread = new Thread(() -> {
try (MQTTUpdater updater = new MQTTUpdater(model)) {
updater.start();
if (!updater.waitUntilReady(3, TimeUnit.SECONDS)) {
logger.error("openHAB reader not ready. Aborting.");
return;
}
try {
logger.debug("oh-read, attempt to lock");
abortLock.lock();
abortCondition.await();
} catch (InterruptedException e) {
logger.info("Premature exit of openHAB reader thread!");
} finally {
abortLock.unlock();
}
} catch (IOException e) {
e.printStackTrace();
}
});
if (USE_READ_FROM_OPENHAB || SEND_TO_OPENHAB) {
model.getMqttRoot().setHostByName(MQTT_HOST);
}
if (USE_READ_FROM_OPENHAB) {
readFromOpenHABThread.start();
}
//excute...
Monitor monitor = new MonitorImpl();
Analyze analyze = new AnalyzeImpl();
Plan plan = new PlanImpl();
Execute execute = new ExecuteImpl();
monitor.setAnalyze(analyze);
analyze.setPlan(plan);
plan.setExecute(execute);
monitor.setKnowledgeBase(model);
analyze.setKnowledgeBase(model);
plan.setKnowledgeBase(model);
execute.setKnowledgeBase(model);
startMAPE(userItem);
System.out.println("Press [Enter] to exit!");
System.in.read();
// wait for user to press enter
System.out.println("Stopping...");
analyze.stop();
// and then cancel the threads
try {
abortLock.lock();
abortCondition.signalAll();
} finally {
abortLock.unlock();
}
// and join everything
try {
readFromOpenHABThread.join();
} catch (InterruptedException e) {
logger.catching(e);
}
}
private static void startMAPE(Item userItem){
String user_state= userItem.getStateAsString();
if (user_state.equals("on")){
analyze.startAsThread(1, TimeUnit.SECONDS);
}
}
private static void updateBrightness(Item userItem, Item irisItem, Root model) {
String user_state= userItem.getStateAsString();
Integer brightness = 10;
if (user_state.equals("on")){
System.out.println("user 1 is on");
irisItem.setStateFromString(String.format("%d,%d,%d", 10, 10, brightness));
logger.info(model.currentActivity());
}else {
System.out.println("user 1 is off");
}
logger.info("update");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/jastadd-mquat.log"
filePattern="logs/jastadd-mquat-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
ThingType: id="hue:bridge" label="Hue Bridge" description="The hue bridge represents the Philips hue bridge." parameters=[] channelTypes=[] ;
ThingType: id="hue:0200" label="Color Light" description="A dimmable light with changeable colors." ;
ThingType: id="hue:0210" label="Extended Color Light" description="A dimmable light with changeable colors and tunable color temperature." parameters=[] channelTypes=[];
ThingType: id="skywriter-hat" label="SkyWriterHAT" description="SkyWriterHAT Gesture Recognition" parameters=["brokername"] channelTypes=["flick-type", "skywriter-x", "skywriter-y"] ;
Thing: id="hue:bridge:0017880adcf4" label="Philips hue (10.8.0.160)" type="hue:bridge" channels=[] ;
Thing: id="hue:0210:0017880adcf4:1" label="Wohnzimmer" type="hue:0210" channels=["hue:0210:0017880adcf4:1:color_temperature", "hue:0210:0017880adcf4:1:effect"] ;
Thing: id="hue:0200:0017880adcf4:5" label="Hue iris 1" type="hue:0200" channels=["hue:0210:0017880adcf4:4:color", "hue:0210:0017880adcf4:4:color_temperature", "hue:0210:0017880adcf4:4:alert", "hue:0210:0017880adcf4:4:effect"] ;
Thing: id="hue:0210:0017880adcf4:4" label="Hue go 1" type="hue:0210" channels=["hue:0200:0017880adcf4:5:color", "hue:0200:0017880adcf4:5:alert", "hue:0200:0017880adcf4:5:effect"] ;
Thing: id="skywriter1" label="Our skywriter" type="skywriter-hat" channels=["skywriter1-flick", "skywriter1-x", "skywriter1-y"] ;
ChannelType: id="hue:color" label="Color" description="The color channel allows to control the color of a light. It is also possible to dim values and switch the light on and off." itemType="Color" category="ColorLight" ;
ChannelType: id="hue:alert" label="Alert" description="The alert channel allows a temporary change to the bulb’s state." itemType="String" category="ColorLight" ;
ChannelType: id="hue:effect" label="Color Loop" description="The effect channel allows putting the bulb in a color looping mode." itemType="Switch" category="ColorLight" ;
ChannelType: id="hue:color_temperature" label="Color Temperature" description="The color temperature channel allows to set the color temperature of a light from 0 (cold) to 100 (warm)." itemType="Dimmer" category="ColorLight" ;
ChannelType: id="flick-type" itemType="String" label="Last Flick" description="Last Flick detected (and its direction)" category="Motion" readOnly ;
ChannelType: id="skywriter-x" itemType="String" label="Current X coordinate" description="Current X coordinate" category="Motion" readOnly ;
ChannelType: id="skywriter-y" itemType="String" label="Current Y coordinate" description="Current Y coordinate" category="Motion" readOnly ;
Channel: id="hue:0210:0017880adcf4:1:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:1:effect" type="hue:effect" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color" type="hue:color" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:alert" type="hue:alert" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:effect" type="hue:effect" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:color" type="hue:color" links=["iris1_item"] ;
Channel: id="hue:0200:0017880adcf4:5:alert" type="hue:alert" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:effect" type="hue:color" links=[] ;
Channel: id="skywriter1-flick" type="flick-type" links=[];
Channel: id="skywriter1-x" type="skywriter-x" links=["skywriter1_x"];
Channel: id="skywriter1-y" type="skywriter-y" links=["skywriter1_y"];
Item: id="iris1_item" label="Iris 1" state="121,88,68" topic="iris1_item/state";
Item: id="skywriter1_x" label="X" state="0" topic="skywriter/x";
Item: id="skywriter1_y" label="Y" state="0" topic="skywriter/y";
Item: id="skywriter1_xyz" label="Y" state="0" topic="skywriter/xyz";
Item: id="user1" label="User 1" state="off" topic="user1/state";
Group: id="Lights" items=["iris1_item"];
Group: id="Skywriter" items=["skywriter1_x", "skywriter1_y"];
Parameter: id="brokername" label="Broker Name" description="Name of the broker as defined in the &lt;broker&gt;.url in services/mqtt.cfg. See the MQTT Binding for more information on how to configure MQTT broker connections." type="Text" context="service" default="mosquitto" required ;
// MqttHost is set programmatically
Mqtt: incoming="oh2/out/" outgoing="oh2/in/" host="localhost";
package de.tudresden.inf.st.eraser.smart_ankunft_integration;
import de.tudresden.inf.st.eraser.jastadd.model.*;
import org.junit.Test;
import java.util.Set;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.fail;
/**
* TODO: Add description.
*
* @author rschoene - Initial contribution
*/
public class ATest {
@Test
public void test1() {
fail();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/Python
\ No newline at end of file
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
unset -f pydoc >/dev/null 2>&1
# reset old environment variables
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
PS1="$_OLD_VIRTUAL_PS1"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "${1-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/Users/boqi/eraser/venv"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
if ! [ -z "${PYTHONHOME+_}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="$PS1"
if [ "x" != x ] ; then
PS1="$PS1"
else
PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1"
fi
export PS1
fi
# Make sure to unalias pydoc if it's already there
alias pydoc 2>/dev/null >/dev/null && unalias pydoc
pydoc () {
python -m pydoc "$@"
}
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/Users/boqi/eraser/venv"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
if ("" != "") then
set env_name = ""
else
set env_name = `basename "$VIRTUAL_ENV"`
endif
# Could be in a non-interactive environment,
# in which case, $prompt is undefined and we wouldn't
# care about the prompt anyway.
if ( $?prompt ) then
set _OLD_VIRTUAL_PROMPT="$prompt"
set prompt = "[$env_name] $prompt"
endif
unset env_name
alias pydoc python -m pydoc
rehash
# This file must be used using `. bin/activate.fish` *within a running fish ( http://fishshell.com ) session*.
# Do not run it directly.
function deactivate -d 'Exit virtualenv mode and return to the normal environment.'
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
# Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`.
set -l fish_function_path
# Erase virtualenv's `fish_prompt` and restore the original.
functions -e fish_prompt
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
end
set -e VIRTUAL_ENV
if test "$argv[1]" != 'nondestructive'
# Self-destruct!
functions -e pydoc
functions -e deactivate
end
end
# Unset irrelevant variables.
deactivate nondestructive
set -gx VIRTUAL_ENV "/Users/boqi/eraser/venv"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# Unset `$PYTHONHOME` if set.
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
function pydoc
python -m pydoc $argv
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# Copy the current `fish_prompt` function as `_old_fish_prompt`.
functions -c fish_prompt _old_fish_prompt
function fish_prompt
# Save the current $status, for fish_prompts that display it.
set -l old_status $status
# Prompt override provided?
# If not, just prepend the environment name.
if test -n ""
printf '%s%s' "" (set_color normal)
else
printf '%s(%s) ' (set_color normal) (basename "$VIRTUAL_ENV")
end
# Restore the original $status
echo "exit $old_status" | source
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end
"""By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used when you must use an existing Python interpreter, not
the virtualenv bin/python
"""
try:
__file__
except NameError:
raise AssertionError(
"You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))")
import sys
import os
old_os_path = os.environ.get('PATH', '')
os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if sys.platform == 'win32':
site_packages = os.path.join(base, 'Lib', 'site-packages')
else:
site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages')
prev_sys_path = list(sys.path)
import site
site.addsitedir(site_packages)
sys.real_prefix = sys.prefix
sys.prefix = base
# Move the added items to the front of the path:
new_sys_path = []
for item in list(sys.path):
if item not in prev_sys_path:
new_sys_path.append(item)
sys.path.remove(item)
sys.path[:0] = new_sys_path
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment