use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class WemoCoffeeHandler method initialize.
@Override
public void initialize() {
Configuration configuration = getConfig();
if (configuration.get("udn") != null) {
logger.debug("Initializing WemoCoffeeHandler for UDN '{}'", configuration.get("udn"));
onSubscription();
onUpdate();
updateStatus(ThingStatus.ONLINE);
} else {
logger.debug("Cannot initalize WemoCoffeeHandler. UDN not set.");
}
}
use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class WemoHandler method onUpdate.
private synchronized void onUpdate() {
if (refreshJob == null || refreshJob.isCancelled()) {
Configuration config = getThing().getConfiguration();
int refreshInterval = DEFAULT_REFRESH_INTERVAL;
Object refreshConfig = config.get("refresh");
if (refreshConfig != null) {
refreshInterval = ((BigDecimal) refreshConfig).intValue();
}
refreshJob = scheduler.scheduleWithFixedDelay(refreshRunnable, 0, refreshInterval, TimeUnit.SECONDS);
}
}
use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class RuleEngineTest method createTriggers.
private List<Trigger> createTriggers(String type) {
List<Trigger> triggers = new ArrayList<Trigger>();
Configuration configurations = new Configuration();
configurations.put("a", "x");
configurations.put("b", "y");
configurations.put("c", "z");
triggers.add(new Trigger("triggerId", type, configurations));
return triggers;
}
use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class RuleEngineTest method createConditions.
private List<Condition> createConditions(String type) {
List<Condition> conditions = new ArrayList<Condition>();
Configuration configurations = new Configuration();
configurations.put("a", "x");
configurations.put("b", "y");
configurations.put("c", "z");
Map<String, String> inputs = new HashMap<String, String>(11);
String ouputModuleId = "triggerId";
String outputName = "triggerOutput";
String inputName = "conditionInput";
inputs.put(inputName, ouputModuleId + "." + outputName);
conditions.add(new Condition("conditionId", type, configurations, inputs));
return conditions;
}
use of org.eclipse.smarthome.config.core.Configuration in project smarthome by eclipse.
the class RuleTemplateRegistry method copyTriggers.
private List<Trigger> copyTriggers(List<Trigger> triggers) {
List<Trigger> res = new ArrayList<Trigger>(11);
if (triggers != null) {
for (Trigger t : triggers) {
Configuration c = new Configuration();
c.setProperties(t.getConfiguration().getProperties());
Trigger trigger = new Trigger(t.getId(), t.getTypeUID(), c);
trigger.setLabel(t.getLabel());
trigger.setDescription(t.getDescription());
res.add(trigger);
}
}
return res;
}
Aggregations