1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00
This commit is contained in:
J. Nick Koston
2025-06-22 21:32:20 +02:00
parent b725bb3dd1
commit ba87a0b63c
6 changed files with 32 additions and 4 deletions

View File

@@ -354,8 +354,7 @@ def sub_device_id(value: str | None) -> core.ID:
# Lazy import to avoid circular imports
from esphome.core.config import Device
validator = use_id(Device)
return validator(value)
return use_id(Device)(value)
def boolean(value):

View File

@@ -3,7 +3,7 @@ from __future__ import annotations
from esphome.helpers import slugify
def friendly_name_slugify(value):
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("_", "-")