Apply braking relative to active/next price block and expose metadata#190
Merged
JohanAlvedal merged 1 commit intocodex/01from Jan 20, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Motivation
brake_blocked_reasonfrom incorrectly reportingno_price_blockwhen we are in a pre-brake ramp for a next block.Description
resolve_active_and_next_blocksto determineactive_blockandnext_blockfrom a block or list of blocks and return a canonical block list.resolve_active_and_next_blocksinsidecompute_price_braketo pick theprimary_block(active_blockornext_block) and exposeactive_blockandnext_blockin the returned metadata while ensuringblocksincludes them for status reporting.price_brake["next_block"]and detect the pre-brake window sobrake_blocked_reasonis not set tono_price_blockduring pre-brake ramping.apply_rate_limit).Testing
pytest, which failed during collection with anImportError: cannot import name 'compute_block_window' from custom_components.pumpsteer.sensor.sensor', causing the test run to fail.Codex Task