feat: Allow user generated notifications (#2401)
This commit is contained in:
@@ -341,6 +341,52 @@ action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: mute
|
||||
```
|
||||
|
||||
## `notification`
|
||||
|
||||
[](../../common/experimental-warning.md ':include')
|
||||
|
||||
Show a notification overlay on the card with optional controls.
|
||||
|
||||
```yaml
|
||||
action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: notification
|
||||
# [...]
|
||||
```
|
||||
|
||||
| Parameter | Description |
|
||||
| ----------------------------- | --------------------------------------------- |
|
||||
| `action` | Must be `custom:advanced-camera-card-action`. |
|
||||
| `advanced_camera_card_action` | Must be `notification`. |
|
||||
| `notification` | The notification to display. See below. |
|
||||
|
||||
### `notification`
|
||||
|
||||
| Parameter | Description |
|
||||
| ---------- | ------------------------------------------------------------------------------------- |
|
||||
| `heading` | An optional heading. Uses the same format as [`details`](README.md?id=details) below. |
|
||||
| `text` | An optional text string to display as the notification body. |
|
||||
| `details` | An optional list of metadata. See [`details`](README.md?id=details) below. |
|
||||
| `controls` | An optional list of controls. See [`controls`](README.md?id=controls) below. |
|
||||
|
||||
### Details
|
||||
|
||||
| Parameter | Description |
|
||||
| ---------- | ------------------------------------------------------------- |
|
||||
| `text` | The detail text. |
|
||||
| `icon` | An optional icon (e.g. `mdi:alert`). |
|
||||
| `tooltip` | An optional tooltip string (shown on hover). |
|
||||
| `severity` | An optional severity level, one of `low`, `medium` or `high`. |
|
||||
|
||||
### Controls
|
||||
|
||||
| Parameter | Default | Description |
|
||||
| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `icon` | | An optional icon (e.g. `mdi:check-circle`). |
|
||||
| `tooltip` | | An optional tooltip string (shown on hover). |
|
||||
| `severity` | | An optional severity level, one of `low`, `medium` or `high`. |
|
||||
| `actions` | | [Actions](../README.md) to execute on interaction. Supports `tap_action`, `hold_action`, `double_tap_action`, `start_tap_action`, `end_tap_action`. See [example](../../../examples.md?id=notifications). |
|
||||
| `dismiss` | `true` | Whether to dismiss the notification after the control's actions execute. |
|
||||
|
||||
## `pause`
|
||||
|
||||
Pause the selected media.
|
||||
@@ -740,6 +786,29 @@ elements:
|
||||
tap_action:
|
||||
action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: info
|
||||
- type: custom:advanced-camera-card-menu-icon
|
||||
icon: mdi:alpha-m-circle-outline
|
||||
title: Show notification
|
||||
tap_action:
|
||||
action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: notification
|
||||
notification:
|
||||
heading:
|
||||
text: Attention
|
||||
icon: mdi:alert
|
||||
severity: high
|
||||
text: Something important happened.
|
||||
controls:
|
||||
- icon: mdi:filmstrip
|
||||
tooltip: View clips (tap) / View clip (double-tap)
|
||||
actions:
|
||||
tap_action:
|
||||
action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: clips
|
||||
double_tap_action:
|
||||
action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: clip
|
||||
dismiss: false
|
||||
- type: custom:advanced-camera-card-menu-icon
|
||||
icon: mdi:alpha-n-circle
|
||||
title: Turn off substream
|
||||
|
||||
@@ -154,6 +154,7 @@ elements:
|
||||
| `expand` | `false` | If `false` this status bar item will consume the minimum possible space, if `true` will expand to the available space. |
|
||||
| `icon` | | The icon to show in the status bar, e.g. `mdi:camera-front`. See also [custom icons](../../../usage/custom-icons.md). |
|
||||
| `priority` | `50` | The item priority. Higher priority items are ordered closer to the start of the status bar (i.e. an item with priority `70` will order further to the left than an item with priority `60`). Minimum `0`, maximum `100`. |
|
||||
| `severity` | | An optional severity level, one of `low`, `medium` or `high`. Colors the item accordingly. |
|
||||
| `sufficient` | `false` | Whether or not this item is sufficient to display the status bar if it's otherwise hidden (e.g. with the `popup` [status bar style](../../status-bar.md)). |
|
||||
|
||||
## `status-bar-image`
|
||||
@@ -175,6 +176,7 @@ elements:
|
||||
| `expand` | `false` | If `false` this status bar item will consume the minimum possible space, if `true` will expand to the available space. |
|
||||
| `image` | | The image to show in the status bar, e.g. `https://my.site.com/status.png`. |
|
||||
| `priority` | `50` | The item priority. Higher priority items are ordered closer to the start of the status bar (i.e. an item with priority `70` will order further to the left than an item with priority `60`). Minimum `0`, maximum `100`. |
|
||||
| `severity` | | An optional severity level, one of `low`, `medium` or `high`. Colors the item accordingly. |
|
||||
| `sufficient` | `false` | Whether or not this item is sufficient to display the status bar if it's otherwise hidden (e.g. with the `popup` [status bar style](../../status-bar.md)). |
|
||||
|
||||
## `status-bar-string`
|
||||
@@ -196,6 +198,7 @@ elements:
|
||||
| `expand` | `false` | If `false` this status bar item will consume the minimum possible space, if `true` will expand to the available space. |
|
||||
| `string` | | The string to show in the status bar, e.g. `Intruder detected!` |
|
||||
| `priority` | `50` | The item priority. Higher priority items are ordered closer to the start of the status bar (i.e. an item with priority `70` will order further to the left than an item with priority `60`). Minimum `0`, maximum `100`. |
|
||||
| `severity` | | An optional severity level, one of `low`, `medium` or `high`. Colors the item accordingly. |
|
||||
| `sufficient` | `false` | Whether or not this item is sufficient to display the status bar if it's otherwise hidden (e.g. with the `popup` [status bar style](../../status-bar.md)). |
|
||||
|
||||
## Fully expanded reference
|
||||
@@ -331,6 +334,7 @@ elements:
|
||||
expand: false
|
||||
string: 'Intruder alert!'
|
||||
priority: 50
|
||||
severity: high
|
||||
sufficient: false
|
||||
- type: custom:advanced-camera-card-status-bar-icon
|
||||
enabled: true
|
||||
@@ -338,6 +342,7 @@ elements:
|
||||
expand: false
|
||||
icon: 'mdi:cow'
|
||||
priority: 50
|
||||
severity: medium
|
||||
sufficient: false
|
||||
- type: custom:advanced-camera-card-status-bar-image
|
||||
enabled: true
|
||||
@@ -345,5 +350,6 @@ elements:
|
||||
expand: false
|
||||
image: https://my.site.com/status.png
|
||||
priority: 50
|
||||
severity: low
|
||||
sufficient: false
|
||||
```
|
||||
|
||||
@@ -35,6 +35,7 @@ status_bar:
|
||||
| `severity` | The media severity indicator (if any) for review severity (e.g. Frigate alerts/detections). |
|
||||
| `technology` | The detected media technology (if any). |
|
||||
| `title` | The media title. |
|
||||
| `upgrade` | An indicator that appears when a configuration upgrade is available. |
|
||||
|
||||
### Options for each item
|
||||
|
||||
@@ -85,4 +86,7 @@ status_bar:
|
||||
title:
|
||||
enabled: true
|
||||
priority: 50
|
||||
upgrade:
|
||||
enabled: true
|
||||
priority: 50
|
||||
```
|
||||
|
||||
@@ -729,6 +729,42 @@ cameras:
|
||||
id: office-webrtc
|
||||
```
|
||||
|
||||
## Notifications
|
||||
|
||||
Show a notification with controls that respond to different interactions. In
|
||||
this example, tapping the control navigates to the `clips` (media gallery) view
|
||||
and double-tapping navigates to the `clip` (media player) view.
|
||||
|
||||
```yaml
|
||||
type: custom:advanced-camera-card
|
||||
cameras:
|
||||
- camera_entity: camera.office
|
||||
elements:
|
||||
- type: custom:advanced-camera-card-menu-icon
|
||||
icon: mdi:bell
|
||||
title: Show notification
|
||||
tap_action:
|
||||
action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: notification
|
||||
notification:
|
||||
heading:
|
||||
text: Motion detected
|
||||
icon: mdi:motion-sensor
|
||||
severity: medium
|
||||
text: Motion was detected in the office.
|
||||
controls:
|
||||
- icon: mdi:filmstrip
|
||||
tooltip: View clips (tap) / clip (double-tap)
|
||||
actions:
|
||||
tap_action:
|
||||
action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: clips
|
||||
double_tap_action:
|
||||
action: custom:advanced-camera-card-action
|
||||
advanced_camera_card_action: clip
|
||||
dismiss: false
|
||||
```
|
||||
|
||||
## Overriding configuration
|
||||
|
||||
You can override card configuration when certain [conditions](configuration/conditions.md) are met.
|
||||
|
||||
Reference in New Issue
Block a user