Skip to content
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

Fix timeout issue on Roomba integration when adding a new device #129230

Merged
merged 6 commits into from
Oct 30, 2024

Conversation

AuroreVgn
Copy link
Contributor

Proposed change

Fix timeout issue on Roomba integration when adding a new device

const.py: DEFAULT_DELAY = 100 instead of DEFAULT_DELAY = 1
config_flow.py: continuous=True instead of continuous=False

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

DEFAULT_DELAY = 1 to DEFAULT_DELAY = 100 to fix timeout when adding a new device
continuous=False to continuous=True to fix timeout when adding a new device
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AuroreVgn

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft October 26, 2024 16:40
@home-assistant
Copy link

Hey there @pschmitt, @cyr-ius, @shenxn, @Orhideous, mind taking a look at this pull request as it has been labeled with an integration (roomba) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of roomba can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign roomba Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@jbouwh
Copy link
Contributor

jbouwh commented Oct 27, 2024

At a few spots in tests/components/roomba/test_config_flow.py:

user_input={CONF_CONTINUOUS: True, CONF_DELAY: 1},

and

assert result["data"] == {CONF_CONTINUOUS: True, CONF_DELAY: 1}
assert config_entry.options == {CONF_CONTINUOUS: True, CONF_DELAY: 1}

the CONF_DELAY value is asserted. This seems to have a relation with the changed const.

I suggest you import changed the DEFAULT_DELAY constant into test_config_flow.py and use this instead of the literal.

I guess this should fix the failing checks.

Change CONF_DELAY to match DEFAULT_DELAY (30 sec instead of 1)
@AuroreVgn
Copy link
Contributor Author

At a few spots in tests/components/roomba/test_config_flow.py:

user_input={CONF_CONTINUOUS: True, CONF_DELAY: 1},

and

assert result["data"] == {CONF_CONTINUOUS: True, CONF_DELAY: 1}
assert config_entry.options == {CONF_CONTINUOUS: True, CONF_DELAY: 1}

the CONF_DELAY value is asserted. This seems to have a relation with the changed const.

I suggest you import changed the DEFAULT_DELAY constant into test_config_flow.py and use this instead of the literal.

I guess this should fix the failing checks.

Done !

@jbouwh
Copy link
Contributor

jbouwh commented Oct 28, 2024

Thanks! Mark your PR ready if you are finished.

@jbouwh jbouwh added this to the 2024.11.0b0 milestone Oct 28, 2024
@@ -206,7 +206,7 @@ async def test_form_user_discovery_and_password_fetch(hass: HomeAssistant) -> No
assert result3["data"] == {
CONF_BLID: "BLID",
CONF_CONTINUOUS: True,
CONF_DELAY: 1,
CONF_DELAY: DEFAULT_DELAY,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to update the other occurrences and addd the import.

Do a git pull to make sure you include the applied suggestions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar to this process, could you please tell me how to do a git pull ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like you used git clone to clone a he HA core repository. But let me help to commit the changes for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can commit for me, do I need do to something ?

Copy link
Contributor Author

@AuroreVgn AuroreVgn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuous=False
DEFAULT_DELAY = 30
CONF_DELAY: 30,

@jbouwh jbouwh marked this pull request as ready for review October 30, 2024 17:38
@edenhaus edenhaus modified the milestones: 2024.11.0b0, 2024.11.0 Oct 30, 2024
Copy link
Contributor

@jbouwh jbouwh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice first contribution!
Thanks @AuroreVgn 👍

@jbouwh jbouwh merged commit 94f906b into home-assistant:dev Oct 30, 2024
28 checks passed
@AuroreVgn
Copy link
Contributor Author

Nice first contribution! Thanks @AuroreVgn 👍

Thanks for your help :-)

frickua pushed a commit to frickua/core that referenced this pull request Oct 31, 2024
…e-assistant#129230)

* Update const.py

DEFAULT_DELAY = 1 to DEFAULT_DELAY = 100 to fix timeout when adding a new device

* Update config_flow.py

continuous=False to continuous=True to fix timeout when adding a new device

* Update homeassistant/components/roomba/const.py

Co-authored-by: Jan Bouwhuis <[email protected]>

* Update test_config_flow.py

Change CONF_DELAY to match DEFAULT_DELAY (30 sec instead of 1)

* Update tests/components/roomba/test_config_flow.py

Co-authored-by: Jan Bouwhuis <[email protected]>

* Use constant for DEFAULT_DELAY in tests

---------

Co-authored-by: Jan Bouwhuis <[email protected]>
Co-authored-by: jbouwh <[email protected]>
marcelveldt pushed a commit that referenced this pull request Oct 31, 2024
…9230)

* Update const.py

DEFAULT_DELAY = 1 to DEFAULT_DELAY = 100 to fix timeout when adding a new device

* Update config_flow.py

continuous=False to continuous=True to fix timeout when adding a new device

* Update homeassistant/components/roomba/const.py

Co-authored-by: Jan Bouwhuis <[email protected]>

* Update test_config_flow.py

Change CONF_DELAY to match DEFAULT_DELAY (30 sec instead of 1)

* Update tests/components/roomba/test_config_flow.py

Co-authored-by: Jan Bouwhuis <[email protected]>

* Use constant for DEFAULT_DELAY in tests

---------

Co-authored-by: Jan Bouwhuis <[email protected]>
Co-authored-by: jbouwh <[email protected]>
bramkragten pushed a commit that referenced this pull request Oct 31, 2024
…9230)

* Update const.py

DEFAULT_DELAY = 1 to DEFAULT_DELAY = 100 to fix timeout when adding a new device

* Update config_flow.py

continuous=False to continuous=True to fix timeout when adding a new device

* Update homeassistant/components/roomba/const.py

Co-authored-by: Jan Bouwhuis <[email protected]>

* Update test_config_flow.py

Change CONF_DELAY to match DEFAULT_DELAY (30 sec instead of 1)

* Update tests/components/roomba/test_config_flow.py

Co-authored-by: Jan Bouwhuis <[email protected]>

* Use constant for DEFAULT_DELAY in tests

---------

Co-authored-by: Jan Bouwhuis <[email protected]>
Co-authored-by: jbouwh <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[roomba] fails to set up
4 participants