Tuya-BLE
Tuya-BLE copied to clipboard
Duplicate BLE notifications after reconnect break message assembly ("Missing packet")
Device: Raykube AT1 / A1 Pro Max (product_id rlyxv7pe), keep_connect enabled.
Problem: after each reconnect, the notification subscription seems to accumulate, so every packet arrives 2x, 3x, etc. This breaks message assembly and the log fills with "Missing packet" and "Sending device info request failed". The lock becomes unreliable until HA restarts.
Workaround I'm using locally (in _notification_handler, right after self._last_rx_time = time.monotonic()):
if bytes(data) == getattr(self, "_last_notify_packet", None):
return
self._last_notify_packet = bytes(data)
It drops a packet that is byte-identical to the previous one. It works for me, but the proper fix is probably to stop_notify / avoid re-subscribing on reconnect.
Tested up to 778071b; still reproducible.