mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-05-28 18:43:40 +00:00
Remove unused functions, constants, and entity definitions that were left over from previous refactorings. All removed code was either superseded by better implementations or never actually called. Removed functions: - entity_utils/helpers.py: translate_level(), translate_rating_level() (HA handles ENUM translation automatically via translations/*.json) - entity_utils/attributes.py: build_timestamp_attribute(), build_period_attributes() (superseded by inline implementations) - sensor/helpers.py: get_hourly_price_value(), aggregate_window_data() (replaced by Calculator Pattern in sensor/calculators/) Removed constants and definitions: - const.py: CONF_CHART_DATA_CONFIG (DATA_CHART_CONFIG is the active one), PRICE_LEVEL_OPTIONS, PRICE_RATING_OPTIONS, VOLATILITY_OPTIONS, PRICE_TREND_OPTIONS (never imported; options defined inline in definitions.py due to HA import timing constraints), async_get_home_type_translation() (sync version used instead) - coordinator/core.py: FRESH_TO_CACHED_SECONDS (leftover from old caching strategy, never referenced) - switch/definitions.py: BEST_PRICE_SWITCH_ENTITIES (duplicate of BEST_PRICE_SWITCH_ENTITY_DESCRIPTIONS using base class instead of custom TibberPricesSwitchEntityDescription subclass) Cleanup: - entity_utils/__init__.py: Remove exports for deleted functions - sensor/helpers.py: Remove now-unused imports (timedelta, get_intervals_for_day_offsets, get_price_value, Callable) - entity_utils/helpers.py: Remove unused get_price_level_translation import after translate_level() removal - sensor/definitions.py: Update 7x "Keep in sync with *_OPTIONS" comments to reference individual PRICE_LEVEL_*/PRICE_RATING_*/ VOLATILITY_* constants instead Impact: No user-visible changes. Reduces codebase by ~130 lines. Improves maintainability by eliminating misleading dead code. |
||
|---|---|---|
| .. | ||
| api | ||
| binary_sensor | ||
| brand | ||
| config_flow_handlers | ||
| coordinator | ||
| custom_translations | ||
| entity_utils | ||
| interval_pool | ||
| number | ||
| sensor | ||
| services | ||
| switch | ||
| translations | ||
| utils | ||
| __init__.py | ||
| config_flow.py | ||
| const.py | ||
| data.py | ||
| diagnostics.py | ||
| entity.py | ||
| icons.json | ||
| manifest.json | ||
| migrations.py | ||
| services.yaml | ||