Allow integration setup when no inverters are found, with inverter discovery retry if 0 inverters are found.#531
Open
Cerbrus wants to merge 7 commits intohultenvp:masterfrom
Open
Allow integration setup when no inverters are found, with inverter discovery retry if 0 inverters are found.#531Cerbrus wants to merge 7 commits intohultenvp:masterfrom
Cerbrus wants to merge 7 commits intohultenvp:masterfrom
Conversation
Previously, login() treated an empty inverter list as a login failure, blocking integration setup entirely. This separates API errors (which raise SoliscloudApiError) from a successful API response with zero inverters, allowing the config entry to be created. When no inverters are available, the service logs out and retries discovery on a configurable interval (refresh_inverter_discovery, default 300s) until inverters appear. Also fixes the Secret/Key ID config fields showing "00" as a default value by using None instead of empty string. Fixes hultenvp#530
Previously, all fields in the credentials step were reset to their defaults when a validation error occurred, forcing the user to re-enter everything. Now the form is re-populated with the previously submitted values.
…s value was entered.
If no inverters are found, the integration falls back to the Station ID for the name, but we can load station details
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.
Summary
login()/fetch_inverter_list(), so valid credentials with 0 inverters no longer show a misleading "Cannot login" errorrefresh_inverter_discoveryinterval (default 300s) that retries inverter discovery when the list is emptyBonus fixes
_plant_nameattribute onSoliscloudAPI(not initialized in__init__)Details
fetch_inverter_list()now raisesSoliscloudApiErroron API failures, and returns an empty dict on success with no recordslogin()catchesSoliscloudApiError→ returnsFalse(auth error), empty dict → returnsTrue(success, no inverters)login()fetches the station name via_get_station_details()async_update()detects an empty inverter list, logs out, and schedules a retry after the configured discovery intervalCONF_REFRESH_INVERTER_DISCOVERYconfig option added to both setup and options flowsuser_inputvalues when re-displaying after an errorTest plan
I've tested the checked items manually. The unchecked items require a working inverter/datalogger connection to verify, which I don't currently have. The installer hasn't fixed my setup, yet (that's the situation that prompted this fix).