From 0e8299654a335a82fca83012873c695df3a60418 Mon Sep 17 00:00:00 2001 From: Doug Boulware Date: Sun, 21 Jan 2024 16:49:20 -0700 Subject: [PATCH] Remove load switches. --- scos_actions/hardware/utils.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/scos_actions/hardware/utils.py b/scos_actions/hardware/utils.py index 1bf0aa14..d9f6fbf2 100644 --- a/scos_actions/hardware/utils.py +++ b/scos_actions/hardware/utils.py @@ -166,24 +166,3 @@ def power_cycle_sigan(switches: Dict[str, WebRelay]): raise HardwareConfigurationException( "Call to power cycle sigan, but no power switch or power cycle states specified " ) - - -def load_switches(switch_dir: Path) -> dict: - logger.debug(f"Loading switches in {switch_dir}") - switch_dict = {} - try: - if switch_dir is not None and switch_dir.is_dir(): - for f in switch_dir.iterdir(): - file_path = f.resolve() - logger.debug(f"loading switch config {file_path}") - conf = utils.load_from_json(file_path) - try: - switch = ControlByWebWebRelay(conf) - logger.debug(f"Adding {switch.id}") - switch_dict[switch.id] = switch - logger.debug(f"Registering switch status for {switch.name}") - except ConfigurationException: - logger.error(f"Unable to configure switch defined in: {file_path}") - except Exception as ex: - logger.error(f"Unable to load switches {ex}") - return switch_dict