mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-05-28 18:43:40 +00:00
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. |
||
|---|---|---|
| .. | ||
| tibber_prices | ||