Search in sources :

Example 6 with Module

use of org.eclipse.smarthome.automation.Module in project smarthome by eclipse.

the class CompositeModuleHandlerFactory method ungetHandler.

@SuppressWarnings({ "unchecked" })
@Override
public void ungetHandler(Module module, String childModulePrefix, ModuleHandler handler) {
    ModuleHandler handlerOfModule = getHandlers().get(childModulePrefix + module.getId());
    if (handlerOfModule instanceof AbstractCompositeModuleHandler) {
        AbstractCompositeModuleHandler<Module, ?, ?> h = (AbstractCompositeModuleHandler<Module, ?, ?>) handlerOfModule;
        Set<Module> modules = h.moduleHandlerMap.keySet();
        if (modules != null) {
            for (Module child : modules) {
                ModuleHandler childHandler = h.moduleHandlerMap.get(child);
                ModuleHandlerFactory mhf = ruleEngine.getModuleHandlerFactory(child.getTypeUID());
                mhf.ungetHandler(child, childModulePrefix + ":" + module.getId(), childHandler);
            }
        }
    }
    String ruleId = getRuleId(childModulePrefix);
    super.ungetHandler(module, ruleId, handler);
}
Also used : ModuleHandler(org.eclipse.smarthome.automation.handler.ModuleHandler) BaseModuleHandlerFactory(org.eclipse.smarthome.automation.handler.BaseModuleHandlerFactory) ModuleHandlerFactory(org.eclipse.smarthome.automation.handler.ModuleHandlerFactory) Module(org.eclipse.smarthome.automation.Module)

Aggregations

Module (org.eclipse.smarthome.automation.Module)6 Configuration (org.eclipse.smarthome.config.core.Configuration)3 Action (org.eclipse.smarthome.automation.Action)2 Condition (org.eclipse.smarthome.automation.Condition)2 Test (org.junit.Test)2 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 Future (java.util.concurrent.Future)1 Consumes (javax.ws.rs.Consumes)1 PUT (javax.ws.rs.PUT)1 Path (javax.ws.rs.Path)1 Rule (org.eclipse.smarthome.automation.Rule)1 RuleStatusInfo (org.eclipse.smarthome.automation.RuleStatusInfo)1 Trigger (org.eclipse.smarthome.automation.Trigger)1 BaseModuleHandlerFactory (org.eclipse.smarthome.automation.handler.BaseModuleHandlerFactory)1 ModuleHandler (org.eclipse.smarthome.automation.handler.ModuleHandler)1 ModuleHandlerFactory (org.eclipse.smarthome.automation.handler.ModuleHandlerFactory)1 ModuleType (org.eclipse.smarthome.automation.type.ModuleType)1 ConfigDescriptionParameter (org.eclipse.smarthome.config.core.ConfigDescriptionParameter)1