From eaa3960e13c242ea51a7922d86004e129cab3690 Mon Sep 17 00:00:00 2001 From: alexanderpett <44246286+alexanderpett@users.noreply.github.com> Date: Sun, 12 Jul 2026 14:12:27 +0200 Subject: [PATCH 1/2] Disable Plejd BLE double-connect workaround --- pyplejd/ble/__init__.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pyplejd/ble/__init__.py b/pyplejd/ble/__init__.py index 3b15e85..2d0f2d2 100644 --- a/pyplejd/ble/__init__.py +++ b/pyplejd/ble/__init__.py @@ -124,20 +124,10 @@ def _disconnect(client: BleakClient): max_attempts=2, ) - # Workaround for problem in plejd firmware 2026-05-20 - # Disconnect and connect again - _CONNECTION_LOG.debug( - "BT Proxy workaround - Disconnecting for 5 seconds." - ) - await client.disconnect() - await asyncio.sleep(5) - _CONNECTION_LOG.debug("BT Proxy workaround - Reconnecting") - client = await establish_connection( - BleakClientWithServiceCache, - node.bleDevice, - node.bleDevice.name, - _disconnect, - ) + # Disabled local test patch: + # The double-connect workaround can destabilize newer Plejd firmware. + # Use the first established connection directly and attach the disconnect callback. + client.set_disconnected_callback(_disconnect) if not await self._authenticate(client): await client.disconnect() From 951d76b9cc23c3d0c4eac45ca3cd74154d2cb852 Mon Sep 17 00:00:00 2001 From: alexanderpett <44246286+alexanderpett@users.noreply.github.com> Date: Sun, 12 Jul 2026 14:12:38 +0200 Subject: [PATCH 2/2] Mark patched pyplejd version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 63ce742..4828883 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ MIN_PY_VERSION = "3.10" PACKAGES = find_packages() -VERSION = "0.21.3" +VERSION = "0.21.3.post1" setup( name="pyplejd",