1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-05 21:02:20 +01:00

[entity] Allow `device_id` to be blank on entities (#10217)

This commit is contained in:
Jesse Hills
2025-08-14 09:42:11 +12:00
committed by GitHub
parent fff66072d4
commit 6a8722f33e
5 changed files with 63 additions and 5 deletions

View File

@@ -393,10 +393,13 @@ def icon(value):
)
def sub_device_id(value: str | None) -> core.ID:
def sub_device_id(value: str | None) -> core.ID | None:
# Lazy import to avoid circular imports
from esphome.core.config import Device
if not value:
return None
return use_id(Device)(value)