mirror of
https://github.com/esphome/esphome.git
synced 2024-11-08 09:40:53 +01:00
Improve the error message on OTA version mismatch (#6259)
This commit is contained in:
parent
481f067625
commit
ea44166814
@ -206,8 +206,11 @@ def perform_ota(
|
|||||||
|
|
||||||
_, version = receive_exactly(sock, 2, "version", RESPONSE_OK)
|
_, version = receive_exactly(sock, 2, "version", RESPONSE_OK)
|
||||||
_LOGGER.debug("Device support OTA version: %s", version)
|
_LOGGER.debug("Device support OTA version: %s", version)
|
||||||
if version not in (OTA_VERSION_1_0, OTA_VERSION_2_0):
|
supported_versions = (OTA_VERSION_1_0, OTA_VERSION_2_0)
|
||||||
raise OTAError(f"Unsupported OTA version {version}")
|
if version not in supported_versions:
|
||||||
|
raise OTAError(
|
||||||
|
f"Device uses unsupported OTA version {version}, this ESPHome supports {supported_versions}"
|
||||||
|
)
|
||||||
|
|
||||||
# Features
|
# Features
|
||||||
send_check(sock, FEATURE_SUPPORTS_COMPRESSION, "features")
|
send_check(sock, FEATURE_SUPPORTS_COMPRESSION, "features")
|
||||||
|
Loading…
Reference in New Issue
Block a user