Skip to content

fix(fox): keep apps.yaml values for settings Fox's record never binds - #6518

Merged
springfall2008 merged 4 commits into
mainfrom
fix/fox-keeps-unbound-user-settings
Dec 4, 2026
Merged

springfall2008 merged 4 commits into
mainfrom
fix/fox-keeps-unbound-user-settings

Conversation

@springfall2008

@springfall2008 springfall2008 commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Since #6517, Fox Cloud (fox_automatic) configures through the discovery coordinator. At a discovered slot the coordinator clears every per-inverter setting the record does not bind, and Fox's record binds no:

  • battery_charge_today or battery_discharge_today;
  • battery_calibration, battery_size_power, battery_voltage or soc_kw;
  • inverter_mode;
  • charge_limit_enable, or the pause and idle settings.

Fox's old automatic configuration never touched those keys, so a value the user set in apps.yaml survived. After #6517 it is deleted. This was found while designing the Solis conversion: Solis's record binds no soc_max, which the Solis Cloud template sets by hand.

Change

  • Fox opts in with fallback_user_settings=FOX_FALLBACK_USER_SETTINGS. That is every per-inverter setting its record never binds, derived from FOX_RECORD_SETTINGS, and leaving out invert flags, site settings and summed settings. It is the option GivTCP already uses: the user's own value at that slot is kept instead of cleared.
  • No coordinator change: a single apps.yaml value (not a list) is inverter 0's, as Predbat reads it, so the per-slot fill keeps it at slot 0.

Tests

  • test_replay_fallback_single_value_is_inverter_zeros (bindings): a per-slot list is kept at each slot, and a single value at slot 0.
  • test_fox_fallback_user_settings_cover_what_the_record_does_not_bind: the set and the record never overlap, and the set covers the settings above.
  • test_accept_fox_keeps_hand_set_settings_it_does_not_bind: a real FoxAPI with two inverters through the real Coordinator. A per-inverter battery_charge_today list survives, and a single inverter_mode value is kept as inverter 0's, and the checker stays quiet.
  • test_accept_fox_keeps_hand_set_settings_it_does_not_bind and test_fox_fallback_user_settings_cover_what_the_record_does_not_bind failed first. test_replay_fallback_single_value_is_inverter_zeros pins the coordinator's existing slot-0 rule the fix relies on, so it passes on main too. The bindings, coordinator, Fox, GivTCP, GE Cloud and discovery tests pass, and so does run_pre_commit --checks-only.

🤖 Generated with Claude Code

On a Fox Cloud site configured through discovery (#6517), the coordinator cleared every per-inverter setting the
Fox record does not bind - battery_charge_today, battery_discharge_today, inverter_mode, battery_calibration and
others - where Fox's old automatic configuration never touched them. Fox now opts in with those settings as
fallback_user_settings, so the user's own value at a slot is kept, and the coordinator leaves a fallback setting
the user gives as one value, and no record binds, entirely alone, as the old configuration did for every inverter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the BOT_REVIEW Trigger an autotriage label Dec 4, 2026
…verter 0's

Drop the whole-key rule: Predbat reads a single value as inverter 0's (reading it for another inverter is warned as
incorrectly set up), so the per-slot fill keeping it at slot 0 is the right behaviour, with no special case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@springfall2008 springfall2008 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Automated comment from the triage bot.

Verdict: 🟡 Amber - Recommend addressing the feedback, then approval

Two small items: the Fox docs bullet omits that a single value is kept for slot 0 only, and one of the new tests is dead code that would also pass without this PR.

Reviewed at head 516b486 (which drops the earlier desired_args whole-key rule). The Fox fallback set itself checks out: FOX_RECORD_SETTINGS matches every unconditional key _discovery_entities() can return (only battery_temperature_history is conditional, and it is a site setting, excluded anyway), it equals what _legacy_bindings() did not bind, and every one of the derived fallback settings is read per inverter by get_arg(..., index=...), so keeping the user's value at a slot and leaving it unbound elsewhere cannot disturb a site-wide read. 2 findings inline, 0 in the body.

Comment thread apps/predbat/tests/test_bindings.py Resolved
Comment thread docs/components.md Resolved
CI and others added 2 commits December 4, 2026 20:45
…xisting behaviour; Fox docs give the single-value caveat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-user-settings

# Conflicts:
#	apps/predbat/tests/test_discovery_automatic.py
#	docs/discovery-catalogue.md
@springfall2008
springfall2008 enabled auto-merge (squash) December 4, 2026 21:02
@springfall2008
springfall2008 merged commit 534a781 into main Dec 4, 2026
5 checks passed
@springfall2008
springfall2008 deleted the fix/fox-keeps-unbound-user-settings branch December 4, 2026 21:02
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