diff --git a/esphome/cpp_helpers.py b/esphome/cpp_helpers.py index cef7b31020..8d5440f591 100644 --- a/esphome/cpp_helpers.py +++ b/esphome/cpp_helpers.py @@ -112,8 +112,8 @@ async def setup_entity(var, config): if CONF_ENTITY_CATEGORY in config: add(var.set_entity_category(config[CONF_ENTITY_CATEGORY])) if CONF_DEVICE_ID in config: - device = await get_variable(config[CONF_DEVICE_ID]) - add(var.set_device_id(fnv1a_32bit_hash(str(device)))) + device_id: ID = config[CONF_DEVICE_ID] + add(var.set_device_id(fnv1a_32bit_hash(device_id.id))) def extract_registry_entry_config(