mirror of
https://github.com/esphome/esphome.git
synced 2025-09-21 12:42:21 +01:00
make areas and devices consistant
This commit is contained in:
@@ -350,9 +350,9 @@ def icon(value):
|
|||||||
|
|
||||||
def sub_device_id(value):
|
def sub_device_id(value):
|
||||||
# Lazy import to avoid circular imports
|
# Lazy import to avoid circular imports
|
||||||
from esphome.core.config import SubDevice
|
from esphome.core.config import Device
|
||||||
|
|
||||||
validator = use_id(SubDevice)
|
validator = use_id(Device)
|
||||||
return validator(value)
|
return validator(value)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -472,9 +472,8 @@ async def to_code(config):
|
|||||||
area_conf,
|
area_conf,
|
||||||
)
|
)
|
||||||
# Create a synthetic area for backwards compatibility
|
# Create a synthetic area for backwards compatibility
|
||||||
area_var = cg.new_Pvariable(
|
area_id_obj = cv.ID(f"area_{area_slug}")
|
||||||
cg.ID(f"area_{area_slug}", is_declaration=True, type=Area)
|
area_var = cg.new_Pvariable(area_id_obj, type_=Area)
|
||||||
)
|
|
||||||
area_id = fnv1a_32bit_hash(area_conf)
|
area_id = fnv1a_32bit_hash(area_conf)
|
||||||
area_name = area_conf
|
area_name = area_conf
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user