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