refactor: Unify substream actions into substream_{on,off} (#2497)
## Summary
- Collapse `live_substream_{on,off,select}` into a unified
`substream_{on,off}` pair, symmetric with `call_{start,end}`.
- Rename the `camera` field on the former `live_substream_select` to
`stream` (it always was a stream ID).
- Add optional `camera` field to both new actions for targeting a
non-selected base camera.
- YAML configs are migrated automatically; URL bookmarks must be updated
by hand.
## Migration
### Cycling between camera and substream (toggle button)
Before:
```yaml
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: live_substream_on
```
After:
```yaml
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: substream_on
```
### Selecting a specific substream
Before:
```yaml
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: live_substream_select
camera: camera.front_door_hd
```
After:
```yaml
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: substream_on
stream: camera.front_door_hd
```
### Turning the substream off
Before:
```yaml
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: live_substream_off
```
After:
```yaml
tap_action:
action: custom:advanced-camera-card-action
advanced_camera_card_action: substream_off
```
### URL querystrings (manual update required)
| Before | After |
| --- | --- |
|
`?advanced-camera-card-action.live_substream_select=camera.front_door_hd`
| `?advanced-camera-card-action.substream_on=camera.front_door_hd` |
This commit is contained in:
committed by
dermotduffy
parent
15e335a647
commit
f18e4cd4b8
@@ -278,7 +278,7 @@ describe('MenuButtonController', () => {
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'live_substream_on',
|
||||
advanced_camera_card_action: 'substream_on',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -322,7 +322,7 @@ describe('MenuButtonController', () => {
|
||||
type: 'custom:advanced-camera-card-menu-icon',
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'live_substream_off',
|
||||
advanced_camera_card_action: 'substream_off',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -394,8 +394,8 @@ describe('MenuButtonController', () => {
|
||||
selected: true,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-1',
|
||||
advanced_camera_card_action: 'substream_on',
|
||||
stream: 'camera-1',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -407,8 +407,8 @@ describe('MenuButtonController', () => {
|
||||
selected: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-2',
|
||||
advanced_camera_card_action: 'substream_on',
|
||||
stream: 'camera-2',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -420,8 +420,8 @@ describe('MenuButtonController', () => {
|
||||
selected: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-3',
|
||||
advanced_camera_card_action: 'substream_on',
|
||||
stream: 'camera-3',
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -489,8 +489,8 @@ describe('MenuButtonController', () => {
|
||||
selected: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-1',
|
||||
advanced_camera_card_action: 'substream_on',
|
||||
stream: 'camera-1',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -504,8 +504,8 @@ describe('MenuButtonController', () => {
|
||||
selected: true,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-2',
|
||||
advanced_camera_card_action: 'substream_on',
|
||||
stream: 'camera-2',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -517,8 +517,8 @@ describe('MenuButtonController', () => {
|
||||
selected: false,
|
||||
tap_action: {
|
||||
action: 'fire-dom-event',
|
||||
advanced_camera_card_action: 'live_substream_select',
|
||||
camera: 'camera-3',
|
||||
advanced_camera_card_action: 'substream_on',
|
||||
stream: 'camera-3',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user