seems to work

This commit is contained in:
2025-11-17 11:36:19 +01:00
parent d0b5184270
commit aaee480e57
11 changed files with 790 additions and 17 deletions

View File

@@ -5,12 +5,17 @@
set -e # Exit on error
# Change to script directory
# Determine script directory (apps/homekit)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Navigate to workspace root (two levels up from apps/homekit)
WORKSPACE_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$WORKSPACE_ROOT"
echo "🏠 HomeKit Bridge Startup"
echo "========================="
echo " Working dir: $WORKSPACE_ROOT"
echo ""
# Virtual environment path
VENV_DIR="$SCRIPT_DIR/venv"
@@ -18,7 +23,19 @@ VENV_DIR="$SCRIPT_DIR/venv"
# Check if virtual environment exists
if [ ! -d "$VENV_DIR" ]; then
echo "📦 Virtual environment not found. Creating..."
python3 -m venv "$VENV_DIR"
# Try to use Python 3.12 or 3.13 (3.14 has compatibility issues with HAP-Python)
if command -v python3.13 &> /dev/null; then
PYTHON_CMD=python3.13
elif command -v python3.12 &> /dev/null; then
PYTHON_CMD=python3.12
elif command -v python3.11 &> /dev/null; then
PYTHON_CMD=python3.11
else
PYTHON_CMD=python3
echo "⚠️ Warning: Using default python3. HAP-Python may not work with Python 3.14+"
fi
echo " Using: $PYTHON_CMD"
$PYTHON_CMD -m venv "$VENV_DIR"
echo "✅ Virtual environment created at $VENV_DIR"
fi
@@ -29,7 +46,7 @@ source "$VENV_DIR/bin/activate"
# Install/update dependencies
echo "📥 Installing dependencies from requirements.txt..."
pip install --upgrade pip -q
pip install -r requirements.txt -q
pip install -r "$SCRIPT_DIR/requirements.txt" -q
echo "✅ Dependencies installed"
# Set environment variables (with defaults)
@@ -55,5 +72,5 @@ echo "🚀 Starting HomeKit Bridge..."
echo " (Press Ctrl+C to stop)"
echo ""
# Run the bridge using Python module syntax
# Run the bridge from workspace root with correct module path
python -m apps.homekit.main