mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-30 05:13:40 +00:00
The gap tolerance algorithm now looks through small intermediate blocks to find the first LARGE block (> gap_tolerance) in each direction. This ensures small isolated rating intervals are merged into the correct dominant block, not just the nearest neighbor. Example: NORMAL(large) HIGH(1) NORMAL(1) HIGH(large) Before: HIGH at 05:45 merged into NORMAL (wrong - nearest neighbor) After: NORMAL at 06:00 merged into HIGH (correct - dominant block) Also collects all merge decisions BEFORE applying them, preventing order-dependent outcomes when multiple small blocks are adjacent. Impact: Rating transitions now appear at visually logical positions where prices actually change direction, not at arbitrary boundaries. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| average.py | ||
| price.py | ||