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

Add Plum Lightpad config flow #36802

Merged
merged 18 commits into from
Jun 24, 2020
Merged

Conversation

prystupa
Copy link
Contributor

Proposed change

This PR makes it possible for Plum Lightpad integration to be configured via config flow from UI and/or from existing configuration in configuration.yaml.
This PR also exposes Plum dimmers and glow rings as devices, so that they can be manipulated in automations.

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

Additional information

  • This PR fixes or closes issue: fixes #
  • 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

Hey there @ColinHarrington, mind taking a look at this pull request as its been labeled with a integration (plum_lightpad) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@MartinHjelmare MartinHjelmare changed the title add support for config flow for Plum Lightpad integration Add Plum Lightpad config flow Jun 14, 2020
Copy link
Contributor

@ColinHarrington ColinHarrington left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! Looks like the way you did this handles configuration.yaml and config flow.
I appreciate adding types where applicable.

I had a few things to address:

  • The cleanup function/shutdown hook
  • potential naming questions

homeassistant/components/plum_lightpad/config_flow.py Outdated Show resolved Hide resolved
prystupa and others added 6 commits June 23, 2020 07:41
use debug instead of info for logging

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
switch to use generated references instead of hard-coded strings

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
switch to use references instead of hard-coded string

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
removing translated title per suggestion

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
removing per suggestion

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Copy link
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

Looks great. Ok to merge when last comments addressed!

Copy link
Contributor

@ColinHarrington ColinHarrington left a comment

Choose a reason for hiding this comment

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

It's shaping up well. I have a few requested changes/clarifications.

I'd also like to confirm it's working with actual devices first before merging.

homeassistant/components/plum_lightpad/__init__.py Outdated Show resolved Hide resolved
prystupa and others added 2 commits June 23, 2020 14:25
use helper instead of custom code/message-id

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
@prystupa
Copy link
Contributor Author

It's shaping up well. I have a few requested changes/clarifications.

I'd also like to confirm it's working with actual devices first before merging.

Yes, I have tested this code with real devices at my home.

Copy link
Contributor

@ColinHarrington ColinHarrington left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you for going back and forth on the PR!

@balloob balloob merged commit e3b90ea into home-assistant:dev Jun 24, 2020
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Please address the comments in a new PR.

Tests were not added for the config flow in this PR. We require 100% coverage for the config flow module. Run the scaffold script to generate test example code.

@frenck
Copy link
Member

frenck commented Jun 24, 2020

The documentation for this PR is missing, or am I looking incorrect?

@prystupa
Copy link
Contributor Author

The documentation for this PR is missing, or am I looking incorrect?

Documentation update PR added: home-assistant/home-assistant.io#13869

@prystupa
Copy link
Contributor Author

The documentation for this PR is missing, or am I looking incorrect?

Documented here: home-assistant/home-assistant.io#13870

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.

6 participants