Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick+github@koston.org>
10 lines
317 B
Python
10 lines
317 B
Python
from __future__ import annotations
|
|
|
|
from esphome.helpers import slugify
|
|
|
|
|
|
def friendly_name_slugify(value: str) -> str:
|
|
"""Convert a friendly name to a slug with dashes instead of underscores."""
|
|
# First use the standard slugify, then convert underscores to dashes
|
|
return slugify(value).replace("_", "-")
|