From 25ce95d7bbf57bed2136273b52f2f4ab1e2a336f Mon Sep 17 00:00:00 2001 From: Doug Boulware Date: Mon, 15 Jan 2024 16:36:57 -0700 Subject: [PATCH] Remove SENSOR_CALIBRATION_FILE And SIGAN_CALIBRATION_FILE --- scos_actions/actions/calibrate_y_factor.py | 1 - scos_actions/settings.py | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scos_actions/actions/calibrate_y_factor.py b/scos_actions/actions/calibrate_y_factor.py index 17b2f51d..839afc43 100644 --- a/scos_actions/actions/calibrate_y_factor.py +++ b/scos_actions/actions/calibrate_y_factor.py @@ -79,7 +79,6 @@ from scos_actions import utils from scos_actions.actions.interfaces.action import Action from scos_actions.hardware.sigan_iface import SIGAN_SETTINGS_KEYS -from scos_actions.settings import SENSOR_CALIBRATION_FILE from scos_actions.signal_processing.calibration import ( get_linear_enr, get_temperature, diff --git a/scos_actions/settings.py b/scos_actions/settings.py index a1a6e5cb..b81f9320 100644 --- a/scos_actions/settings.py +++ b/scos_actions/settings.py @@ -10,15 +10,13 @@ logger.debug("Initializing scos-actions settings") CONFIG_DIR = Path(__file__).parent.resolve() / "configs" logger.debug(f"scos-actions: CONFIG_DIR:{CONFIG_DIR}") -ACTION_DEFINITIONS_DIR = CONFIG_DIR / "actions" +ACTION_DEFINITIONS_DIR = Path(CONFIG_DIR / "actions") logger.debug(f"scos-actions: ACTION_DEFINITIONS_DIR:{ACTION_DEFINITIONS_DIR}") DEFAULT_CALIBRATION_FILE = path.join(CONFIG_DIR, "default_calibration.json") logger.debug(f"scos-actions: DEFAULT_CALIBRATION_FILE:{DEFAULT_CALIBRATION_FILE}") -SIGAN_CALIBRATION_FILE = env("SIGAN_CALIBRATION_FILE", None) -logger.debug(f"scos-actions: SIGAN_CALIBRATION_FILE:{SIGAN_CALIBRATION_FILE}") -SENSOR_CALIBRATION_FILE = env("SENSOR_CALIBRATION_FILE", None) -logger.debug(f"scos-actions: SENSOR_CALIBRATION_FILE:{SENSOR_CALIBRATION_FILE}") SWITCH_CONFIGS_DIR = env("SWITCH_CONFIGS_DIR", default=None) +if SWITCH_CONFIGS_DIR: + SWITCH_CONFIGS_DIR = Path(SWITCH_CONFIGS_DIR) logger.debug(f"scos-actions: SWITCH_CONFIGS_DIR:{SWITCH_CONFIGS_DIR}") SCOS_SENSOR_GIT_TAG = env("SCOS_SENSOR_GIT_TAG", default="unknown") logger.debug(f"scos-actions: SCOS_SENSOR_GIT_TAG:{SCOS_SENSOR_GIT_TAG}") @@ -27,6 +25,8 @@ RUNNING_TESTS = env.bool("RUNNING_TESTS", False) logger.debug(f"scos-actions: RUNNING_TESTS:{RUNNING_TESTS}") SENSOR_DEFINITION_FILE = env("SENSOR_DEFINITION_FILE", None) +if SENSOR_DEFINITION_FILE: + SENSOR_DEFINITION_FILE = Path(SENSOR_DEFINITION_FILE) logger.debug(f"scos-actions: RUNNING_TESTS:{RUNNING_TESTS}") FQDN = env("FQDN", None) logger.debug(f"scos-actions: FQDN:{FQDN}")