diff --git a/tests/components/api/common.yaml b/tests/components/api/common.yaml index d3c549fff0..d87ae56ec2 100644 --- a/tests/components/api/common.yaml +++ b/tests/components/api/common.yaml @@ -18,7 +18,7 @@ esphome: capture_response: true on_success: - lambda: |- - JsonObject next_hour = response["response"]["weather.forecast_home"]["forecast"][0]; + JsonObjectConst next_hour = response["response"]["weather.forecast_home"]["forecast"][0]; float next_temperature = next_hour["temperature"].as(); ESP_LOGD("main", "Next hour temperature: %f", next_temperature); on_error: