Skip to content

Commit b9ce00a

Browse files
committed
Merge connectionspec and connectionparameters
1 parent d4afc17 commit b9ce00a

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/dodal/device_manager.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,11 @@ def build(self, mock: bool = False, fixtures: dict[str, Any] | None = None) -> V
291291
return device # type: ignore - it's us really, promise
292292

293293

294-
class ConnectionParameters(NamedTuple):
295-
mock: bool
296-
timeout: float
297-
298294

299295
class ConnectionSpec(NamedTuple):
300296
device: OphydV2Device
301-
params: ConnectionParameters
297+
mock: bool
298+
timeout: float
302299

303300

304301
class ConnectionResult(NamedTuple):
@@ -324,7 +321,7 @@ def connect(self, timeout: float | None = None) -> ConnectionResult:
324321
connections = {}
325322
connected = {}
326323
loop: asyncio.EventLoop = get_bluesky_event_loop() # type: ignore
327-
for name, (device, (mock, dev_timeout)) in self.devices.items():
324+
for name, (device, mock, dev_timeout) in self.devices.items():
328325
if not isinstance(device, OphydV2Device):
329326
connected[name] = device
330327
continue
@@ -504,10 +501,8 @@ def build_devices(
504501
built_device = factory._create(**params)
505502
built[device] = ConnectionSpec(
506503
built_device,
507-
ConnectionParameters(
508-
mock=mock or factory.mock,
509-
timeout=factory.timeout,
510-
),
504+
mock=mock or factory.mock,
505+
timeout=factory.timeout,
511506
)
512507
except Exception as e:
513508
errors[device] = e

0 commit comments

Comments
 (0)