mirror of
https://github.com/esphome/esphome.git
synced 2025-10-13 15:23:49 +01:00
fix
This commit is contained in:
@@ -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(
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
)
|
||||
|
Reference in New Issue
Block a user