Skip to content

Commit

Permalink
Remove load switches.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboulware committed Jan 21, 2024
1 parent 46c9f61 commit 0e82996
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions scos_actions/hardware/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0e82996

Please sign in to comment.