mirror of
https://github.com/esphome/esphome.git
synced 2025-10-13 23:33:48 +01:00
fix
This commit is contained in:
@@ -1002,6 +1002,12 @@ def parse_args(argv):
|
|||||||
action="append",
|
action="append",
|
||||||
default=[],
|
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(
|
parser = argparse.ArgumentParser(
|
||||||
description=f"ESPHome {const.__version__}", parents=[options_parser]
|
description=f"ESPHome {const.__version__}", parents=[options_parser]
|
||||||
@@ -1260,6 +1266,7 @@ def run_esphome(argv):
|
|||||||
|
|
||||||
args = parse_args(argv)
|
args = parse_args(argv)
|
||||||
CORE.dashboard = args.dashboard
|
CORE.dashboard = args.dashboard
|
||||||
|
CORE.ignore_pin_conflicts = args.ignore_pin_conflicts
|
||||||
|
|
||||||
# Create address cache from command-line arguments
|
# Create address cache from command-line arguments
|
||||||
CORE.address_cache = AddressCache.from_cli_args(
|
CORE.address_cache = AddressCache.from_cli_args(
|
||||||
|
@@ -529,6 +529,8 @@ class EsphomeCore:
|
|||||||
self.dashboard = False
|
self.dashboard = False
|
||||||
# True if command is run from vscode api
|
# True if command is run from vscode api
|
||||||
self.vscode = False
|
self.vscode = False
|
||||||
|
# True if pin conflict validation should be ignored
|
||||||
|
self.ignore_pin_conflicts = False
|
||||||
# The name of the node
|
# The name of the node
|
||||||
self.name: str | None = None
|
self.name: str | None = None
|
||||||
# The friendly name of the node
|
# The friendly name of the node
|
||||||
|
@@ -118,7 +118,11 @@ class PinRegistry(dict):
|
|||||||
parent_config = fconf.get_config_for_path(parent_path)
|
parent_config = fconf.get_config_for_path(parent_path)
|
||||||
final_val_fun(pin_config, parent_config)
|
final_val_fun(pin_config, parent_config)
|
||||||
allow_others = pin_config.get(CONF_ALLOW_OTHER_USES, False)
|
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(
|
raise cv.Invalid(
|
||||||
f"Pin {pin_config[CONF_NUMBER]} is used in multiple places"
|
f"Pin {pin_config[CONF_NUMBER]} is used in multiple places"
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user