hass.tibber_prices/custom_components/tibber_prices/sensor/calculators
Julian Pawlowski a4ad506e01 feat(sensor): use dynamic precision for price rounding and display
Add get_display_precision() to const.py returning DISPLAY_PRECISION_SUBUNIT (2)
or DISPLAY_PRECISION_BASE (4) based on config. Replace hardcoded round(..., 2)
with get_display_precision() in all calculators and attribute builders.
Add _update_suggested_precision() to sensor core; syncs entity registry
suggested_display_precision on every coordinator update.

Interval price sensors get full precision (2 or 4 dp); other MONETARY sensors
get half precision (1 or 2 dp) as sensible default.

Impact: Price sensor states and attributes now correctly use 4 decimal places
in base-currency mode (was always 2). Display precision in dashboards updates
automatically when currency mode changes.
2026-04-14 19:28:19 +00:00
..
__init__.py feat(sensor): add data lifecycle diagnostic sensor with push updates 2025-11-20 15:12:41 +00:00
base.py refactor(price_info): price data handling to use unified interval retrieval 2025-11-24 10:49:34 +00:00
daily_stat.py feat(sensor): use dynamic precision for price rounding and display 2026-04-14 19:28:19 +00:00
interval.py feat(sensor): use dynamic precision for price rounding and display 2026-04-14 19:28:19 +00:00
lifecycle.py fix(sensor): streamline lifecycle attrs and next poll visibility 2025-12-26 12:13:36 +00:00
metadata.py feat(sensors): add day pattern detection sensors (valley/peak/flat/rising/falling) 2026-04-11 21:07:16 +00:00
rolling_hour.py refactor(sensor): replace redundant pass-through lambdas with direct references 2026-04-06 14:28:51 +00:00
timing.py fix(docs): correct inaccuracies and add missing documentation 2026-04-11 11:51:52 +00:00
trend.py feat(sensor): use dynamic precision for price rounding and display 2026-04-14 19:28:19 +00:00
volatility.py feat(sensor): use dynamic precision for price rounding and display 2026-04-14 19:28:19 +00:00
window_24h.py feat(sensor): use dynamic precision for price rounding and display 2026-04-14 19:28:19 +00:00