v2.4.2: Editor preset suffix fix
What's fixed
-
Editor:
handdsuffixes now work fortimer_presets(#102)In the visual editor, entering
5h, 15h, 30hfor Timer presets previously produced no visible change. The editor only recognized thessuffix;h,d, and evenmwere silently stripped byparseInt, leaving bare numbers interpreted as minutes. With5h, 15h, 30hthat 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
_formatPresetLabelstarted rendering h/d/m labels correctly, the editor's silent stripping became visible. minute_buttonsis intentionally unchanged. Its consumer only handless/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.