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:
@@ -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)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user