diff --git a/esphome/core/config.py b/esphome/core/config.py index 53088c90a3..827f026820 100644 --- a/esphome/core/config.py +++ b/esphome/core/config.py @@ -209,9 +209,8 @@ def _supported_target_platforms(): continue if not (path / "__init__.py").is_file(): continue - name = path.name - if _is_target_platform(name): - target_platforms += [name] + if _is_target_platform(path.name): + target_platforms += [path.name] return target_platforms