hass.tibber_prices/custom_components/tibber_prices/services
Julian Pawlowski e01cc5d447 feat(services): allow entity IDs as service parameter values
Add entity_resolver module that lets all service parameters accept
HA entity references in place of literal values. The entity's current
state (or a specific attribute via the @attr syntax) is resolved at
call time and coerced to the expected Python type.

Syntax:
  "sensor.washing_duration"           → uses entity state
  "sensor.washing_duration@run_minutes" → uses entity attribute

Apply or_entity_ref() and resolve_entity_references() to all five
service handlers (get_price, find_cheapest_block, find_cheapest_hours,
find_cheapest_schedule, get_chartdata) for every parameter where a
dynamic value from another entity is useful (duration, start/end times,
offsets, etc.).

Add five new translation keys for entity-resolution error messages
(invalid_entity_reference, entity_not_found, entity_attribute_not_found,
entity_state_unavailable, entity_value_conversion_failed) across all
five language files.

Fix pytest warning filter to suppress AsyncMock cleanup noise, and
update test_resource_cleanup to mock hass.config_entries.async_entries
so the blueprint-removal path in async_remove_entry does not raise.

Impact: Automations and scripts can pass sensor entity IDs as service
parameters (e.g. duration from a sensor) instead of having to use
template-based workarounds.
2026-04-20 18:44:24 +00:00
..
__init__.py fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
debug_clear_tomorrow.py fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
entity_resolver.py feat(services): allow entity IDs as service parameter values 2026-04-20 18:44:24 +00:00
find_cheapest_block.py feat(services): allow entity IDs as service parameter values 2026-04-20 18:44:24 +00:00
find_cheapest_hours.py feat(services): allow entity IDs as service parameter values 2026-04-20 18:44:24 +00:00
find_cheapest_schedule.py feat(services): allow entity IDs as service parameter values 2026-04-20 18:44:24 +00:00
find_most_expensive_block.py feat(services): add 5 scheduling services for price-optimized time windows 2026-04-11 18:58:27 +00:00
find_most_expensive_hours.py feat(services): add 5 scheduling services for price-optimized time windows 2026-04-11 18:58:27 +00:00
formatters.py fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
get_apexcharts_yaml.py fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
get_chartdata.py feat(services): allow entity IDs as service parameter values 2026-04-20 18:44:24 +00:00
get_price.py feat(services): allow entity IDs as service parameter values 2026-04-20 18:44:24 +00:00
helpers.py feat(pricing): add relaxation logic for progressive filter loosening 2026-04-18 21:27:05 +00:00
refresh_user_data.py feat(services): add 5 scheduling services for price-optimized time windows 2026-04-11 18:58:27 +00:00
relaxation.py feat(pricing): add relaxation logic for progressive filter loosening 2026-04-18 21:27:05 +00:00