diff --git a/src/app.py b/src/app.py index 7c5dc2a..1e6f737 100644 --- a/src/app.py +++ b/src/app.py @@ -99,7 +99,7 @@ def main() -> None: logging.basicConfig(stream=sys.stdout, format="%(asctime)s - %(name)s [%(levelname)s]: %(message)s", level=logging.DEBUG if '--debug' in sys.argv else logging.INFO) BirbnetesIoTPlatformStatusDriver.init() - listofabcsignaprocessors = [SoundSignalProcessor()] + listofabcsignaprocessors = [SoundSignalProcessor()] # <- figuring out of the url of filter/input service loopingtimer = LoopingTimer(function=timer_tick, tick_args=listofabcsignaprocessors, interval=config.TICK_INTERVAL) loopingtimer.start() diff --git a/src/sender/soundsender.py b/src/sender/soundsender.py index 178e391..66c97a6 100644 --- a/src/sender/soundsender.py +++ b/src/sender/soundsender.py @@ -39,7 +39,7 @@ class SoundSender(AbcSender): "application/json") } - r = requests.post(urljoin(config.API_URL, "/input"), files=files) + r = requests.post(urljoin(config.API_URL, config.FEED_TYPE), files=files) logging.debug(f"Content: {r.content.decode()}") logging.debug(f"Headers: {r.headers}") r.raise_for_status() diff --git a/src/utils/config.py b/src/utils/config.py index 0c29221..f385f81 100644 --- a/src/utils/config.py +++ b/src/utils/config.py @@ -36,3 +36,8 @@ REPORT_INTERVAL = float(os.environ.get("REPORT_INTERVAL", 15)) DISABLE_AI = os.environ.get("DISABLE_AI", 'no').lower() in ['yes', '1', 'true'] PLATFORM = os.environ.get("PLATFORM", "raspberry") + +FEED_TYPE = os.environ.get("FEED_TYPE", "input") # probably the worst naming the type of the accepting service. + +if FEED_TYPE not in ['input', 'filter']: + raise ValueError("FEED_TYPE must be either input or filter")