mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-04-09 09:03:40 +00:00
Added `suggested_unit_of_measurement=UnitOfTime.HOURS` to all 7 DURATION sensors to prevent HA from auto-selecting minutes as the display unit. Without this, HA would pick "min" for small values (e.g., 0.75 h) and then display large values as "1238 Min." instead of the intended "20 Std. 38 Min." Affected sensors: - trend_change_in_minutes - best_price_period_duration / peak_price_period_duration - best_price_remaining_minutes / peak_price_remaining_minutes - best_price_next_in_minutes / peak_price_next_in_minutes BREAKING CHANGE: Sensor state unit changes from minutes to hours for users whose entity registry stored "min" as the display unit (the previous default). Automations using the raw state value (e.g., `state < 60` for "less than 60 minutes") must be updated to use hours (e.g., `state < 1`). The state attributes `remaining_minutes` and `next_in_minutes` continue to provide integer minutes and are unaffected. Impact: Duration sensors now display dynamically as "X h Y min" (e.g., "1 h 15 min") instead of a large minutes value like "1238 Min.". Users who manually customized the unit in HA settings are not affected. |
||
|---|---|---|
| .. | ||
| attributes | ||
| calculators | ||
| __init__.py | ||
| chart_data.py | ||
| chart_metadata.py | ||
| core.py | ||
| definitions.py | ||
| helpers.py | ||
| types.py | ||
| value_getters.py | ||