Use final 15-min price for planner#149
Conversation
* Sync temp snapshot onto main * Fix CI analysis findings * Configure CodeFactor exclusions * Fix SonarCloud bugs and hotspots * Fix duplicate display in pricing overlay * Reduce CodeFactor findings * Fix CodeFactor issues * Address remaining CodeFactor issues * Fix remaining CodeFactor warnings * Add battery forecast helper modules * Move battery forecast HA sensor to module * Extract mode guard logic * Refactor charging plan helpers * Extract mode recommendation logic * Remove unused charging helper methods * Drop unused charging wrapper methods * Remove unused night target helper * Remove unused balancing helper block * Remove legacy forecast orchestrator * Remove unused timeline simulator * Remove unused forecast service * Remove unused forecast bridge and utils * Remove unused legacy files * Remove legacy battery forecast shim * Extract detail tab aggregation helpers * Extract unified cost tile helpers * Extract extended timeline builders * Extract plan storage helpers * Extract pricing and state helpers * Extract scenario analysis helpers * Extract interval grouping helpers * Split lifecycle and update helpers * Extract forecast sensor helpers * Extract forecast sensor setup * Split detail tab builders * Split hybrid strategy helpers * Split charging plan helpers * Split extended timeline summaries * Split unified cost tile helpers * Split plan storage helpers * Split spot price sensor modules * Remove legacy balancing module * Move balancing under battery_forecast * Move balancing helpers into package * Move plan storage into storage package * Move presentation helpers into package * Move battery forecast sensors into package * refactor(battery_forecast): group data and planning modules * refactor: split shield, config flow, and sensor runtime * Refactor modules and fix fixed pricing * Add local hassfest runner * Refactor forecast helpers and expand tests * Add coverage tests for timeline, shield, and sensors * test: expand planning and presentation coverage * test: expand coverage for helpers and storage * test: expand coverage for sensors, shield, and cost tile * test: expand shield core coverage * test: cover async_setup_entry cloud path * test: cover coordinator init branches * test: cover config distribution, options flow, api, profiles * test: cover config flow summary and yaml import * test: extend pricing flow and api balancing coverage * test: add wizard path and api error cases * test: cover solar forecast async_added_to_hass * test: close solar forecast async tasks * test: fix coordinator/shield setup and add services coverage * test: expand balancing manager coverage * test: cover shield queue, coordinator, setup entry * test: cover forecast update flow * test: cover precompute, detail blocks, ha sensor * test: cover init cleanup and mode tracker * test: cover balancing core and solar forecast sensor * test: cover shield validation paths * test: extend async_setup_entry coverage * test: cover coordinator spot price paths * test: cover config wizard steps and ha rest api views * test: add data source sensor coverage * test: expand coverage for stats, adaptive, data source, OTE * Improve coverage for coordinator, sensors, and analytics * Stub opentelemetry in tests * Reach 100% coverage for planner and storage * Expand coverage for planning and presentation * Increase coverage for history, CHMU, pricing, and OTE * Expand coverage for grid, recommended, and battery health sensors * Add test coverage for efficiency, OTE, recommended, and pricing * Improve test coverage for init and pricing sensors * Increase coordinator and data source coverage * Add tests to reach full coverage for core, API, sensors, services * Add coverage tests for adaptive profiles, notifications, config, and data sensor * Add HA REST API coverage tests * Add computed and statistics sensor coverage tests * Add analytics sensor coverage tests * Add pricing helper coverage tests * Add input helper coverage tests * Add solar forecast sensor coverage tests * Add coverage tests for shield, forecast, and config helpers * Add additional coverage tests for steps and sensors * Add coverage tests for config steps boiler and pricing migration * Add coverage tests for steps, sensors, unified cost helpers, and shield * Add battery forecast coverage tests * Expand coverage and stabilize tests * Add local checks and lock hashed requirements * Expand unit test coverage for sensors and helpers * Improve coverage for adaptive, shield, statistics, and solar sensors * Fix test isolation for box id resolution * Expand tests for config, telemetry, and physics helpers * Cover additional physics branches * Allow tracking config schema under custom_components * Achieve full unit test coverage * Add config module files * Improve planner guards and BE stability * Expand config flow runtime coverage * Fix balancing setup test for battery prediction flag * Add E2E test suite * Add solcast provider support and update security checks * Increase unit test coverage to 100% * Update coverage, sonar tooling, and tests * Finish coverage and remove duplicate blocks * Refactor solar wizard and forecast logic * Refine charging plan APIs and clean unused params * Refactor CHMU filtering helpers * Refactor setup helpers and logging * Fix setup helper return and balancing logging * Enable and implement E2E smoke tests * Refactor setup helpers and include E2E tests * Refactor detail tab block helpers * Refactor computed sensor helpers * Refactor data source helpers * Refactor analytics and statistics sensors * Refactor shield queue, dispatch, and timeline helpers * Refactor shield core, config steps, history, and pricing * Refactor balancing config, tariff validation, and summary helpers * Refactor detail tab, state attribute, and cost tile helpers * Fix tariff hour overlap validation * Refactor setup, coordinator, services, and sensors * Refactor OTE init helper * Refactor config flow option mapping * Refactor shield entity state matching * Refactor spot price fallback checks * Refactor computed sensor energy accumulation * Refactor statistics sensor restore helpers * Refactor HTML notification parsing * Refactor init helpers for Sonar cleanup * Fix device cleanup keep rules * Raise coverage to 100% and fix async warning * Fix async helper flagged by Sonar * Refactor service helpers and extend tests * Normalize logging in core modules * Refactor init and services smells * Fix coverage gaps and stabilize planners * Refactor sensors, queue, and API helpers * Refactor core planning and sensor helpers * Fix coverage gaps after refactor * Refactor sonar fixes * Fix refactor regressions and restore tests * Finalize coverage and isolate Sonar/E2E compose * Exclude FE tests from Sonar to silence baseline warning * Re-enable FE analysis in Sonar * Stabilize FE E2E and coverage checks * Stabilize E2E forecast updates and cookie handling * Add data-source fallback E2E and FE refresh test * Remove SonarQube artifacts from repo * Remove SonarQube files from repo * Fix CI deps, tighten API auth, and address review comments * Align dev deps with Python 3.12 CI * Regenerate dev requirements for Linux CI * Fix recommended sensor callbacks and coverage
* Fix dashboard API auth and static module path * Fix manifest version for hassfest
* Fix dashboard accessibility and reduce JS/CSS issues * Refactor flow particle updates * Fix shared dashboard state and helpers * Centralize flow cache invalidation * Refactor duplicated dialog and shield handlers * Refactor frontend helpers and address Sonar issues * Refactor pricing data loaders * Refactor flow and analytics helpers * Fix dashboard E2E flakiness and cover coordinator init * Clean up unused UI helpers * Resolve PR review comments
FE refactor
There was a problem hiding this comment.
Pull request overview
This PR introduces a fix to ensure the battery forecast planner uses the same final 15-minute price calculation as the spot price sensor, ensuring consistency between the planner timeline and spot price sensor readings. A changelog entry for version 2.1.4 has also been added.
Changes:
- Updated spot price calculation in the planner to match the spot price sensor's final 15-minute price logic
- Added changelog note documenting this fix in version 2.1.4
Reviewed changes
Copilot reviewed 67 out of 513 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Multiple new files in custom_components/oig_cloud/ |
New architecture introducing modularized battery forecast components (presentation, planning, physics, data layers) |
.stylelintrc.json |
New stylelint configuration file added |
| def _get_ssl_context() -> ssl.SSLContext: | ||
| global _SSL_CONTEXT | ||
| if _SSL_CONTEXT is None: | ||
| _SSL_CONTEXT = ssl.create_default_context(cafile=certifi.where()) |
Check failure
Code scanning / SonarCloud
Weak SSL/TLS protocols should not be used High
| if (!fs.existsSync(file)) { | ||
| return JSON.parse(fs.readFileSync(path.join(FIXTURES_DIR, `${DEFAULT_MODE}.json`), 'utf8')); | ||
| } | ||
| return JSON.parse(fs.readFileSync(file, 'utf8')); |
Check failure
Code scanning / SonarCloud
I/O function calls should not be vulnerable to path injection attacks High test
|




Summary\n- Use the same final 15-minute price calculation as the spot price sensor when building the planner spot timeline.\n- Add changelog note for 2.1.4.\n\n## Testing\n- Not run (planner logic change validated via HA timeline/spot sensor parity).