hass.tibber_prices/custom_components/tibber_prices/entity_utils
Julian Pawlowski 0fd98554ae refactor(entity): switch description content based on extended_descriptions
Changed description attribute behavior from "add separate long_description
attribute" to "switch description content" when CONF_EXTENDED_DESCRIPTIONS
is enabled.

OLD: description always shown, long_description added as separate attribute
NEW: description content switches between short and long based on config

Implementation:
- Check extended_descriptions flag BEFORE loading translation
- Load "long_description" key if enabled, fallback to "description" if missing
- Assign loaded content to "description" attribute (same key always)
- usage_tips remains separate attribute (only when extended=true)
- Updated both sync (entities) and async (services) versions

Added PLR0912 noqa: Branch complexity justified by feature requirements
(extended check + fallback logic + position handling).

Impact: Users see more detailed descriptions when extended mode enabled,
without attribute clutter. Fallback ensures robustness if long_description
missing in translations.
2025-11-21 17:30:29 +00:00
..
__init__.py refactor(entity_utils): extract shared helpers from sensor platform 2025-11-18 20:07:17 +00:00
attributes.py refactor(entity): switch description content based on extended_descriptions 2025-11-21 17:30:29 +00:00
colors.py feat(sensors): add timing sensors for best_price and peak_price periods 2025-11-15 17:12:55 +00:00
helpers.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00
icons.py refactor(naming): complete class naming convention alignment 2025-11-20 11:22:53 +00:00