1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43: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("_", "-")

View File

@@ -1 +1,10 @@
esphome:
name: test
areas:
- id: test_2258
name: "Area 1"
- id: d6ka
name: "Area 2"
esp32:
board: esp32dev

View File

@@ -1 +1,10 @@
esphome:
name: test
devices:
- id: duplicate_device
name: "Device 1"
- id: duplicate_device
name: "Device 2"
esp32:
board: esp32dev

View File

@@ -1 +1,12 @@
esphome:
name: test
areas:
- id: valid_area
name: "Valid Area"
devices:
- id: test_device
name: "Test Device"
area_id: nonexistent_area
esp32:
board: esp32dev