1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-15 17:38:15 +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") send_check(sock, result, "auth result")
receive_exactly(sock, 1, "auth result", RESPONSE_AUTH_OK) 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 = len(upload_contents)
upload_size_encoded = [ upload_size_encoded = [
(upload_size >> 24) & 0xFF, (upload_size >> 24) & 0xFF,
@ -271,8 +274,6 @@ def perform_ota(
# show the actual progress # show the actual progress
sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, UPLOAD_BUFFER_SIZE) 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() start_time = time.perf_counter()
offset = 0 offset = 0