chore: Enforce a few house rules via eslint (#2539)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent 5572ec728e
commit 921d45e577
100 changed files with 479 additions and 295 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ Turns the card into a phone-style ringer that answers a [two-way audio
call](../usage/2-way-audio.md) when somebody presses a doorbell. Intended for a
wall-mounted tablet sitting on a dashboard with a doorbell camera.
Minimal configuration — just point it at a doorbell-capable camera:
Minimal configuration -- just point it at a doorbell-capable camera:
```yaml
type: custom:advanced-camera-card
+8 -8
View File
@@ -29,14 +29,14 @@ status_bar:
### Available Items
| Button name | Description |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `engine` | The icon of the camera engine for the relevant camera. |
| `issues` | Indicator icons that appear while any card issue is active — e.g. configuration error, configuration upgrade available, Home Assistant connection lost, camera initialization failed, legacy `frigate-hass-card` resource detected, media (live/recorded/image) not loading, media query failed, or view cannot be resolved. See the warning below about disabling this item. |
| `resolution` | The detected media resolution (if any). |
| `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. |
| Button name | Description |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `engine` | The icon of the camera engine for the relevant camera. |
| `issues` | Indicator icons that appear while any card issue is active -- e.g. configuration error, configuration upgrade available, Home Assistant connection lost, camera initialization failed, legacy `frigate-hass-card` resource detected, media (live/recorded/image) not loading, media query failed, or view cannot be resolved. See the warning below about disabling this item. |
| `resolution` | The detected media resolution (if any). |
| `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. |
### Options for each item
+5 -5
View File
@@ -91,7 +91,7 @@ automations:
### Fullscreen with display mode and substream switching
This example adds a custom menu button that switches to single display mode,
activates the HD substream, and enters card fullscreen — all in a single tap.
activates the HD substream, and enters card fullscreen -- all in a single tap.
An automation restores the grid layout and substream when fullscreen is exited.
This is useful in [grid](configuration/live.md) layouts where the card's
standard fullscreen button would show all cameras rather than a single HD
@@ -376,9 +376,9 @@ elements:
The [`doorbell` profile](configuration/profiles.md?id=doorbell) turns a dashboard into a phone-like ringer when somebody presses the doorbell, by setting [`view.triggers.actions.trigger: call`](configuration/view.md?id=triggers) and auto-discovering [HA `event.*` entities](https://www.home-assistant.io/integrations/event/#device-class) with `device_class: doorbell` on the camera's device (Ring, UniFi Protect, Nest, DoorBird, Reolink, etc.). The intended deployment is a wall-mounted tablet sitting on the dashboard.
A doorbell press is instantaneous, so the card synthesises a ring window from [`view.triggers.event_hold_seconds`](configuration/view.md?id=triggers) (default `30`s) — long enough for a typical phone-style answer window. `untrigger_delay_seconds` then lingers past that, same as for any stateful trigger.
A doorbell press is instantaneous, so the card synthesises a ring window from [`view.triggers.event_hold_seconds`](configuration/view.md?id=triggers) (default `30`s) -- long enough for a typical phone-style answer window. `untrigger_delay_seconds` then lingers past that, same as for any stateful trigger.
`triggers.motion`, `triggers.occupancy`, and `triggers.media_events` are off by default — only the explicit doorbell press triggers the call, so casual motion won't make the card ring.
`triggers.motion`, `triggers.occupancy`, and `triggers.media_events` are off by default -- only the explicit doorbell press triggers the call, so casual motion won't make the card ring.
```yaml
type: custom:advanced-camera-card
@@ -398,9 +398,9 @@ profiles:
#### With a Zigbee (ZHA / deCONZ) doorbell button
Zigbee buttons connected via ZHA or deCONZ typically don't expose a per-device entity — they fire raw HA bus events (`zha_event`, `deconz_event`) shared across every Zigbee device on the integration. The `doorbell` profile's auto-discovery doesn't cover this case; reuse the profile (it still wires up `trigger: call` / `untrigger: call` and the ring window) but opt out of auto-discovery per camera and add [`triggers.events`](configuration/cameras/README.md?id=events) with an `event_data` filter to pick out the right device.
Zigbee buttons connected via ZHA or deCONZ typically don't expose a per-device entity -- they fire raw HA bus events (`zha_event`, `deconz_event`) shared across every Zigbee device on the integration. The `doorbell` profile's auto-discovery doesn't cover this case; reuse the profile (it still wires up `trigger: call` / `untrigger: call` and the ring window) but opt out of auto-discovery per camera and add [`triggers.events`](configuration/cameras/README.md?id=events) with an `event_data` filter to pick out the right device.
You can copy the exact `device_ieee` (ZHA) or `id` (deCONZ) and command values straight out of **Developer tools → Events** in Home Assistant — listen to the event type, press the doorbell, and use whatever appears in the `data` payload.
You can copy the exact `device_ieee` (ZHA) or `id` (deCONZ) and command values straight out of **Developer tools → Events** in Home Assistant -- listen to the event type, press the doorbell, and use whatever appears in the `data` payload.
```yaml
type: custom:advanced-camera-card
+3 -3
View File
@@ -233,7 +233,7 @@ between clicking the download button and the download starting.
- If you are using a custom `client_id` setting in your `frigate.yml` file (the
configuration file for the Frigate backend itself), the card will auto-detect
it from the camera entity. If auto-detection fails (e.g. no `camera_entity`
is configured), set it manually — see [Frigate engine
is configured), set it manually -- see [Frigate engine
configuration](configuration/cameras/engine.md?id=frigate).
- You must have the `Enable the media browser` option enabled for the Frigate
integration, in order for media fetches to work for the card. Media fetches
@@ -305,7 +305,7 @@ Picture-in-Picture (PIP) uses the browser's [native video PIP
API](https://caniuse.com/picture-in-picture) which floats the raw video element
into a small window. This means:
- **No card UI in the PIP window.** Only the video itself is shown — no menu,
- **No card UI in the PIP window.** Only the video itself is shown -- no menu,
status bar, timeline, or other card elements. The card remains fully
functional on the dashboard behind it.
- **Limited browser support.** Not all browsers support the PIP API. See
@@ -320,7 +320,7 @@ was explored using the experimental [Document Picture-in-Picture
API](https://caniuse.com/mdn-api_documentpictureinpicture), however it proved
unworkable: Home Assistant state updates cannot reach a card in a separate
document, and browser-managed styles (`adoptedStyleSheets`) are cleared when
elements move between documents — resulting in an unstyled, non-updating card.
elements move between documents -- resulting in an unstyled, non-updating card.
### New version not working in Chrome
+3 -3
View File
@@ -25,7 +25,7 @@ opt <color:#43a047>**""live.microphone.always_connected""**</color> not enabled
end
note over User, Mic
The microphone must connect for the call to proceed —
The microphone must connect for the call to proceed --
if access is denied or unsupported, the call does not start
end note
@@ -46,8 +46,8 @@ end
User -> Card : End the call
note over User, Card
Via Hang-up button, <color:#43a047>**""call_end""**</color> action, or — when
<color:#43a047>**""live.controls.call.lock""**</color> is disabled — navigating away
Via Hang-up button, <color:#43a047>**""call_end""**</color> action, or -- when
<color:#43a047>**""live.controls.call.lock""**</color> is disabled -- navigating away
end note
Card --> User : Inbound audio mutes (<color:#43a047>**""live.auto_mute""**</color>)