Smart thermostat for developers. Rooms are environments, temperature is load, HVAC is autoscaling, schedules are deploy windows.
  • JavaScript 100%
Find a file
2026-06-30 11:14:56 +00:00
node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 test: add e2e tests 2026-06-28 11:10:56 +00:00
src feat(#1): smart thermostat engine — zones, HVAC autoscaling, schedules, ASCII display 2026-06-15 21:07:35 +00:00
tests fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:14:53 +00:00
package.json feat(#1): smart thermostat engine — zones, HVAC autoscaling, schedules, ASCII display 2026-06-15 21:07:35 +00:00
README.md feat(#1): smart thermostat engine — zones, HVAC autoscaling, schedules, ASCII display 2026-06-15 21:07:35 +00:00

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