feat: parallelize device shutdown with common _shutdown_devices function

- Curfew and budget exhaustion now use shared _shutdown_devices()
- All device turnoffs run in parallel via ThreadPoolExecutor
- Faster shutdown when multiple devices need to be turned off
This commit is contained in:
2026-06-17 22:23:18 +02:00
parent 2e47aa84f9
commit 4401b88726
2 changed files with 21 additions and 8 deletions

View File

@ -6,7 +6,7 @@
BUDGET_S = 3600 # default 60 min per device (in seconds)
TICK_INTERVAL = 10 # seconds between budget check cycles
ALLOWED_WEEKDAY = "7:00-23:30" # Mon-Fri allowed hours
ALLOWED_WEEKDAY = "7:00-20:30" # Mon-Fri allowed hours
ALLOWED_WEEKEND = "7:00-20:30" # Sat-Sun allowed hours
# ═══════════════════════════════════════════════════════════════════════