mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +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 |     # Lazy import to avoid circular imports | ||||||
|     from esphome.core.config import Device |     from esphome.core.config import Device | ||||||
|  |  | ||||||
|     validator = use_id(Device) |     return use_id(Device)(value) | ||||||
|     return validator(value) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| def boolean(value): | def boolean(value): | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ from __future__ import annotations | |||||||
| from esphome.helpers import slugify | 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.""" |     """Convert a friendly name to a slug with dashes instead of underscores.""" | ||||||
|     # First use the standard slugify, then convert underscores to dashes |     # First use the standard slugify, then convert underscores to dashes | ||||||
|     return slugify(value).replace("_", "-") |     return slugify(value).replace("_", "-") | ||||||
|   | |||||||
| @@ -1 +1,10 @@ | |||||||
|  | esphome: | ||||||
|  |   name: test | ||||||
|  |   areas: | ||||||
|  |     - id: test_2258 | ||||||
|  |       name: "Area 1" | ||||||
|  |     - id: d6ka | ||||||
|  |       name: "Area 2" | ||||||
|  |  | ||||||
|  | esp32: | ||||||
|  |   board: esp32dev | ||||||
|   | |||||||
| @@ -1 +1,10 @@ | |||||||
|  | esphome: | ||||||
|  |   name: test | ||||||
|  |   devices: | ||||||
|  |     - id: duplicate_device | ||||||
|  |       name: "Device 1" | ||||||
|  |     - id: duplicate_device | ||||||
|  |       name: "Device 2" | ||||||
|  |  | ||||||
|  | esp32: | ||||||
|  |   board: esp32dev | ||||||
|   | |||||||
| @@ -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 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user