From 7455225bc8d18d4bb0154fa0e2221917af29727d Mon Sep 17 00:00:00 2001 From: Benjamin <46243805+bbr111@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:07:31 +0100 Subject: [PATCH] fix error - handle module 5 --- bydhvs/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bydhvs/__init__.py b/bydhvs/__init__.py index af6140b..3cf155f 100644 --- a/bydhvs/__init__.py +++ b/bydhvs/__init__.py @@ -671,12 +671,7 @@ async def state10_send_request8(self) -> None: async def state11_send_request9(self) -> None: """Handle additional cells for more than 128 cells (e.g., 5 modules)""" # State 11: Send request 9 - Switch to second pass - if self.current_tower == 0: - await self.send_request(self.my_requests['start_measure_box_1']) - elif self.current_tower == 1: - await self.send_request(self.my_requests['start_measure_box_2']) - elif self.current_tower == 2: - await self.send_request(self.my_requests['start_measure_box_3']) + await self.send_request(self.my_requests['switch_pass']) data = await self.receive_response() if data and self.check_packet(data): self.my_state = 12 @@ -686,7 +681,12 @@ async def state11_send_request9(self) -> None: async def state12_send_request10(self) -> None: """State 12: Send request 10 - Start measurement""" - await self.send_request(self.my_requests['start_measurement']) + if self.current_tower == 0: + await self.send_request(self.my_requests['start_measure_box_1']) + elif self.current_tower == 1: + await self.send_request(self.my_requests['start_measure_box_2']) + elif self.current_tower == 2: + await self.send_request(self.my_requests['start_measure_box_3']) data = await self.receive_response() if data and self.check_packet(data): # Wait time as per original code (e.g., 3 seconds)