1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-13 23:33:48 +01:00
This commit is contained in:
J. Nick Koston
2025-10-08 15:11:16 -10:00
parent 9e9a19bfc2
commit 6eb3b3f903
3 changed files with 14 additions and 1 deletions

View File

@@ -1002,6 +1002,12 @@ def parse_args(argv):
action="append",
default=[],
)
options_parser.add_argument(
"--ignore-pin-conflicts",
help="Disable pin conflict validation (for testing grouped components)",
action="store_true",
default=False,
)
parser = argparse.ArgumentParser(
description=f"ESPHome {const.__version__}", parents=[options_parser]
@@ -1260,6 +1266,7 @@ def run_esphome(argv):
args = parse_args(argv)
CORE.dashboard = args.dashboard
CORE.ignore_pin_conflicts = args.ignore_pin_conflicts
# Create address cache from command-line arguments
CORE.address_cache = AddressCache.from_cli_args(

View File

@@ -529,6 +529,8 @@ class EsphomeCore:
self.dashboard = False
# True if command is run from vscode api
self.vscode = False
# True if pin conflict validation should be ignored
self.ignore_pin_conflicts = False
# The name of the node
self.name: str | None = None
# The friendly name of the node

View File

@@ -118,7 +118,11 @@ class PinRegistry(dict):
parent_config = fconf.get_config_for_path(parent_path)
final_val_fun(pin_config, parent_config)
allow_others = pin_config.get(CONF_ALLOW_OTHER_USES, False)
if count != 1 and not allow_others:
if (
count != 1
and not allow_others
and not CORE.ignore_pin_conflicts
):
raise cv.Invalid(
f"Pin {pin_config[CONF_NUMBER]} is used in multiple places"
)