mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 06:33:51 +00:00
cleanups
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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("_", "-")
|
||||
|
||||
Reference in New Issue
Block a user