use of org.eclipse.smarthome.automation.module.script.internal.handler.ScriptConditionHandler in project smarthome by eclipse.
the class ScriptModuleHandlerFactory method internalCreate.
@Override
protected ModuleHandler internalCreate(Module module, String ruleUID) {
logger.trace("create {} -> {}", module.getId(), module.getTypeUID());
String moduleTypeUID = module.getTypeUID();
if (moduleTypeUID != null) {
if (ScriptConditionHandler.SCRIPT_CONDITION.equals(moduleTypeUID) && module instanceof Condition) {
ScriptConditionHandler handler = new ScriptConditionHandler((Condition) module, ruleUID, scriptEngineManager);
return handler;
} else if (ScriptActionHandler.SCRIPT_ACTION_ID.equals(moduleTypeUID) && module instanceof Action) {
ScriptActionHandler handler = new ScriptActionHandler((Action) module, ruleUID, scriptEngineManager);
return handler;
} else {
logger.error("The ModuleHandler is not supported: {}", moduleTypeUID);
}
} else {
logger.error("ModuleType is not registered: {}", moduleTypeUID);
}
return null;
}
Aggregations