Skip to content

v1.3.5

Choose a tag to compare

@djdevil djdevil released this 05 Jul 18:52
08d72f5

AlertTicker Card — v1.3.5

🐛 Bug Fixes

Vertical layout renders at double height (#174)

With vertical: true, the card appeared at roughly twice its correct height — the alert content occupied the top half and an equal blank area appeared below it.

Root cause: The card_height centering fix in v1.3.4 (#145) made .atc-inner-clip a flex column container and gave .at-fold-wrapper flex: 1. Vertical mode independently sets height: 100% on .at-fold-wrapper. The two rules together — flex: 1 inside a flex container AND height: 100% on the same element — create a circular size dependency that browsers resolve by doubling the height.

Fix: .atc-inner-clip is reset to display: block inside .atc-vertical, exactly matching its pre-v1.3.4 behavior. The flex centering for card_height remains active for all non-vertical cases.

No configuration changes needed.


Card blank when casting to Google Home (#171)

When casting a Lovelace dashboard to a Google Home display, AlertTicker Card rendered as a completely blank card.

Root cause: The Google Cast runtime declares adoptedStyleSheets on ShadowRoot (so Lit's supportsAdoptingStyleSheets feature-detection check passes), but the setter throws "TypeError: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Failed to convert value to 'CSSStyleSheet'" at runtime. This is a Cast runtime bug — it advertises the API but can't handle Constructable StyleSheets objects. Because Lit relies on this path to inject the card's CSS, all styling is silently lost and the card renders blank.

Fix: At load time, ShadowRoot.prototype.adoptedStyleSheets setter is patched with a try-catch wrapper. When the native setter throws (Cast environment), the fallback iterates over each CSSStyleSheet, reads its rules via cssRules, and injects them as a <style> element inside the shadow root. Normal HA browsers take the fast path (native setter succeeds) with zero overhead.

No configuration changes needed.


state list not working in overlay / filter alerts (#176)

Using a list of states to match multiple values (e.g. show when a media player is playing or paused) was partially broken: it worked in the card's render path but not in the cross-view overlay watcher or filter-alert paths.

Root cause: The card render path uses _matchesState, which already handles arrays. The overlay watcher and filter paths use a separate _matchOp helper that did not — it would coerce the array to a string ("playing,paused") and never match.

Fix: _matchOp now short-circuits on array values with the same "is one of" logic used by _matchesState.

Correct config for multiple states:

alerts:
  - entity: media_player.living_room
    state:
      - "playing"
      - "paused"
    theme: info
    message: "Now playing: {state}"

No configuration changes needed if you were already using the array syntax — it now works consistently everywhere.


📦 Update Instructions

  1. Download alert-ticker-card.js and alert-ticker-card-editor.js
  2. Replace both files in your www/ folder (or the path you set in Resources)
  3. Hard-reload the browser: Ctrl+Shift+R / Cmd+Shift+R

HACS users: update from the HACS panel — no manual steps needed.


Full changelog: CHANGELOG.md


☕ If this card saves you time, consider buying me a coffee — it keeps the updates coming!

Buy Me A Coffee