diff --git a/masque/library/device_library.py b/masque/library/device_library.py index 6f4b0c9..f1a3b6f 100644 --- a/masque/library/device_library.py +++ b/masque/library/device_library.py @@ -78,16 +78,15 @@ class DeviceLibrary: def __repr__(self) -> str: return '' - def set_const(self, key: str, const: 'Device') -> None: + def set_const(self, const: 'Device') -> None: """ Convenience function to avoid having to manually wrap - constant values into callables. + already-generated Device objects into callables. Args: - key: Lookup key, usually the device name - const: Device object to return + const: Pre-generated device object """ - self.generators[key] = lambda: const + self.generators[const.pattern.name] = lambda: const def add(self: L, other: L) -> L: """