mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Add mixin classes for required keys in EntityDescription (#53610)
This commit is contained in:
@@ -79,9 +79,9 @@ def sanitize_path(path: str) -> str:
|
||||
return path
|
||||
|
||||
|
||||
def slugify(text: str, *, separator: str = "_") -> str:
|
||||
def slugify(text: str | None, *, separator: str = "_") -> str:
|
||||
"""Slugify a given text."""
|
||||
if text == "":
|
||||
if text == "" or text is None:
|
||||
return ""
|
||||
slug = unicode_slug.slugify(text, separator=separator)
|
||||
return "unknown" if slug == "" else slug
|
||||
|
||||
Reference in New Issue
Block a user