Repository navigation
Fixes a connection that could hang forever without ever identifying.
Seen twice on real hardware, both after a Home Assistant restart: the sign completes the TCP handshake and then sends nothing. ss showed segs_in: 2 — the handshake and nothing else — with lastrcv past four minutes, while the sign believed it was connected and the server reported it absent (accepted=1, identified=0). Reloading the integration cleared it, which is not a fix.
The socket hung in the TLS sniff, not the read loop: _peek awaits six bytes that never arrive, so the connection never reached the loop and a guard there would never have run. Both paths are now bounded by identify_timeout (default 120 s; None disables).
Only applies before a device identifies — a sign that has introduced itself may legitimately hold its socket quiet between heartbeats, and closing that would be a regression. There is a test for each half.
Also: ServerStats.unidentified_timeouts counts it, and a test-only lz4 import was removed so the suite collects without the optional dependency.
1155 tests.