From 97b16b02bce4e43ebf0a2d9beb4944b69af5f0c4 Mon Sep 17 00:00:00 2001 From: Floris272 Date: Mon, 18 Mar 2024 08:31:24 +0100 Subject: [PATCH] Move where received_charge_points event is set. --- src/bluecurrent_api/websocket.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bluecurrent_api/websocket.py b/src/bluecurrent_api/websocket.py index e72be93..37eb28b 100644 --- a/src/bluecurrent_api/websocket.py +++ b/src/bluecurrent_api/websocket.py @@ -165,7 +165,6 @@ async def _message_handler( return if object_name == "CHARGE_POINTS": - self.received_charge_points.set() handle_charge_points(message) elif object_name == "CH_STATUS": handle_status(message) @@ -187,6 +186,9 @@ async def _message_handler( await receiver(message) + if object_name == "CHARGE_POINTS": + self.received_charge_points.set() + async def _send(self, data: dict[str, Any]) -> None: """Send data to the websocket.""" if self.conn: