mirror of
https://github.com/esphome/esphome.git
synced 2026-03-03 11:18:21 -07:00
[api] Warn when clients connect with outdated API version
Log a warning when a client connects with an API version older than 1.14. This alerts users that their client needs updating before the backward-compatibility code for pre-1.14 clients is removed in 2026.7.0.
This commit is contained in:
@@ -1534,6 +1534,13 @@ bool APIConnection::send_hello_response_(const HelloRequest &msg) {
|
||||
ESP_LOGV(TAG, "Hello from client: '%s' | %s | API Version %" PRIu16 ".%" PRIu16, this->helper_->get_client_name(),
|
||||
this->helper_->get_peername_to(peername), this->client_api_version_major_, this->client_api_version_minor_);
|
||||
|
||||
if (!this->client_supports_api_version(1, 14)) {
|
||||
ESP_LOGW(TAG,
|
||||
"Client '%s' is using API version %" PRIu16 ".%" PRIu16
|
||||
" which is outdated. Update the client to a version that supports API 1.14",
|
||||
this->helper_->get_client_name(), this->client_api_version_major_, this->client_api_version_minor_);
|
||||
}
|
||||
|
||||
HelloResponse resp;
|
||||
resp.api_version_major = 1;
|
||||
resp.api_version_minor = 14;
|
||||
|
||||
Reference in New Issue
Block a user