Smart thermostat for developers. Rooms are environments, temperature is load, HVAC is autoscaling, schedules are deploy windows.
- JavaScript 100%
| node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 | ||
| src | ||
| tests | ||
| package.json | ||
| README.md | ||
code-thermostat
Smart thermostat for developers. Rooms are environments, temperature is load, HVAC is autoscaling, schedules are deploy windows.
Usage
const { Thermostat, ZONE_TYPES, SCHEDULE_TYPES } = require('./src/thermostat');
const thermo = new Thermostat('Smart Deploy Thermostat');
// Set occupancy (traffic)
thermo.setOccupancy('prod', 40);
// Override schedule
thermo.setOverride('night', 3); // Night mode for 3 hours
// Run a full day
thermo.advanceDay();
// Check energy
console.log(`Energy cost: $${thermo.energyCost}`);
console.log(thermo.displayView());
console.log(thermo.report());
Zones
- Dev Room — target 22C, tolerance 3C, capacity 5
- Staging Room — target 21C, tolerance 2C, capacity 10
- Production Room — target 20C, tolerance 1C, capacity 50
Schedules (Deploy Windows)
- Morning Warmup (6-10) — Warming caches before users arrive
- Peak Cooling (10-16) — Maximum load, keep cool
- Evening Setback (16-22) — Winding down
- Night Idle (22-6) — Minimum activity, save energy
Components
- Zone — Temperature/occupancy/HVAC mode, CPU/memory/latency sensors
- Schedule — Time-based overrides, deploy window management
- Thermostat — Multi-zone management, energy budget, ASCII display