hass.tibber_prices/custom_components/tibber_prices/sensor/attributes
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 next/previous/rolling-hour price rank sensors 2026-04-12 15:02:27 +00:00
daily_stat.py feat(sensor): use dynamic precision for price rounding and display 2026-04-14 19:28:19 +00:00
future.py feat(sensor): use dynamic precision for price rounding and display 2026-04-14 19:28:19 +00:00
helpers.py feat(sensors): always show both mean and median in average sensor attributes 2025-12-18 15:12:30 +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
timing.py fix(lint): apply Python 3.14 ruff rules and update HA minimum version 2026-04-11 10:56:34 +00:00
trend.py feat(sensors)!: rename trend change countdown sensor for naming consistency 2026-04-10 09:08:27 +00:00
volatility.py feat(sensor): add price rank sensors and IQR-based volatility attributes 2026-04-12 14:13:47 +00:00
window_24h.py feat(sensors)!: add configurable median/mean display for average sensors 2025-12-08 17:53:40 +00:00