Repository navigation
fix(fox): keep apps.yaml values for settings Fox's record never binds - #6518
Conversation
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>
…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
left a comment
There was a problem hiding this comment.
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.
…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
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_todayorbattery_discharge_today;battery_calibration,battery_size_power,battery_voltageorsoc_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.yamlsurvived. After #6517 it is deleted. This was found while designing the Solis conversion: Solis's record binds nosoc_max, which the Solis Cloud template sets by hand.Change
fallback_user_settings=FOX_FALLBACK_USER_SETTINGS. That is every per-inverter setting its record never binds, derived fromFOX_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.apps.yamlvalue (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 realFoxAPIwith two inverters through the realCoordinator. A per-inverterbattery_charge_todaylist survives, and a singleinverter_modevalue is kept as inverter 0's, and the checker stays quiet.test_accept_fox_keeps_hand_set_settings_it_does_not_bindandtest_fox_fallback_user_settings_cover_what_the_record_does_not_bindfailed first.test_replay_fallback_single_value_is_inverter_zerospins the coordinator's existing slot-0 rule the fix relies on, so it passes onmaintoo. The bindings, coordinator, Fox, GivTCP, GE Cloud and discovery tests pass, and so doesrun_pre_commit --checks-only.🤖 Generated with Claude Code