mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Pr/11430 (#11587)
* Fix error when name is non-latin script When the name is non-latin script (e.g. Japanese), slugify returns empty string and causes failure in a later stage. This commit fixes the issue by using default name. * Add test
This commit is contained in:
@@ -35,10 +35,10 @@ def generate_entity_id(entity_id_format: str, name: Optional[str],
|
||||
current_ids, hass
|
||||
).result()
|
||||
|
||||
name = (name or DEVICE_DEFAULT_NAME).lower()
|
||||
name = (slugify(name) or slugify(DEVICE_DEFAULT_NAME)).lower()
|
||||
|
||||
return ensure_unique_string(
|
||||
entity_id_format.format(slugify(name)), current_ids)
|
||||
entity_id_format.format(name), current_ids)
|
||||
|
||||
|
||||
@callback
|
||||
|
||||
Reference in New Issue
Block a user