File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -49,18 +49,23 @@ def get_scan_and_initial_coros(
4949 initial_coros : list [Callable ] = []
5050
5151 for controller_api in self .walk_api ():
52- _add_scan_method_tasks (scan_dict , controller_api )
52+ _add_scan_method_tasks (scan_dict , initial_coros , controller_api )
5353 _add_attribute_update_tasks (scan_dict , initial_coros , controller_api )
5454
5555 scan_coros = _get_periodic_scan_coros (scan_dict )
5656 return scan_coros , initial_coros
5757
5858
5959def _add_scan_method_tasks (
60- scan_dict : dict [float , list [Callable ]], controller_api : ControllerAPI
60+ scan_dict : dict [float , list [Callable ]],
61+ initial_coros : list [Callable ],
62+ controller_api : ControllerAPI ,
6163):
6264 for method in controller_api .scan_methods .values ():
63- scan_dict [method .period ].append (method .fn )
65+ if method .period is ONCE :
66+ initial_coros .append (method .fn )
67+ else :
68+ scan_dict [method .period ].append (method .fn )
6469
6570
6671def _add_attribute_update_tasks (
You can’t perform that action at this time.
0 commit comments