From 7d4a7d48ee9525b1875632af7f1541f070b5cdb3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 21 Sep 2025 10:26:52 -0600 Subject: [PATCH] remove unreachable code --- esphome/espota2.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/esphome/espota2.py b/esphome/espota2.py index 36eb4d68ea..ba47e6af0d 100644 --- a/esphome/espota2.py +++ b/esphome/espota2.py @@ -286,11 +286,8 @@ def perform_ota( [RESPONSE_REQUEST_AUTH, RESPONSE_REQUEST_SHA256_AUTH, RESPONSE_AUTH_OK], ) - if auth in _AUTH_METHODS: - hash_func, nonce_size, hash_name = _AUTH_METHODS[auth] - perform_auth(sock, password, hash_func, nonce_size, hash_name) - elif auth != RESPONSE_AUTH_OK: - raise OTAError(f"Unknown authentication method requested: 0x{auth:02X}") + hash_func, nonce_size, hash_name = _AUTH_METHODS[auth] + perform_auth(sock, password, hash_func, nonce_size, hash_name) # Set higher timeout during upload sock.settimeout(30.0)