66
77
88class BaseController :
9- def __init__ (self , path : list [str ] | None = None ) -> None :
9+ def __init__ (
10+ self , path : list [str ] | None = None , search_device_for_attributes : bool = True
11+ ) -> None :
1012 self ._path : list [str ] = path or []
11- self .__sub_controller_tree : dict [str , BaseController ] = {}
13+ # If this is set to `False`, FastCS will only use attributes defined in
14+ # `additional_attributes`.
15+ self .search_device_for_attributes = search_device_for_attributes
1216
17+ self .__sub_controller_tree : dict [str , BaseController ] = {}
1318 self ._bind_attrs ()
1419
1520 @property
16- def additional_attributes (self ) -> dict [str , Attribute ] | None :
17- """FastCS will look for attributes on the controller, but additional attribtues
18- be provided here ."""
19- return None
21+ def additional_attributes (self ) -> dict [str , Attribute ]:
22+ """FastCS will look for attributes on the controller, but additional attributes
23+ are provided by this method ."""
24+ return {}
2025
2126 @property
2227 def path (self ) -> list [str ]:
@@ -58,8 +63,8 @@ class Controller(BaseController):
5863 generating a UI or creating parameters for a control system.
5964 """
6065
61- def __init__ (self ) -> None :
62- super ().__init__ ()
66+ def __init__ (self , search_device_for_attributes : bool = True ) -> None :
67+ super ().__init__ (search_device_for_attributes = search_device_for_attributes )
6368
6469 async def initialise (self ) -> None :
6570 pass
@@ -75,5 +80,5 @@ class SubController(BaseController):
7580 it as part of a larger device.
7681 """
7782
78- def __init__ (self ) -> None :
79- super ().__init__ ()
83+ def __init__ (self , search_device_for_attributes : bool = True ) -> None :
84+ super ().__init__ (search_device_for_attributes = search_device_for_attributes )
0 commit comments