Skip to content

v2.4.2: Editor preset suffix fix

Choose a tag to compare

@eyalgal eyalgal released this 21 May 22:54
e00a7c2

What's fixed

  • Editor: h and d suffixes now work for timer_presets (#102)

    In the visual editor, entering 5h, 15h, 30h for Timer presets previously produced no visible change. The editor only recognized the s suffix; h, d, and even m were silently stripped by parseInt, leaving bare numbers interpreted as minutes. With 5h, 15h, 30h that resolved to [5, 15, 30], which equaled the default and looked like nothing had changed.

    The editor now mirrors the same regex used everywhere else in the card (^(\d+)\s*([smhd])?$). Bare numbers stay numeric in YAML; suffixed entries are preserved as strings (e.g. 2h, 30s, 1d). The helper hint under the field has been updated to advertise the supported units.

Notes

  • This bug was always present in the editor, but v2.4.0/v2.4.1 made it observable: once _formatPresetLabel started rendering h/d/m labels correctly, the editor's silent stripping became visible.
  • minute_buttons is intentionally unchanged. Its consumer only handles s/bare-numbers today.

Install

[HACS] update to v2.4.2, or replace simple-timer-card.js in your www/community/simple-timer-card/ folder with the attached bundle and hard-refresh.