From f80f64b0861053be7752a200d2ea6e131cf8ae34 Mon Sep 17 00:00:00 2001 From: Stijn van Houwelingen Date: Thu, 19 Feb 2026 15:47:16 +0100 Subject: [PATCH] fix: fix CEM get_message function using fix for Pydantic 1.0 Signed-off-by: Stijn van Houwelingen --- src/flexmeasures_client/s2/cem.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/flexmeasures_client/s2/cem.py b/src/flexmeasures_client/s2/cem.py index b13f85af..1cf9ab58 100644 --- a/src/flexmeasures_client/s2/cem.py +++ b/src/flexmeasures_client/s2/cem.py @@ -235,13 +235,7 @@ async def get_message(self) -> str: """ message = await self._sending_queue.get() - await asyncio.sleep(0.3) - - # Pending for pydantic V2 to implement model.model_dump(mode="json") in - # PR #1409 (https://github.com/pydantic/pydantic/issues/1409) - message = json.loads(message.json()) - - return message + return message.model_dump(mode="json") async def activate_control_type( self, control_type: ControlType