Skip to content

Add support for SwitchBot Lock#84673

Merged
bdraco merged 9 commits into
home-assistant:devfrom
dsypniewski:switchbot-lock
Dec 28, 2022
Merged

Add support for SwitchBot Lock#84673
bdraco merged 9 commits into
home-assistant:devfrom
dsypniewski:switchbot-lock

Conversation

@dsypniewski
Copy link
Copy Markdown
Contributor

@dsypniewski dsypniewski commented Dec 28, 2022

Proposed change

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
  • 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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hi dsypniewski

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
Copy Markdown
Contributor

Hey there @bdraco, @Danielhiversen, @RenierM26, @murtas, @Eloston, mind taking a look at this pull request as it has been labeled with an integration (switchbot) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of switchbot can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign switchbot Removes the current integration label and assignees on the issue, add the integration domain after the command.

Comment thread homeassistant/components/switchbot/config_flow.py Outdated
Comment thread homeassistant/components/switchbot/__init__.py
Comment thread homeassistant/components/switchbot/lock.py Outdated
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Dec 28, 2022

Config flows require 100% test coverage.

@home-assistant
Copy link
Copy Markdown
Contributor

Hi dsypniewski

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!

Comment thread homeassistant/components/switchbot/strings.json Outdated
Comment thread homeassistant/components/switchbot/translations/en.json Outdated
Comment thread homeassistant/components/switchbot/strings.json Outdated
Comment thread homeassistant/components/switchbot/config_flow.py Outdated
@home-assistant
Copy link
Copy Markdown
Contributor

Hi dsypniewski

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
Copy Markdown
Contributor

Hi dsypniewski

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!

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Dec 28, 2022

Since this is a significant contribution, we would appreciate you'd added yourself to the list of code owners for this integration. ❤️

Please, add your GitHub username to the manifest.json of this integration.

For more information about "code owners", see: Architecture Decision Record 0008: Code owners.

@bdraco bdraco added the noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) label Dec 28, 2022
Comment thread homeassistant/components/switchbot/config_flow.py
@bdraco bdraco added the smash Indicator this PR is close to finish for merging or closing label Dec 28, 2022
@dsypniewski
Copy link
Copy Markdown
Contributor Author

Relevant feature request: https://community.home-assistant.io/t/switchbot-lock/444425

@bdraco bdraco merged commit 599569b into home-assistant:dev Dec 28, 2022
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Dec 28, 2022

Thanks @dsypniewski

USER_INPUT,
)
await hass.async_block_till_done()
assert result["type"] == FlowResultType.FORM
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I missed this before I merged it, but we should finish all config flow tests till they reach and abort or create state to ensure the flow can recover from an error state

@dsypniewski dsypniewski mentioned this pull request Dec 28, 2022
19 tasks
@frenck
Copy link
Copy Markdown
Member

frenck commented Dec 28, 2022

Considering the documentation for this feature:

home-assistant/home-assistant.io#25421 (comment)

I would say that we need to revert this PR to get it out of our release path and make sure we make this user-friendly before re-adding it again.

/CC @bdraco @dsypniewski

@dsypniewski
Copy link
Copy Markdown
Contributor Author

I could update the config flow to give the user an option to provide the key as is now or directly provide authentication details and make it retrieve the key.
I should be able to make such changes rather quickly to make it in time for this release.

@dsypniewski
Copy link
Copy Markdown
Contributor Author

Here is how this could work: dsypniewski@738b977
This is not yet ready for PR but it's working.

@github-actions github-actions Bot locked and limited conversation to collaborators Dec 29, 2022
@home-assistant home-assistant unlocked this conversation Dec 29, 2022
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Dec 29, 2022

@dsypniewski I think that is a good solution. Your comment in dsypniewski@738b977#diff-90eaad85d101c1179240f5f702037e5673ad1ca380497f43a0238bbe62fc1374R350 is spot on that it needs to live in the library. Since you had already opened a PR while I was sleeping, I tested it the best I could (I don't actually get the lock I ordered until later tonight so I will test again when it comes in), cleaned up the lint issues and released pySwitchbot 0.34.0 this morning.

@github-actions github-actions Bot locked and limited conversation to collaborators Dec 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed integration: switchbot new-feature new-platform noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) Quality Scale: No score smash Indicator this PR is close to finish for merging or closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants