# Environment Configuration for Chocolate Tempering Machine
# Copy this file to .env and adjust values for your environment

# Application Settings
TEMPERING_ENVIRONMENT=development
TEMPERING_DEBUG=true
TEMPERING_LOG_LEVEL=DEBUG
TEMPERING_APP_NAME=Chocolate Tempering Machine
TEMPERING_APP_VERSION=1.0.0

# Database Configuration
TEMPERING_DATABASE_URL=sqlite:///data/tempering_machine.db
# For PostgreSQL: postgresql+asyncpg://user:password@localhost:5432/tempering_machine
TEMPERING_DATABASE__ECHO=false
TEMPERING_DATABASE__POOL_SIZE=5
TEMPERING_DATABASE__MAX_OVERFLOW=10

# Serial/Modbus Hardware Configuration
TEMPERING_SERIAL__PORT=/dev/ttyUSB0
TEMPERING_SERIAL__BAUDRATE=9600
TEMPERING_SERIAL__TIMEOUT=2.0
TEMPERING_SERIAL__BYTESIZE=8
TEMPERING_SERIAL__PARITY=N
TEMPERING_SERIAL__STOPBITS=1
TEMPERING_SERIAL__MAX_RETRIES=3
TEMPERING_SERIAL__RETRY_DELAY=0.1

# Modbus Configuration
TEMPERING_MODBUS__SLAVE_ADDRESS=1
TEMPERING_MODBUS__READ_TIMEOUT=2.0
TEMPERING_MODBUS__WRITE_TIMEOUT=2.0
TEMPERING_MODBUS__MAX_READ_REGISTERS=125
TEMPERING_MODBUS__MAX_WRITE_REGISTERS=100
TEMPERING_MODBUS__CONNECTION_CHECK_INTERVAL=10.0

# Temperature Control Configuration
TEMPERING_TEMPERATURE__ABSOLUTE_MAX_TEMP=80.0
TEMPERING_TEMPERATURE__ABSOLUTE_MIN_TEMP=10.0
TEMPERING_TEMPERATURE__TANK_MAX_HEAT=60.0
TEMPERING_TEMPERATURE__PUMP_MAX_HEAT=55.0
TEMPERING_TEMPERATURE__PUMP_MIN_HEAT=25.0
TEMPERING_TEMPERATURE__TEMPERATURE_TOLERANCE=0.5
TEMPERING_TEMPERATURE__SENSOR_ACCURACY=0.1

# PID Control Defaults
TEMPERING_TEMPERATURE__DEFAULT_KP=1.0
TEMPERING_TEMPERATURE__DEFAULT_KI=0.1
TEMPERING_TEMPERATURE__DEFAULT_KD=0.01
TEMPERING_TEMPERATURE__DEFAULT_KL=100.0

# Safety Configuration
TEMPERING_SAFETY__GRID_VOLTAGE_NOMINAL=230.0
TEMPERING_SAFETY__GRID_VOLTAGE_TOLERANCE=0.1
TEMPERING_SAFETY__GRID_FREQUENCY_NOMINAL=50.0
TEMPERING_SAFETY__GRID_FREQUENCY_TOLERANCE=0.02
TEMPERING_SAFETY__MAX_NEUTRAL_CURRENT=16.0
TEMPERING_SAFETY__MAX_MOTOR1_CURRENT=10.0
TEMPERING_SAFETY__MAX_MOTOR2_CURRENT=10.0
TEMPERING_SAFETY__ERROR_CHECK_INTERVAL=1.0
TEMPERING_SAFETY__AUTO_RECOVERY_ATTEMPTS=3
TEMPERING_SAFETY__AUTO_RECOVERY_DELAY=5.0
TEMPERING_SAFETY__COMMUNICATION_TIMEOUT=3.0
TEMPERING_SAFETY__HEARTBEAT_INTERVAL=1.0

# Process Control Configuration
TEMPERING_PROCESS__HEATING_DELAY=60.0
TEMPERING_PROCESS__COOLING_DELAY=120.0
TEMPERING_PROCESS__POURING_DELAY=30.0
TEMPERING_PROCESS__PUMP_DELAY=10.0
TEMPERING_PROCESS__MIXER_DELAY=5.0
TEMPERING_PROCESS__PROCESS_CONTROL_INTERVAL=0.5
TEMPERING_PROCESS__TEMPERATURE_READ_INTERVAL=1.0
TEMPERING_PROCESS__STATUS_UPDATE_INTERVAL=2.0
TEMPERING_PROCESS__MIN_HEATING_GOAL=40.0
TEMPERING_PROCESS__MAX_HEATING_GOAL=60.0
TEMPERING_PROCESS__MIN_COOLING_GOAL=20.0
TEMPERING_PROCESS__MAX_COOLING_GOAL=40.0

# Redis Configuration (for message queuing)
TEMPERING_REDIS__HOST=localhost
TEMPERING_REDIS__PORT=6379
TEMPERING_REDIS__DB=0
TEMPERING_REDIS__PASSWORD=
TEMPERING_REDIS__SOCKET_TIMEOUT=5.0
TEMPERING_REDIS__CONNECTION_POOL_MAX_CONNECTIONS=10

# Web Service Configuration
TEMPERING_WEB__HOST=0.0.0.0
TEMPERING_WEB__PORT=8000
TEMPERING_WEB__WORKERS=1
TEMPERING_WEB__RELOAD=true
TEMPERING_WEB__ACCESS_LOG=true
TEMPERING_WEB__API_TITLE=Chocolate Tempering Machine API
TEMPERING_WEB__API_VERSION=1.0.0
TEMPERING_WEB__CORS_ORIGINS=["http://localhost:3000", "http://localhost:8080"]

# File Paths
TEMPERING_DATA_DIRECTORY=data
TEMPERING_LOG_DIRECTORY=logs
TEMPERING_CONFIG_DIRECTORY=config
TEMPERING_BACKUP_DIRECTORY=backups

# Development/Testing Settings
# Uncomment for development
# TEMPERING_WEB__RELOAD=true
# TEMPERING_DATABASE__ECHO=true

# Production Settings
# Uncomment for production
# TEMPERING_ENVIRONMENT=production
# TEMPERING_DEBUG=false
# TEMPERING_LOG_LEVEL=INFO
# TEMPERING_WEB__RELOAD=false
# TEMPERING_WEB__WORKERS=4