fix(output): show a car icon and "Hold for car" reason when discharge is held for a charging car - #5147
Open
chalfontchubby wants to merge 1 commit into
Open
fix(output): show a car icon and "Hold for car" reason when discharge is held for a charging car#5147chalfontchubby wants to merge 1 commit into
chalfontchubby wants to merge 1 commit into
Conversation
… is held for a charging car execute.py already labels the live status "Hold for car" when car_charging_from_battery is off and a car charging slot blocks battery discharge outside a charge window, but the plan table had no equivalent - the same held SoC rendered as a plain arrow with no indication of why. Adds a hold_for_car reason code (gated on the same condition) and swaps the state cell's arrow for a car icon in that case, so the plan explains itself at a glance and on hover/tap, the same way the existing sun glyph signals a PV-driven rise. Display only - the underlying hold behaviour was already correct. Fixes #5146 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Written by Claude, on behalf of @chalfontchubby.
Summary
execute.pyalready labels the live status "Hold for car" whencar_charging_from_batteryis off and a car charging slot blocks battery discharge outside a charge window (execute.py:594-629). The plan table had no equivalent - the same held SoC rendered as a plain trend arrow with no indication of why.hold_for_carreason code to the plan JSON, gated on the same conditionexecute.py/prediction.py:865already use (set_charge_windowon,car_charging_from_batteryoff, a car charging slot overlapping the row), so the plan's hover/tap explanation is consistent with the live status text.Fixes #5146, found while investigating #5122.
Test plan
test_plan_why_reason.py: a car-held Demand slot reads ashold_for_carand shows the car icon; the same slot withcar_charging_from_batteryon stays plaindemand_steady(negative case)./run_all --test plan_why_reasonpasses./run_all --quickpasses (all tests, 4 slow skipped)predbat_debug_20260917-210000.yaml) - all four slots matching his car charging schedule now show the icon; plan SoC/cost numbers unchanged