Skip to content

Commit bd9e3d2

Browse files
committed
Update to const
1 parent 64008dd commit bd9e3d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/components/api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ on_...:
214214
Requires `capture_response: true`.
215215

216216
- **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`.
218218
See [Action Response Handling](#action-response-handling).
219219

220220
- **on_error** (*Optional*, [Automation](#automation)): Optional automation to execute when the Home Assistant action
@@ -280,7 +280,7 @@ on_...:
280280
##### Capturing Response Data
281281

282282
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`.
284284

285285
```yaml
286286
# Example: Get weather forecast and parse JSON response
@@ -293,7 +293,7 @@ on_...:
293293
capture_response: true
294294
on_success:
295295
- lambda: |-
296-
JsonObject next_hour = response["response"]["weather.forecast_home"]["forecast"][0];
296+
JsonObjectConst next_hour = response["response"]["weather.forecast_home"]["forecast"][0];
297297
float next_temperature = next_hour["temperature"].as<float>();
298298
ESP_LOGI("weather", "Temperature next hour: %.1f", next_temperature);
299299
```

0 commit comments

Comments
 (0)