iot-logic/src/utils/config.py

39 lines
1.2 KiB
Python
Raw Normal View History

2020-08-19 00:44:04 +02:00
#!/usr/bin/env python3
import os
"""
Main Flask RESTful API
"""
__author__ = "@tormakris"
__copyright__ = "Copyright 2020, Birbnetes Team"
__module_name__ = "app"
__version__text__ = "1"
SENTRY_DSN = os.environ.get("SENTRY_DSN")
RELEASE_ID = os.environ.get("RELEASE_ID", "test")
2020-08-25 01:40:09 +02:00
RELEASEMODE = os.environ.get("RELEASEMODE", "dev")
DEVICE_ID = os.environ.get("DEVICE_ID", "devraspi")
2020-09-30 01:53:48 +02:00
TICK_INTERVAL = float(os.environ.get("TICK_INTERVAL", 0.4))
2020-09-30 03:35:20 +02:00
SAMPLE_LENGTH = float(os.environ.get("SAMPLE_LENGTH", 1))
2020-08-25 01:40:09 +02:00
2020-09-30 04:08:36 +02:00
ENEMY_SOUNDS = os.environ.get("ENEMY_SOUNDS", '/var/lib/birbnetes/enemy_sounds')
2020-09-30 04:56:17 +02:00
RECORD_DEVICE = os.environ.get("RECORD_DEVICE", 'default')
2020-09-30 04:08:36 +02:00
MQTT_HOSTNAME = os.getenv("GUARD_MQTT_HOSTNAME", "localhost")
MQTT_PORT = int(os.getenv("GUARD_MQTT_PORT", 1883))
MQTT_USERNAME = os.getenv("GUARD_MQTT_USERNAME", None)
MQTT_PASSWORD = os.getenv("GUARD_MQTT_PASSWORD", None)
2020-08-25 01:40:09 +02:00
2020-09-30 06:01:38 +02:00
SVM_MODEL_ID = os.environ.get("SVM_MODEL_ID")
2020-08-25 01:40:09 +02:00
2021-11-18 18:38:52 +01:00
API_URL = os.environ.get("API_URL", "http://localhost:8080")
REPORT_URL = os.environ.get("REPORT_URL", None)
REPORT_INTERVAL = float(os.environ.get("REPORT_INTERVAL", 15))
2021-11-18 21:51:50 +01:00
2021-11-30 19:53:25 +01:00
DISABLE_AI = os.environ.get("DISABLE_AI", 'no').lower() in ['yes', '1', 'true']
2021-11-19 02:18:58 +01:00
2021-11-30 19:59:57 +01:00
PLATFORM = os.environ.get("PLATFORM", "raspberry")