-
-
Notifications
You must be signed in to change notification settings - Fork 38.6k
feat(solax-integration): Persist discovery result and lets the user be the tie breaker instead of asyncio scheduler #176275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
joostlek
merged 14 commits into
home-assistant:dev
from
kdehairy:feat/solax-integration-manual-inverter-select
Aug 11, 2026
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f165ab1
feat(solax-integration): Add Manual inverter model select
kdehairy 22c408f
test: fix asserting on passing the expected kwargs
kdehairy 8ed4a83
fix: loading inverters list once in const and use it
kdehairy 903f123
test(solax): increase test coverage
kdehairy 79ec971
fix(solax integration): Only attempt to load the needed inverter
kdehairy 587993f
feat(solax-integration): Limit model selection to only valid
kdehairy 0e90182
feat(solax integration): show model name in device info UI
kdehairy b652971
refactor: Better var name for its purpose
kdehairy b46a398
test(solax): assert on entity instead of coordinator internals
kdehairy 3c8ad82
test(solax): extract mock config entry into test fixture
kdehairy a8e5b26
chore: minor movement of tests among files
kdehairy 876f7d2
fix(solax): better handling of InverterError
kdehairy 8d9019c
test(solax): Increase test coverage
kdehairy df9c674
User message Improvement
kdehairy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,24 @@ | ||
| """Constants for the solax integration.""" | ||
|
|
||
| from importlib.metadata import EntryPoint, entry_points | ||
|
|
||
| from solax.inverter import Inverter | ||
|
|
||
| DOMAIN = "solax" | ||
|
|
||
| MANUFACTURER = "SolaX Power" | ||
|
|
||
| SOLAX_INVERTER_ENTRY_POINT_GROUP = "solax.inverter" | ||
|
|
||
| INVERTER_MODELS: dict[str, EntryPoint] = { | ||
| ep.name: ep for ep in entry_points(group=SOLAX_INVERTER_ENTRY_POINT_GROUP) | ||
| } | ||
|
kdehairy marked this conversation as resolved.
|
||
|
|
||
|
|
||
| def model_name_for_inverter(inverter: Inverter) -> str: | ||
| """Return the INVERTER_MODELS key matching a discovered inverter instance.""" | ||
| return next( | ||
| name | ||
| for name, entry_point in INVERTER_MODELS.items() | ||
| if isinstance(inverter, entry_point.load()) | ||
| ) | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| """Fixtures for the solax integration tests.""" | ||
|
|
||
| import pytest | ||
|
|
||
| from homeassistant.components.solax.const import DOMAIN | ||
| from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD, CONF_PORT | ||
|
|
||
| from tests.common import MockConfigEntry | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def mock_config_entry() -> MockConfigEntry: | ||
| """Return a mock solax config entry.""" | ||
| return MockConfigEntry( | ||
| domain=DOMAIN, | ||
| data={ | ||
| CONF_IP_ADDRESS: "192.168.1.87", | ||
| CONF_PORT: 80, | ||
| CONF_PASSWORD: "password", | ||
| }, | ||
| unique_id="ABCDEFGHIJ", | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.