Add example to documentation.
This commit is contained in:
@@ -132,9 +132,13 @@ frigate_card_action: change_zoom
|
|||||||
| - | - |
|
| - | - |
|
||||||
| `action` | Must be `custom:frigate-card-action`. |
|
| `action` | Must be `custom:frigate-card-action`. |
|
||||||
| `frigate_card_action` | Must be `change_zoom`. |
|
| `frigate_card_action` | Must be `change_zoom`. |
|
||||||
| `target_id` | The [camera ID](cameras/README.md?id=cameras) to adjust the pan/zoom of, or a media ID (e.g. `frigate` event ID) to zoom in on specific media items. |
|
| `target_id` | The [camera ID](cameras/README.md?id=cameras) or a media ID (e.g. `frigate` event ID) to change zoom/pam settings for. |
|
||||||
| `zoom` | How much to zoom-in. See the [camera zoom parameter](cameras/README.md?id=layout-configuration). |
|
| `zoom` | Optional parameter that controls how much to zoom-in. See the [camera zoom parameter](cameras/README.md?id=layout-configuration). |
|
||||||
| `pan` | How much to pan-x/y. See the [camera pan parameter](cameras/README.md?id=layout-configuration). |
|
| `pan` | Optional parameter that controls how much to pan-x/y. See the [camera pan parameter](cameras/README.md?id=layout-configuration). |
|
||||||
|
|
||||||
|
?> If neither `zoom` nor `pan` are specified the camera will return to its default zoom and pan settings.
|
||||||
|
|
||||||
|
See [example of automatically zoom/panning based on state](../examples.md?id=automatically-zoom-based-on-state).
|
||||||
|
|
||||||
### `clip`, `clips`, `image`, `live`, `recording`, `recordings`, `snapshot`, `snapshots`
|
### `clip`, `clips`, `image`, `live`, `recording`, `recordings`, `snapshot`, `snapshots`
|
||||||
|
|
||||||
@@ -536,4 +540,14 @@ elements:
|
|||||||
frigate_card_action: ptz
|
frigate_card_action: ptz
|
||||||
ptz_action: preset
|
ptz_action: preset
|
||||||
ptz_preset: doorway
|
ptz_preset: doorway
|
||||||
|
- type: custom:frigate-card-menu-icon
|
||||||
|
icon: mdi:alpha-r-circle
|
||||||
|
title: Change Zoom
|
||||||
|
tap_action:
|
||||||
|
action: custom:frigate-card-action
|
||||||
|
frigate_card_action: change_zoom
|
||||||
|
pan:
|
||||||
|
x: 50
|
||||||
|
y: 50
|
||||||
|
zoom: 1
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1057,3 +1057,35 @@ overrides:
|
|||||||
x: 100
|
x: 100
|
||||||
y: 100
|
y: 100
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Automatically zoom based on state
|
||||||
|
|
||||||
|
This example automatically zooms in and out based on the state of an entity:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
type: custom:frigate-card
|
||||||
|
cameras:
|
||||||
|
- camera_entity: camera.living_room
|
||||||
|
live_provider: go2rtc
|
||||||
|
debug:
|
||||||
|
logging: true
|
||||||
|
automations:
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity: binary_sensor.door_contact
|
||||||
|
state: 'on'
|
||||||
|
actions:
|
||||||
|
- action: custom:frigate-card-action
|
||||||
|
frigate_card_action: change_zoom
|
||||||
|
target_id: camera.living_room
|
||||||
|
zoom: 4
|
||||||
|
pan:
|
||||||
|
x: 38
|
||||||
|
y: 20
|
||||||
|
actions_not:
|
||||||
|
- action: custom:frigate-card-action
|
||||||
|
frigate_card_action: change_zoom
|
||||||
|
target_id: camera.living_room
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.3 MiB |
@@ -190,6 +190,7 @@ export class ConditionsManager {
|
|||||||
const config = this._api.getConfigManager().getConfig();
|
const config = this._api.getConfigManager().getConfig();
|
||||||
const conditions: FrigateCardCondition[] = [];
|
const conditions: FrigateCardCondition[] = [];
|
||||||
config?.overrides?.forEach((override) => conditions.push(...override.conditions));
|
config?.overrides?.forEach((override) => conditions.push(...override.conditions));
|
||||||
|
config?.automations?.forEach((automation) => conditions.push(...automation.conditions));
|
||||||
|
|
||||||
// Element conditions can be arbitrarily nested underneath conditionals and
|
// Element conditions can be arbitrarily nested underneath conditionals and
|
||||||
// custom elements that this card may not known. Here we recursively parse
|
// custom elements that this card may not known. Here we recursively parse
|
||||||
|
|||||||
Reference in New Issue
Block a user