1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-14 17:08:22 +00:00

[ota] Increase socket timeout earlier in OTA script (#8129)

This commit is contained in:
Jonathan Swoboda 2025-02-09 23:42:40 -05:00 committed by GitHub
parent 1ab1768b6a
commit 8be9f02693
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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