Dial immediately when no client has ever connected and polish review nits

This commit is contained in:
J. Nick Koston
2026-08-31 17:36:57 -04:00
parent 5fbe09b68c
commit 79325fe59a
6 changed files with 50 additions and 13 deletions
@@ -5,9 +5,8 @@ wifi:
ssid: MySSID
password: password1
# Outgoing connection: the device dials Home Assistant when no client with a
# state subscription is connected. Requires encryption so the peer is
# verified by key.
# Outgoing connection: the device dials out when no dial-back client is
# connected. Requires encryption so the peer is verified by key.
api:
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
@@ -153,8 +153,9 @@ async def test_api_outgoing_connection_remembered(
"""No host configured: the device remembers the client whose hello carried
the dial-back flag and dials that address after a restart."""
listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Bound but not yet listening: dial attempts in the first phase are
# refused, exercising the retry path without queueing stale connections.
# Bound but not yet listening so first-phase dials cannot queue stale
# connections; whether the device attempts any dial before the restart
# is timing dependent and not asserted here.
listener.bind(("127.0.0.1", 0))
port = listener.getsockname()[1]