Skip to content

Fix Roomba setup#34089

Closed
cyr-ius wants to merge 33 commits intohome-assistant:devfrom
cyr-ius:roomba_fix
Closed

Fix Roomba setup#34089
cyr-ius wants to merge 33 commits intohome-assistant:devfrom
cyr-ius:roomba_fix

Conversation

@cyr-ius
Copy link
Copy Markdown
Contributor

@cyr-ius cyr-ius commented Apr 12, 2020

Proposed change

Modification made following the merger of the PR #33302

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)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #33302
  • This PR is related to issue:
  • Link to documentation pull request:

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
  • The code has been formatted using Black (black --fast 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.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link
Copy Markdown

Hey there @pschmitt, @cyr-ius, mind taking a look at this pull request as its been labeled with a integration (roomba) you are listed as a codeowner for? Thanks!

@cyr-ius cyr-ius mentioned this pull request Apr 12, 2020
20 tasks
Comment thread homeassistant/components/roomba/__init__.py Outdated
Comment thread homeassistant/components/roomba/__init__.py Outdated
Comment thread homeassistant/components/roomba/__init__.py Outdated
Comment thread homeassistant/components/roomba/binary_sensor.py Outdated
Comment thread homeassistant/components/roomba/__init__.py Outdated
Comment thread homeassistant/components/roomba/__init__.py Outdated
Comment thread homeassistant/components/roomba/__init__.py Outdated
@MartinHjelmare MartinHjelmare self-assigned this Apr 19, 2020
@MartinHjelmare
Copy link
Copy Markdown
Member

There are merge conflicts.

Comment thread homeassistant/components/roomba/config_flow.py Outdated
@shenxn
Copy link
Copy Markdown
Contributor

shenxn commented Apr 30, 2020

According to #34867, there seems to be some problem in the config flow that need to be fixed.

  • "unknown" errors are not logged, so there is no way for the users to know what's going on and it'll be very difficult to locate the problem.
  • When there is an error in the user input, all fields will be cleared out and the user will have to input everything again.
  • When there is something wrong during the import, it'll ended up with a "discovered" card in the integration page.

@MartinHjelmare
Copy link
Copy Markdown
Member

Please rebase on latest dev branch and solve the merge conflict.

Copy link
Copy Markdown
Contributor

@shenxn shenxn left a comment

Choose a reason for hiding this comment

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

There are some new fixes merged. Please rebase on latest dev branch.


@property
def state(self):
def is_on(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is already fixed in #35443. Do a rebase and this will be no longer needed.

errors = {"base": "cannot_disconnect"}
except Exception as error: # pylint: disable=broad-except
_LOGGER.error("An unknown error occurred: %s", error)
errors = {"base": "unknown"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is fixed in #35005 so not needed as well.

await hass.async_add_executor_job(roomba.disconnect)
while roomba.roomba_connected:
await asyncio.sleep(1)
break
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the problem here is that you are using while loop and break in the first iteration. You should either use if statement if you just want to sleep for 1 second if it is still connected, or you can remove the break so the while loop will wait until it's disconnected, or you just remove the loop and it will wait for 1 second anyway. If I understand your comment correctly, you want to wait until disconnected and then wait for another second to make sure the reconnect works well. Then you'll need to delete the break statement and add another sleep outside the while loop.

@stale
Copy link
Copy Markdown

stale Bot commented Jun 10, 2020

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale Bot added the stale label Jun 10, 2020
@stale stale Bot closed this Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants