mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-04-09 09:03:40 +00:00
Refactored trend calculator with direction-group-based trend change detection (rising/strongly_rising treated as same group, falling/strongly_falling as same group). Added minimum absolute price change thresholds (noise floor) to prevent spurious trends at low price levels. Both percentage AND absolute conditions must now be met. Updated strongly threshold defaults from ±6% to ±9% (3x base for perceptual scaling). Added missing strongly thresholds and new config keys to get_default_options(). calculate_price_trend() now returns volatility_factor as 4th tuple element for threshold transparency. Added CONF_PRICE_TREND_CHANGE_CONFIRMATION (default: 3 intervals = 45min) and CONF_PRICE_TREND_MIN_PRICE_CHANGE / _STRONGLY with validation limits. Updated tests for new 4-tuple return value. Impact: More stable trend detection — fewer false trend changes during low-price periods. Direction-group logic prevents noise from "rising ↔ strongly_rising" oscillations. Users can fine-tune noise floor for their market. |
||
|---|---|---|
| .. | ||
| tibber_prices | ||