From ff0cfffa3d65e5bfd0b86ccbe395ee3fcc9e2fea Mon Sep 17 00:00:00 2001 From: tensorturtle Date: Tue, 21 Nov 2023 14:54:54 +0900 Subject: [PATCH 1/2] set response=True for write_gatt_char to fix silent failure --- pycycling/fitness_machine_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycycling/fitness_machine_service.py b/pycycling/fitness_machine_service.py index 5f4dc6c..be49b7c 100644 --- a/pycycling/fitness_machine_service.py +++ b/pycycling/fitness_machine_service.py @@ -192,7 +192,7 @@ def _control_point_response_handler( async def request_control(self) -> None: message = form_ftms_control_command(FTMSControlPointOpCode.REQUEST_CONTROL) await self._client.write_gatt_char( - ftms_fitness_machine_control_point_characteristic_id, message, False + ftms_fitness_machine_control_point_characteristic_id, message, True ) async def reset(self) -> None: From 85fd6bc931ded1f9ef00f44a376b3f3c07882e93 Mon Sep 17 00:00:00 2001 From: tensorturtle Date: Tue, 21 Nov 2023 15:00:47 +0900 Subject: [PATCH 2/2] the rest --- pycycling/fitness_machine_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pycycling/fitness_machine_service.py b/pycycling/fitness_machine_service.py index be49b7c..4e484dd 100644 --- a/pycycling/fitness_machine_service.py +++ b/pycycling/fitness_machine_service.py @@ -198,7 +198,7 @@ async def request_control(self) -> None: async def reset(self) -> None: message = form_ftms_control_command(FTMSControlPointOpCode.RESET) await self._client.write_gatt_char( - ftms_fitness_machine_control_point_characteristic_id, message, False + ftms_fitness_machine_control_point_characteristic_id, message, True ) async def set_target_resistance_level(self, level: int) -> None: @@ -206,7 +206,7 @@ async def set_target_resistance_level(self, level: int) -> None: FTMSControlPointOpCode.SET_TARGET_RESISTANCE_LEVEL, int(level) ) await self._client.write_gatt_char( - ftms_fitness_machine_control_point_characteristic_id, message, False + ftms_fitness_machine_control_point_characteristic_id, message, True ) async def set_target_power(self, power: int) -> None: @@ -214,5 +214,5 @@ async def set_target_power(self, power: int) -> None: FTMSControlPointOpCode.SET_TARGET_POWER, int(power) ) await self._client.write_gatt_char( - ftms_fitness_machine_control_point_characteristic_id, message, False + ftms_fitness_machine_control_point_characteristic_id, message, True )