use of org.eclipse.smarthome.automation.module.timer.handler.GenericCronTriggerHandler in project smarthome by eclipse.
the class TimerModuleHandlerFactory method internalCreate.
@Override
protected ModuleHandler internalCreate(Module module, String ruleUID) {
logger.trace("create {} -> {}", module.getId(), module.getTypeUID());
String moduleTypeUID = module.getTypeUID();
if (GenericCronTriggerHandler.MODULE_TYPE_ID.equals(moduleTypeUID) && module instanceof Trigger) {
return new GenericCronTriggerHandler((Trigger) module);
} else if (TimeOfDayTriggerHandler.MODULE_TYPE_ID.equals(moduleTypeUID) && module instanceof Trigger) {
return new TimeOfDayTriggerHandler((Trigger) module);
} else if (DayOfWeekConditionHandler.MODULE_TYPE_ID.equals(moduleTypeUID) && module instanceof Condition) {
return new DayOfWeekConditionHandler((Condition) module);
} else {
logger.error("The module handler type '{}' is not supported.", moduleTypeUID);
}
return null;
}
Aggregations