1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-12 23:03:46 +01:00
This commit is contained in:
J. Nick Koston
2025-10-09 15:50:30 -10:00
parent 420d227221
commit 1ae99b4f52
2 changed files with 17 additions and 10 deletions

View File

@@ -48,6 +48,10 @@ PACKAGE_DEPENDENCIES = {
# Add more package dependencies here as needed
}
# Bus types that can be defined directly in config files
# Components defining these directly cannot be grouped (they create unique bus IDs)
DIRECT_BUS_TYPES = ("i2c", "spi", "uart", "modbus")
# Base bus components - these ARE the bus implementations and should not
# be flagged as needing migration since they are the platform/base components
BASE_BUS_COMPONENTS = {
@@ -213,10 +217,10 @@ def analyze_yaml_file(yaml_file: Path) -> dict[str, Any]:
result["has_extend_remove"] = _contains_extend_or_remove(data)
# Check if buses are defined directly (not via packages)
# Components that define i2c, spi, or uart directly in test files
# Components that define i2c, spi, uart, or modbus directly in test files
# cannot be grouped because they create unique bus IDs
if isinstance(data, dict):
for bus_type in ("i2c", "spi", "uart"):
for bus_type in DIRECT_BUS_TYPES:
if bus_type in data:
result["has_direct_bus_config"] = True
break