hass.tibber_prices/custom_components/tibber_prices
Julian Pawlowski 5fc1f4db33 feat(sensors): add 5-level price trend scale with configurable thresholds
Extends trend sensors from 3-level (rising/stable/falling) to 5-level scale
(strongly_rising/rising/stable/falling/strongly_falling) for finer granularity.

Changes:
- Add PRICE_TREND_MAPPING with integer values (-2, -1, 0, +1, +2) matching
  PRICE_LEVEL_MAPPING pattern for consistent automation comparisons
- Add configurable thresholds for strongly_rising (default: 6%) and
  strongly_falling (default: -6%) independent from base thresholds
- Update calculate_price_trend() to return 3-tuple: (trend_state, diff_pct, trend_value)
- Add trend_value attribute to all trend sensors for numeric comparisons
- Update sensor entity descriptions with 5-level options
- Add validation with cross-checks (strongly_rising > rising, etc.)
- Update icons: chevron-double-up/down for strong trends, trending-up/down for normal

Files changed:
- const.py: PRICE_TREND_* constants, PRICE_TREND_MAPPING, config constants
- utils/price.py: Extended calculate_price_trend() signature and return value
- sensor/calculators/trend.py: Pass new thresholds, handle 3-tuple return
- sensor/definitions.py: 5-level options for all 9 trend sensors
- sensor/core.py: 5-level icon mapping
- entity_utils/icons.py: 5-level trend icons
- config_flow_handlers/: validators, schemas, options_flow for new settings
- translations/*.json: Labels and error messages (en, de, nb, sv, nl)
- tests/test_percentage_calculations.py: Updated for 3-tuple return

Impact: Users get more nuanced trend information for automation decisions.
New trend_value attribute enables numeric comparisons (e.g., > 0 for any rise).
Existing automations using "rising"/"falling"/"stable" continue to work.
2026-01-20 13:36:01 +00:00
..
api fix(api): handle None values in API responses to prevent AttributeError 2025-12-13 14:02:30 +00:00
binary_sensor fix(volatility): expose price coefficient variation attribute 2025-12-25 19:10:42 +00:00
config_flow_handlers feat(sensors): add 5-level price trend scale with configurable thresholds 2026-01-20 13:36:01 +00:00
coordinator fix(validation): enhance user data validation to require active subscription and price info. 2026-01-20 12:33:45 +00:00
custom_translations feat(sensor): convert timing sensors to hour-based display with minute attributes 2025-12-26 16:03:00 +00:00
entity_utils feat(sensors): add 5-level price trend scale with configurable thresholds 2026-01-20 13:36:01 +00:00
interval_pool fix(coordinator): track API calls separately from cached data usage 2025-12-25 18:53:29 +00:00
sensor feat(sensors): add 5-level price trend scale with configurable thresholds 2026-01-20 13:36:01 +00:00
services feat(services): add peak price overlay toggle to ApexCharts YAML 2025-12-26 00:07:28 +00:00
translations feat(sensors): add 5-level price trend scale with configurable thresholds 2026-01-20 13:36:01 +00:00
utils feat(sensors): add 5-level price trend scale with configurable thresholds 2026-01-20 13:36:01 +00:00
__init__.py refactor(interval_pool): improve reliability and test coverage 2025-12-23 10:10:35 +00:00
config_flow.py feat(config_flow): add price level gap tolerance for Tibber API level field 2025-12-22 20:25:30 +00:00
const.py feat(sensors): add 5-level price trend scale with configurable thresholds 2026-01-20 13:36:01 +00:00
data.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00
diagnostics.py refactor(lifecycle): integrate with Pool for sensor metrics 2025-12-23 14:13:34 +00:00
entity.py fix(api): handle None values in API responses to prevent AttributeError 2025-12-13 14:02:30 +00:00
icons.json feat(services): add new services and icons for enhanced functionality and user experience 2025-12-02 18:46:15 +00:00
manifest.json chore(release): bump version to 0.26.0 2026-01-20 12:40:37 +00:00
services.yaml feat(services): add peak price overlay toggle to ApexCharts YAML 2025-12-26 00:07:28 +00:00