fix(static-device-test): Add device-manager as optional input to StaticDeviceTest

This commit is contained in:
2026-01-29 13:46:05 +01:00
committed by Jan Wyzula
parent 5480596c60
commit 9cb66b2db8

View File

@@ -32,6 +32,7 @@ class StaticDeviceTest:
output_file: TextIOWrapper | None = None, output_file: TextIOWrapper | None = None,
config_file: str | None = None, config_file: str | None = None,
config_dict: dict[str, dict] | None = None, config_dict: dict[str, dict] | None = None,
device_manager_ds: object | None = None,
) -> None: ) -> None:
""" """
Initialize the StaticDeviceTest class. Either output_file or config_dict must be provided. Initialize the StaticDeviceTest class. Either output_file or config_dict must be provided.
@@ -50,6 +51,7 @@ class StaticDeviceTest:
self.config = config_dict self.config = config_dict
self.config_file = "" self.config_file = ""
self.file = output_file self.file = output_file
self.device_manager_ds = device_manager_ds
@staticmethod @staticmethod
def read_config(config) -> dict: def read_config(config) -> dict:
@@ -172,7 +174,7 @@ class StaticDeviceTest:
try: try:
conf_in = copy.deepcopy(conf) conf_in = copy.deepcopy(conf)
conf_in["name"] = name conf_in["name"] = name
obj, _ = device_manager.construct_device_obj(conf_in, None) obj, _ = device_manager.construct_device_obj(conf_in, self.device_manager_ds)
device_manager.connect_device( device_manager.connect_device(
obj, wait_for_all=True, timeout=timeout_per_device, force=force_connect obj, wait_for_all=True, timeout=timeout_per_device, force=force_connect