Added Zigbee attribute reading daemon
This commit is contained in:
parent
68054ebf4f
commit
9e6172caeb
7 changed files with 116 additions and 25 deletions
|
|
@ -117,6 +117,22 @@ public abstract class HalAbstractControllerManager<T extends HalAbstractControll
|
|||
return new ArrayList<>(controllerMap.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param controllerClass the class of the wanted controller
|
||||
* @return the first controller matching the given class, null if no controller was found.
|
||||
*/
|
||||
public static <T> T getController(Class<T> controllerClass) {
|
||||
for (HalAbstractController controller : HalAbstractControllerManager.getControllers()) {
|
||||
if (controllerClass.isAssignableFrom(controller.getClass())) {
|
||||
return (T) controller;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Will return a singleton controller instance of the given class.
|
||||
* If a instance does not exist yet the a new instance will be allocated
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue