Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 7 additions & 1 deletion .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 Down Expand Up @@ -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 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