You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
946 B
Python

"""
Configuration for Serial Bridge
"""
import os
from dotenv import load_dotenv
load_dotenv()
# COM Port Settings
COM_PORT = os.getenv('COM_PORT', 'COM1')
BAUD_RATE = int(os.getenv('BAUD_RATE', 9600))
TIMEOUT = int(os.getenv('TIMEOUT', 1))
READ_INTERVAL = float(os.getenv('READ_INTERVAL', 0.5)) # seconds
# Backend Server Settings
BACKEND_URL = os.getenv('BACKEND_URL', 'http://localhost:8000')
API_ENDPOINT = os.getenv('API_ENDPOINT', '/api/readings/')
REQUEST_TIMEOUT = int(os.getenv('REQUEST_TIMEOUT', 5))
# Application Settings
APP_NAME = 'ScalesApp Serial Bridge'
DEBUG = os.getenv('DEBUG', 'False') == 'True'
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO')
# System Tray Settings
SHOW_WINDOW_ON_START = os.getenv('SHOW_WINDOW_ON_START', 'False') == 'True'
AUTO_CONNECT = os.getenv('AUTO_CONNECT', 'True') == 'True'
# Retry Settings
MAX_RETRIES = int(os.getenv('MAX_RETRIES', 3))
RETRY_DELAY = int(os.getenv('RETRY_DELAY', 5)) # seconds