Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ WEBHOOK_TIMEOUT=10

# ===== ALERT THRESHOLDS =====
# Temperature thresholds in Celsius (set to empty to disable)
# Default: 15°C (59°F) min, 27°C (80.6°F) max
# Default: 15°C (59°F) min, 32°C (90°F) max
ALERT_TEMP_MIN_C=15.0
ALERT_TEMP_MAX_C=27.0
ALERT_TEMP_MAX_C=32.0

# Humidity thresholds in percentage (set to empty to disable)
# Default: 30% min, 70% max
ALERT_HUMIDITY_MIN=30.0
# Default: 20% min, 70% max
ALERT_HUMIDITY_MIN=20.0
ALERT_HUMIDITY_MAX=70.0

# ===== PERIODIC STATUS UPDATES =====
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ jobs:
exit 1
fi

# Validate CLOUDFLARED_TOKEN (required since we deploy with cloudflare profile)
if [ -z "${CLOUDFLARED_TOKEN}" ]; then
echo "Missing required secret: CLOUDFLARED_TOKEN"
exit 1
fi

# Create .env file with required configuration
echo "BEARER_TOKEN=${BEARER_TOKEN}" > .env

Expand All @@ -93,8 +99,8 @@ jobs:
# Production monitoring defaults (intentionally enabled for production,
# differs from local development defaults in .env.example)
echo "ALERT_TEMP_MIN_C=15.0" >> .env
echo "ALERT_TEMP_MAX_C=27.0" >> .env
echo "ALERT_HUMIDITY_MIN=30.0" >> .env
echo "ALERT_TEMP_MAX_C=32.0" >> .env
echo "ALERT_HUMIDITY_MIN=20.0" >> .env
echo "ALERT_HUMIDITY_MAX=70.0" >> .env
echo "STATUS_UPDATE_ENABLED=true" >> .env
echo "STATUS_UPDATE_INTERVAL=3600" >> .env
Expand All @@ -110,4 +116,4 @@ jobs:
run: mkdir -p logs

- name: Deploy with Docker Compose
run: docker compose -p temp-monitor up -d --build --remove-orphans
run: docker compose -p temp-monitor --profile cloudflare up -d --build --remove-orphans
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ All configuration is done via environment variables in `.env`. Copy `.env.exampl
| Variable | Default | Description |
|----------|---------|-------------|
| `ALERT_TEMP_MIN_C` | `15.0` | Low temperature alert (Celsius) |
| `ALERT_TEMP_MAX_C` | `27.0` | High temperature alert (Celsius) |
| `ALERT_HUMIDITY_MIN` | `30.0` | Low humidity alert (%) |
| `ALERT_TEMP_MAX_C` | `32.0` | High temperature alert (Celsius) |
| `ALERT_HUMIDITY_MIN` | `20.0` | Low humidity alert (%) |
| `ALERT_HUMIDITY_MAX` | `70.0` | High humidity alert (%) |

### Periodic Status Updates
Expand Down
4 changes: 2 additions & 2 deletions temp_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@

alert_thresholds = AlertThresholds(
temp_min_c=float(os.getenv('ALERT_TEMP_MIN_C', '15.0')) if os.getenv('ALERT_TEMP_MIN_C') else None,
temp_max_c=float(os.getenv('ALERT_TEMP_MAX_C', '27.0')) if os.getenv('ALERT_TEMP_MAX_C') else None,
humidity_min=float(os.getenv('ALERT_HUMIDITY_MIN', '30.0')) if os.getenv('ALERT_HUMIDITY_MIN') else None,
temp_max_c=float(os.getenv('ALERT_TEMP_MAX_C', '32.0')) if os.getenv('ALERT_TEMP_MAX_C') else None,
humidity_min=float(os.getenv('ALERT_HUMIDITY_MIN', '20.0')) if os.getenv('ALERT_HUMIDITY_MIN') else None,
humidity_max=float(os.getenv('ALERT_HUMIDITY_MAX', '70.0')) if os.getenv('ALERT_HUMIDITY_MAX') else None
)

Expand Down
Loading