From ea44166814fb7c73d41f532cdcb10b8b81e58b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 22 Feb 2024 02:35:21 +0100 Subject: [PATCH] Improve the error message on OTA version mismatch (#6259) --- esphome/espota2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esphome/espota2.py b/esphome/espota2.py index cdf6d7df32..580536153a 100644 --- a/esphome/espota2.py +++ b/esphome/espota2.py @@ -206,8 +206,11 @@ def perform_ota( _, version = receive_exactly(sock, 2, "version", RESPONSE_OK) _LOGGER.debug("Device support OTA version: %s", version) - if version not in (OTA_VERSION_1_0, OTA_VERSION_2_0): - raise OTAError(f"Unsupported OTA version {version}") + supported_versions = (OTA_VERSION_1_0, OTA_VERSION_2_0) + if version not in supported_versions: + raise OTAError( + f"Device uses unsupported OTA version {version}, this ESPHome supports {supported_versions}" + ) # Features send_check(sock, FEATURE_SUPPORTS_COMPRESSION, "features")