Added FEED_TYPE config

This commit is contained in:
Pünkösd Marcell 2021-12-11 00:19:07 +01:00
parent b665fd835d
commit e609411897
3 changed files with 7 additions and 2 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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")