Update camera.markdown (#37147)

For actions Record and Snapshot, rename the user defined variable `entity_id` to a different name (suggested my_camera_id) to avoid the confusion between the data attribute `entity_id` and the user defined variable `entity_id`
This commit is contained in:
poulti 2025-01-28 09:10:20 +00:00 committed by GitHub
parent c9f8c204c2
commit 86b5b9079b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -104,12 +104,12 @@ For example, the following action in an automation would take a recording from "
```yaml
actions:
- variables:
entity_id: camera.yourcamera # Store the camera entity_id in a variable for reuse
my_camera_id: camera.yourcamera # Store the camera entity_id in a variable for reuse
- action: camera.record
target:
entity_id: '{{ entity_id }}'
entity_id: '{{ my_camera_id }}'
data:
filename: '/tmp/{{ entity_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'
filename: '/tmp/{{ my_camera_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'
```
{% endraw %}
@ -132,12 +132,12 @@ For example, the following action in an automation would take a snapshot from "y
```yaml
actions:
- variables:
entity_id: camera.yourcamera # Store the camera entity_id in a variable for reuse
my_camera_id: camera.yourcamera # Store the camera entity_id in a variable for reuse
- action: camera.snapshot
target:
entity_id: '{{ entity_id }}'
entity_id: '{{ my_camera_id }}'
data:
filename: '/tmp/{{ entity_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
filename: '/tmp/{{ my_camera_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
```
{% endraw %}