Repository navigation
Add per-device options, apply the app's charging minimums with per-device unlock options, add a Delta 2 charge pause switch - #475
Merged
Conversation
GnoX
force-pushed
the
add-device-advanced-options
branch
from
September 6, 2026 23:03
86c3cdb to
6220160
Compare
GnoX
marked this pull request as ready for review
September 6, 2026 23:05
2 tasks done
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.
This PR gives the AC charging speed and DC charging current controls the same minimums the EcoFlow app enforces, and adds a per-device advanced option for each so a user who wants to go lower still can. Until now those controls had no lower bound at all on most devices, which is how the 1 W AC charging trick came about: it stops the device drawing from the grid without unplugging it, and it is what solar-surplus automations have been using. The app's floors are per model rather than per family - it dispatches its AC charging range on the serial prefix, giving the Delta 3 and Delta 3 Plus 100 W where the rest of the pd335 family gets 200 W - so each device class declares its own value instead of inheriting one from a base that cannot know which model it ended up on. Because a floor would take the 1 W trick away from Delta 2 owners, this also adds the AC charging pause switch that does the job properly, reading
chg_pause_flag(Delta 2) /cfg_pause_flag(Delta 2 Max) and toggling only the trailing pause byte of the AC-charge-set command the speed control already uses.Full list of changes:
DeviceOptionandDeviceBase.ADVANCED_OPTIONSare the whole mechanism. A device class declares the options it offers, the integration passes the configured values in withwith_advanced_options(), and the device reads one back withadvanced_option(). Values live under adevice_optionskey in the entry options and are picked up on an options-flow save without a restart.option_field()turns a boolean option into a field. Option field reads as either value depending on the option, and declaring it also registers the option in the owner'sADVANCED_OPTIONS, so there is no second declaration to keep in sync.unlock_ac_charging_minimumandunlock_dc_charging_minimum, so a device only advertises the option for a control it actually has - Delta 2 and Delta Pro 3 offer the AC one alone. Both are unset by default, which means the app's minimum applies.AC Chargingswitch: on resumes charging, off pauses it, with the watt field of the command left unchanged so the configured speed survives a pause.max/minsuffix for consistency with the fields that already read that way. This is a rename of internal fields only - none of them back an entity - and it updates the deprecated number platform's string props and the existing device tests that reference them.This is a behavior change for anyone already writing a sub-minimum value: an automation that sets 1 W on a Delta 3 or River 3 will now land on the app minimum until the matching option is ticked. Delta 2 owners get the pause switch as the better replacement for that trick.
Resolves #421