@@ -214,7 +214,7 @@ on_...:
214
214
Requires `capture_response : true`.
215
215
216
216
- **on_success** (*Optional*, [Automation](#automation)): Optional automation to execute when the Home Assistant action
217
- call succeeds. When `capture_response : true`, the response data is available as a `response` variable of type `JsonObject `.
217
+ call succeeds. When `capture_response : true`, the response data is available as a `response` variable of type `JsonObjectConst `.
218
218
See [Action Response Handling](#action-response-handling).
219
219
220
220
- **on_error** (*Optional*, [Automation](#automation)): Optional automation to execute when the Home Assistant action
@@ -280,7 +280,7 @@ on_...:
280
280
# #### Capturing Response Data
281
281
282
282
To capture and process response data from actions, set `capture_response : true`. When enabled, `on_success` must be configured
283
- and the response data is available as a [`JsonObject `](https://arduinojson.org/v7/api/jsonobject /) variable named `response`.
283
+ and the response data is available as a [`JsonObjectConst `](https://arduinojson.org/v7/api/jsonobjectconst /) variable named `response`.
284
284
285
285
` ` ` yaml
286
286
# Example: Get weather forecast and parse JSON response
@@ -293,7 +293,7 @@ on_...:
293
293
capture_response: true
294
294
on_success:
295
295
- lambda: |-
296
- JsonObject next_hour = response["response"]["weather.forecast_home"]["forecast"][0];
296
+ JsonObjectConst next_hour = response["response"]["weather.forecast_home"]["forecast"][0];
297
297
float next_temperature = next_hour["temperature"].as<float>();
298
298
ESP_LOGI("weather", "Temperature next hour: %.1f", next_temperature);
299
299
` ` `
0 commit comments