Search in sources :

Example 1 with TimeOfDayTriggerHandler

use of org.eclipse.smarthome.automation.module.timer.handler.TimeOfDayTriggerHandler 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;
}
Also used : GenericCronTriggerHandler(org.eclipse.smarthome.automation.module.timer.handler.GenericCronTriggerHandler) Condition(org.eclipse.smarthome.automation.Condition) Trigger(org.eclipse.smarthome.automation.Trigger) DayOfWeekConditionHandler(org.eclipse.smarthome.automation.module.timer.handler.DayOfWeekConditionHandler) TimeOfDayTriggerHandler(org.eclipse.smarthome.automation.module.timer.handler.TimeOfDayTriggerHandler)

Aggregations

Condition (org.eclipse.smarthome.automation.Condition)1 Trigger (org.eclipse.smarthome.automation.Trigger)1 DayOfWeekConditionHandler (org.eclipse.smarthome.automation.module.timer.handler.DayOfWeekConditionHandler)1 GenericCronTriggerHandler (org.eclipse.smarthome.automation.module.timer.handler.GenericCronTriggerHandler)1 TimeOfDayTriggerHandler (org.eclipse.smarthome.automation.module.timer.handler.TimeOfDayTriggerHandler)1