-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
SMA add DHCP discovery #135843
base: dev
Are you sure you want to change the base?
SMA add DHCP discovery #135843
Conversation
Hey there @kellerza, @rklomp, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
CONF_GROUP: GROUPS[0], | ||
CONF_PASSWORD: vol.UNDEFINED, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering why we have this _data
object in the first place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do your propose as an alternative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also missing the tests for exceptions during the DHCP setup
patch("pysma.SMA.new_session", return_value=True), | ||
patch("pysma.SMA.device_info", return_value=MOCK_DEVICE), | ||
patch("pysma.SMA.close_session", return_value=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please patch the library where we use it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the library. Unless you mean it needs to be patched via "homeassistant.components.sma.pysma"?
async def test_dhcp_already_configured(hass: HomeAssistant, mock_config_entry) -> None: | ||
"""Test starting a flow by dhcp when already configured.""" | ||
mock_config_entry.add_to_hass(hass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should already be able to abort when the DHCP flow starts, since we know the serial number and thus already can abort
Breaking change
Proposed change
SSIA, plus optimized the config flow to prevent redundant code.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: