Test power spikes, calm wind and restart of the new model layers

A single 5-minute +700 W spike moves the room's thermal response by at
most 0.2 kW and leaves the baseline at the persistent load. In calm air
the wind terms vanish while natural ventilation remains. Extended and
ventilation coefficients and heat-source baselines survive a restart
unchanged (no hour of baseline re-learning), and enabling an extra
ventilation term later keeps everything learned for the others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
buzeraandClaude Opus 5.5 committed 2026-10-27 02:57:20 +02:00
1 parent b1577a0c78
commit e62798dc4f
3 files changed
+45

No files matched your search

+8
View File
@@ -93,6 +93,14 @@ class TrackerTests(unittest.TestCase):
self.assertEqual(tracker.zone_input('office'), states[-1]['ups']['response_kw'])
self.assertEqual(tracker.zone_input('living'), 0.0)
def test_short_spike_barely_moves_response_or_baseline(self):
tracker = hs.HeatSourceTracker(sources(UPS), {'baselines': {'ups': [200.0] * 24}})
states = run(tracker, [{'ups': 200.0}] * 3 + [{'ups': 900.0}] + [{'ups': 200.0}] * 4)
peak = max(s['ups']['response_kw'] for s in states)
self.assertAlmostEqual(peak, 0.7 * (1 - exp(-1 / 3))) # one 5-minute interval of +700 W
self.assertLess(peak, 0.2)
self.assertEqual(states[-1]['ups']['baseline_w'], 200)
def test_unknown_power_resets_until_settled_again(self):
tracker = hs.HeatSourceTracker(sources(UPS), {'baselines': {'ups': [200.0] * 24}})
run(tracker, [{'ups': 200.0}] * 7)