mirror of
https://github.com/esphome/esphome.git
synced 2025-09-27 07:32:22 +01:00
Disallow _ in node name (#1632)
This commit is contained in:
@@ -196,11 +196,11 @@ def wizard(path):
|
||||
color(
|
||||
Fore.RED,
|
||||
f'Oh noes, "{name}" isn\'t a valid name. Names can only '
|
||||
f"include numbers, lower-case letters, underscores and "
|
||||
f"hyphens.",
|
||||
f"include numbers, lower-case letters and hyphens. ",
|
||||
)
|
||||
)
|
||||
name = strip_accents(name).lower().replace(" ", "_")
|
||||
name = strip_accents(name).lower().replace(" ", "-")
|
||||
name = strip_accents(name).lower().replace("_", "-")
|
||||
name = "".join(c for c in name if c in ALLOWED_NAME_CHARS)
|
||||
safe_print(
|
||||
'Shall I use "{}" as the name instead?'.format(color(Fore.CYAN, name))
|
||||
|
Reference in New Issue
Block a user