From ed0ef338eb606977993d45c98421ebde0f477927 Mon Sep 17 00:00:00 2001 From: e21206 Date: Mon, 28 Aug 2023 22:33:30 +0200 Subject: [PATCH] fix: bec_utils mixin --- ophyd_devices/utils/bec_utils.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ophyd_devices/utils/bec_utils.py b/ophyd_devices/utils/bec_utils.py index 6a944d0..d30200d 100644 --- a/ophyd_devices/utils/bec_utils.py +++ b/ophyd_devices/utils/bec_utils.py @@ -1,8 +1,29 @@ +import time + from bec_lib.core import bec_logger + logger = bec_logger.logger class MockProducer: - def set_and_publish(endpoint: str, msgdump: str): + def set_and_publish(self, endpoint: str, msgdump: str): logger.info(f"BECMessage to {endpoint} with msg dump {msgdump}") + + +class MockDeviceManager: + def __init__(self) -> None: + self.devices = devices() + + +class devices: + def __init__(self): + self.mokev = mokev() + + +class mokev: + def __init__(self): + self.name = "mock_mokev" + + def read(self): + return {self.name: {"value": 12.4, "timestamp": time.time()}}