1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-21 02:32:26 +01:00

Move settimeout earlier

This commit is contained in:
Jonathan Swoboda 2025-01-23 10:52:06 -05:00
parent dc5b408748
commit 7f50763cf6

View File

@ -249,6 +249,9 @@ def perform_ota(
send_check(sock, result, "auth result")
receive_exactly(sock, 1, "auth result", RESPONSE_AUTH_OK)
# Set higher timeout during upload
sock.settimeout(30.0)
upload_size = len(upload_contents)
upload_size_encoded = [
(upload_size >> 24) & 0xFF,
@ -271,8 +274,6 @@ def perform_ota(
# show the actual progress
sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, UPLOAD_BUFFER_SIZE)
# Set higher timeout during upload
sock.settimeout(30.0)
start_time = time.perf_counter()
offset = 0