1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 15:12:21 +01:00

[api] Allow noise encryption key to be set at runtime (#7296)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Keith Burzinski
2025-04-16 20:15:25 -05:00
committed by GitHub
parent ca4838a5f4
commit 2fd5f9ac58
14 changed files with 373 additions and 78 deletions

View File

@@ -138,7 +138,11 @@ void MQTTClientComponent::send_device_info_() {
#endif
#ifdef USE_API_NOISE
root["api_encryption"] = "Noise_NNpsk0_25519_ChaChaPoly_SHA256";
if (api::global_api_server->get_noise_ctx()->has_psk()) {
root["api_encryption"] = "Noise_NNpsk0_25519_ChaChaPoly_SHA256";
} else {
root["api_encryption_supported"] = "Noise_NNpsk0_25519_ChaChaPoly_SHA256";
}
#endif
},
2, this->discovery_info_.retain);