Skip to content

fix: card_mod compatibility and localize empty state message#27

Merged
weedpump merged 1 commit intoweedpump:developfrom
kvanzuijlen:fix/card-mod-compatibility
Jan 16, 2026
Merged

fix: card_mod compatibility and localize empty state message#27
weedpump merged 1 commit intoweedpump:developfrom
kvanzuijlen:fix/card-mod-compatibility

Conversation

@kvanzuijlen
Copy link
Copy Markdown

@kvanzuijlen kvanzuijlen commented Jan 9, 2026

  • Reuse existing ha-card element during render to preserve card_mod styles
  • Ensure ha-card is created in connectedCallback for early style attachment
  • Add no_events translation key to all supported locales
  • Replace hardcoded "Keine Ereignisse..." string with localized value, closes Language setting not used for 'no events' message #24

Tested the changes locally by running npm run build, copying the resulting JavaScript, and loading the newly built JavaScript instead of the HACS version. After that, I was able to apply a custom card_mod style to the card and make it work on page load (before it only worked after editing the card).

image

I created some test messages and applied the following card_mod style:

card_mod:
  style: |
    .primary-text.state {
      text-overflow: unset !important;
      overflow: auto !important;
      white-space: normal !important;
      color: red;
    }

Localized no events message:
image

- Reuse existing `ha-card` element during render to preserve card_mod styles
- Ensure `ha-card` is created in `connectedCallback` for early style attachment
- Add `no_events` translation key to all supported locales
- Replace hardcoded "Keine Ereignisse..." string with localized value, closes weedpump#24
@weedpump weedpump self-assigned this Jan 9, 2026
@weedpump weedpump added bug Something isn't working enhancement New feature or request labels Jan 9, 2026
@weedpump weedpump changed the base branch from main to develop January 16, 2026 13:25
@weedpump weedpump merged commit af12888 into weedpump:develop Jan 16, 2026
@kvanzuijlen kvanzuijlen deleted the fix/card-mod-compatibility branch January 16, 2026 14:08
weedpump added a commit that referenced this pull request Jan 16, 2026
commit 663712a
Author: Tobias Kneidl <[email protected]>
Date:   Fri Jan 16 16:19:29 2026 +0100

    changelog for v1.6.0

commit 8da69e3
Author: Tobias Kneidl <[email protected]>
Date:   Fri Jan 16 16:07:59 2026 +0100

    new option: use entity picture instead of icon if available
    closes #25

commit 663a42e
Author: Tobias Kneidl <[email protected]>
Date:   Fri Jan 16 15:57:26 2026 +0100

    added color-utils.js

commit d580f8e
Author: Tobias Kneidl <[email protected]>
Date:   Fri Jan 16 15:37:29 2026 +0100

    options to change colors of timeline & dots

commit 88fe3ee
Author: Tobias Kneidl <[email protected]>
Date:   Fri Jan 16 15:27:23 2026 +0100

    add transparency slider to color pickers

commit 569a787
Author: Tobias Kneidl <[email protected]>
Date:   Fri Jan 16 15:00:46 2026 +0100

    default entities & background

commit cd7375d
Author: Tobias Kneidl <[email protected]>
Date:   Fri Jan 16 14:43:26 2026 +0100

    swedish translation

commit af12888
Merge: 31b774d c5a2656
Author: Tobi <[email protected]>
Date:   Fri Jan 16 14:25:52 2026 +0100

    Merge pull request #27 from kvanzuijlen/fix/card-mod-compatibility

    fix: card_mod compatibility and localize empty state message

commit 31b774d
Merge: bc791e3 e5f80ff
Author: Tobi <[email protected]>
Date:   Fri Jan 16 14:25:26 2026 +0100

    Merge pull request #26 from naitkris/patch-1

    Create sv.json (Swedish translation)

commit c5a2656
Author: kvanzuijlen <[email protected]>
Date:   Fri Jan 9 23:54:59 2026 +0100

    Fix card_mod compatibility and localize empty state message

    - Reuse existing `ha-card` element during render to preserve card_mod styles
    - Ensure `ha-card` is created in `connectedCallback` for early style attachment
    - Add `no_events` translation key to all supported locales
    - Replace hardcoded "Keine Ereignisse..." string with localized value, closes #24

commit e5f80ff
Author: Kristian Johansson <[email protected]>
Date:   Fri Jan 9 07:56:07 2026 +0400

    Create sv.json (Swedish translation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language setting not used for 'no events' message

2 participants