mirror of
https://github.com/esphome/esphome.git
synced 2026-10-05 02:21:30 +00:00
Dial immediately when no client has ever connected and polish review nits
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user