Normalization: implement instant_rate mode (rate integrated over time)

The instant_rate mode existed in the enum but had no normalizer, so normalizing a power/flow sensor threw NotSupportedException. InstantRateNormalizer integrates the rate over time (trapezoidal, attributed to each interval's end reading); a per-hour rate in the meter's unit yields the consumption unit (kW->kWh, L/h->L). Registered in the engine; meter editor shows a mode hint. +4 Core tests.

Claude-Session: https://claude.ai/code/session_01Kib2MniVFbD95fkgLgBBnB
This commit is contained in:
2026-07-17 11:05:01 +02:00
parent fe3d81b192
commit b3b8b92520
5 changed files with 144 additions and 1 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ public enum MeterMode
/// <summary>Source already reports increments. The value is the increment.</summary>
DirectDelta,
/// <summary>Power/flow sensor (schema-supported; worker deferred post-v1). Integrate rate over time.</summary>
/// <summary>Power/flow sensor. Consumption = rate integrated over time (trapezoidal).</summary>
InstantRate,
/// <summary>Computed from other meters via a user-defined expression.</summary>