Skip to content

Conversation

@Muriel2Horak
Copy link
Collaborator

Summary\n- bump version to 2.1.6\n- normalize solar forecast timestamps and manual update behavior\n- stabilize hybrid planning target/balancing logic and service fallback\n- update tests for solcast + SSL context changes\n\n## Testing\n- ./venv/bin/python -m pytest -q --cov=custom_components/oig_cloud --cov-report=term-missing --cov-report=xml\n- npm test\n- npm run test:fe:e2e\n- ./venv/bin/python -m pylint custom_components/oig_cloud\n- sonar-scanner (fails: missing sonar.organization)

Muriel2Horak and others added 30 commits January 13, 2026 19:56
* 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
Copilot AI review requested due to automatic review settings January 20, 2026 07:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 67 out of 513 changed files in this pull request and generated 24 comments.

import inspect
import logging
from datetime import datetime, timedelta
from typing import Any, Dict, Optional, TYPE_CHECKING
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.

import logging
from datetime import date, datetime, timedelta
from typing import Any, Dict, List, Optional, Protocol
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.
from __future__ import annotations

import logging
from typing import Any, Dict, Optional
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.
import hashlib
import json
import logging
from typing import Any, Dict, List, Optional
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.

import copy
import logging
from typing import Any, Dict
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.

import logging
from datetime import datetime, timedelta
from typing import Any, Dict, Optional
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.
import logging
from datetime import datetime
from decimal import ROUND_HALF_UP, Decimal
from typing import Any, Dict, List, Optional
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.
from __future__ import annotations

import logging
from typing import Any, Dict
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.

import logging
from datetime import datetime
from typing import Any, Dict, Optional
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.
import asyncio
import logging
from datetime import datetime, timedelta
from typing import Any, Dict, Optional
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters and return values must use type annotations. The Any type is too generic and should be replaced with more specific types where possible.

Copilot generated this review using guidance from repository custom instructions.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
75 Security Hotspots
E Security Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE



def _create_ssl_context() -> ssl.SSLContext:
return ssl.create_default_context(cafile=certifi.where())

Check failure

Code scanning / SonarCloud

Weak SSL/TLS protocols should not be used High

Use a stronger protocol, or upgrade to Python 3.10+ which uses secure defaults. See more on SonarQube Cloud
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

Change this code to not construct the path from user-controlled data. See more on SonarQube Cloud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant