hass.tibber_prices/custom_components/tibber_prices
WouterGithb db5d172fb8
fix(services): preserve service call data through coordinator data fetch (#151)
* fix(services): preserve service call data through coordinator data fetch

In `_handle_find_block` and `_handle_find_hours`, the local `data`
variable holding the resolved service call data was rebound to the
coordinator data dict returned by `get_entry_and_data()`. As a result,
the subsequent calls to `validate_search_params(data)`,
`apply_must_finish_by(data, ...)` and `resolve_search_range(...)` read
search-range parameters from coordinator data instead of from the
service call, silently ignoring:

- must_finish_by
- search_scope
- search_start, search_end
- search_start_time, search_end_time
- search_start_day_offset, search_end_day_offset
- search_start_offset_minutes, search_end_offset_minutes
- include_current_interval

The functions fell back to the default range ("now → end of tomorrow")
for every call that depended on these parameters.

Rename the third return value of `get_entry_and_data()` to
`coordinator_data` so the service call `data` survives, restoring
deadline and search-scope semantics. `find_cheapest_schedule.py`
already uses `data_dict` for the same purpose and was not affected.

Verified locally against v0.31.0: a call with
`must_finish_by: 2026-06-01T20:00:00+02:00` now correctly produces
`search_end: 2026-06-01T20:00:00+02:00` (was end-of-tomorrow before).

* refactor(services): update data handling in find_cheapest_schedule service

Refactor the data retrieval process to use coordinator data instead of entry data for improved clarity and consistency.

Impact: Enhances maintainability of the service code without altering user-facing functionality.

---------

Co-authored-by: “WouterK” <kwaken.geringd0w@icloud.com”git config --global user.name “WouterK”git config --global user.email kwaken.geringd0w@icloud.com”>
Co-authored-by: Julian Pawlowski <jpawlowski@users.noreply.github.com>
2026-06-01 12:45:10 +02:00
..
api fix(api): accept priceInfoRange-only responses and retry transient empty data 2026-05-30 14:46:13 +00:00
binary_sensor feat(coordinator): surface prolonged API outages and cache-fallback state 2026-05-30 14:46:32 +00:00
blueprints fix(blueprints): fix home_connect_alt service call and correct sensor description 2026-05-03 22:16:56 +00:00
brand feat(brand): update dark icons for improved visual consistency 2026-04-09 19:04:26 +00:00
config_flow_handlers refactor(repairs): simplify currency mode change notification to one-shot 2026-04-15 10:00:59 +00:00
coordinator feat(coordinator): surface prolonged API outages and cache-fallback state 2026-05-30 14:46:32 +00:00
custom_translations docs(sensor-reference): update translations for price phase sensors 2026-05-30 13:04:55 +00:00
entity_utils fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
interval_pool feat(services): isolate price-fetch failures and add success flag to responses 2026-05-30 14:46:23 +00:00
number fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
sensor feat(services): add price_source parameter to get_chartdata and get_apexcharts_yaml 2026-05-03 18:48:36 +00:00
services fix(services): preserve service call data through coordinator data fetch (#151) 2026-06-01 12:45:10 +02:00
switch fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
translations feat(coordinator): surface prolonged API outages and cache-fallback state 2026-05-30 14:46:32 +00:00
utils feat(services): add power-profile-weighted window selection 2026-05-03 22:16:08 +00:00
__init__.py chore(blueprints): disable automatic blueprint installation 2026-05-03 22:17:02 +00:00
config_flow.py fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
const.py feat(entity): expose integration version as sw_version in device info 2026-04-20 18:44:34 +00:00
data.py feat(interval-pool): add intelligent interval caching and memory optimization 2025-11-25 20:44:39 +00:00
diagnostics.py fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
entity.py feat(entity): expose integration version as sw_version in device info 2026-04-20 18:44:34 +00:00
icons.json feat(services): add plan_charging service for battery/EV scheduling 2026-04-20 21:43:41 +00:00
manifest.json chore(release): bump version to 0.32.0b1 2026-05-30 14:48:01 +00:00
migrations.py fix(services): use injected now in resolve_search_range day offset 2026-04-14 19:33:24 +00:00
services.yaml feat(services): add power-profile-weighted window selection 2026-05-03 22:16:08 +00:00