Octopus intelligent detection fix#4204
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Octopus “Intelligent” tariff detection so IOG-only tariff codes are treated as intelligent in both device updates and day/night rate window selection, and adds regression coverage for the previous false-negative.
Changes:
- Introduces a shared
OctopusAPI.is_intelligent_go_tariff()helper to classify INTELLI-* and IOG-* tariff codes. - Uses the helper in
async_update_intelligent_devices()andasync_get_day_night_rates()to avoid missing IOG-only tariffs. - Adds regression tests covering the helper and the
async_update_intelligent_devices()IOG-only case; bumps Predbat version.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/predbat/octopus.py | Adds and applies a shared intelligent/IOG tariff detection helper to fix IOG-only detection gaps. |
| apps/predbat/tests/test_octopus_day_night_rates.py | Adds targeted regression tests for the new helper and the IOG-only device-update path. |
| apps/predbat/predbat.py | Bumps THIS_VERSION to v8.44.6 for the release containing the fix. |
Comment on lines
+1220
to
+1228
| @staticmethod | ||
| def is_intelligent_go_tariff(tariff_code): | ||
| """ | ||
| Determine whether a tariff code is an Intelligent GO (IOG) tariff. | ||
| """ | ||
| if not tariff_code: | ||
| return False | ||
| else: | ||
| return ("INTELLI-" in tariff_code) or ("IOG-" in tariff_code) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.