hass.tibber_prices/custom_components/tibber_prices/sensor
Julian Pawlowski d0b6ea0e1a
Some checks failed
Validate / HACS validation (push) Has been cancelled
Lint / Ruff (push) Has been cancelled
Validate / Hassfest validation (push) Has been cancelled
fix(sensors)!: fix DURATION sensors displaying in minutes instead of hours
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.
2026-04-08 08:01:16 +00:00
..
attributes feat(sensors): add trend_change_in_minutes countdown sensor 2026-04-07 13:44:22 +00:00
calculators feat(trend): add direction-group detection, noise floor, and confirmation hysteresis 2026-04-07 13:44:01 +00:00
__init__.py refactor(currency)!: rename major/minor to base/subunit currency terminology 2025-12-11 08:26:30 +00:00
chart_data.py feat(sensors): add chart_metadata sensor for lightweight chart configuration 2025-12-05 20:30:54 +00:00
chart_metadata.py fix: support main and subunit currency 2025-12-11 23:07:06 +00:00
core.py feat(sensors): add trend_change_in_minutes countdown sensor 2026-04-07 13:44:22 +00:00
definitions.py fix(sensors)!: fix DURATION sensors displaying in minutes instead of hours 2026-04-08 08:01:16 +00:00
helpers.py refactor(sensor): replace redundant pass-through lambdas with direct references 2026-04-06 14:28:51 +00:00
types.py feat(types): add TypedDict documentation and BaseCalculator helpers 2025-11-22 14:32:24 +00:00
value_getters.py feat(sensors): add trend_change_in_minutes countdown sensor 2026-04-07 13:44:22 +00:00