diff --git a/esphome/config_validation.py b/esphome/config_validation.py index 072b4d69d1..a3627efe7b 100644 --- a/esphome/config_validation.py +++ b/esphome/config_validation.py @@ -350,9 +350,9 @@ def icon(value): def sub_device_id(value): # 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) diff --git a/esphome/core/config.py b/esphome/core/config.py index 8374a3d3be..95419fee70 100644 --- a/esphome/core/config.py +++ b/esphome/core/config.py @@ -472,9 +472,8 @@ async def to_code(config): area_conf, ) # Create a synthetic area for backwards compatibility - area_var = cg.new_Pvariable( - cg.ID(f"area_{area_slug}", is_declaration=True, type=Area) - ) + area_id_obj = cv.ID(f"area_{area_slug}") + area_var = cg.new_Pvariable(area_id_obj, type_=Area) area_id = fnv1a_32bit_hash(area_conf) area_name = area_conf