Skip to content

Prevent reconnect when desk is already connected#37

Open
Dinges28 wants to merge 1 commit intoabmantis:mainfrom
Dinges28:patch-1
Open

Prevent reconnect when desk is already connected#37
Dinges28 wants to merge 1 commit intoabmantis:mainfrom
Dinges28:patch-1

Conversation

@Dinges28
Copy link

@Dinges28 Dinges28 commented Feb 8, 2026

This fixes the root cause of the “Notifications are already enabled” BleakError.

The ConnectionManager could call _connect() while the desk was already connected, causing BLE notifications to be registered multiple times. This resulted in Bleak raising an error and Home Assistant logging repeated task exceptions.

This change adds an early guard using idasen_desk.is_connected to prevent reconnect attempts when the connection is already active.

This avoids duplicate connect/pair/notify calls and fixes the BLE race condition instead of suppressing errors.

Tested with IKEA Idasen desks via ESP32 Bluetooth Proxy and native BLE.

This fixes the root cause of the “Notifications are already enabled” BleakError.

The ConnectionManager could call `_connect()` while the desk was already connected,
causing BLE notifications to be registered multiple times. This resulted in
Bleak raising an error and Home Assistant logging repeated task exceptions.

This change adds an early guard using `idasen_desk.is_connected` to prevent
reconnect attempts when the connection is already active.

This avoids duplicate connect/pair/notify calls and fixes the BLE race condition
instead of suppressing errors.

Tested with IKEA Idasen desks via ESP32 Bluetooth Proxy and native BLE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant