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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration flow to Whois #63069

Merged
merged 5 commits into from Dec 30, 2021
Merged

Add configuration flow to Whois #63069

merged 5 commits into from Dec 30, 2021

Conversation

frenck
Copy link
Member

@frenck frenck commented Dec 30, 2021

Breaking change

The Whois integration migrated to configuration via the UI. Configuring Whois via YAML configuration has been deprecated and will be removed in a future Home Assistant release.

Your existing YAML configuration is automatically imported on upgrade to this release; and thus can be safely removed from your YAML configuration after upgrading.

Proposed change

This PR implements the bare minimum configuration flow for the Whois integration, including import.

This PR is part of a bunch of PRs that I have ready for this integration. Others include:

  • Replacing the current library with a more modern (existing) one (that actually provides error checking and such)
  • Extend config flow/integration setup to take into account that a domain name can be free for registration (and thus does not have an expiration date)
  • Add entity descriptions
  • Add more entities
  • Some more deprecations (attributes and such)
  • Add full test coverage

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

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.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 馃 Silver
  • 馃 Gold
  • 馃弳 Platinum

To help with the load of incoming pull requests:

@project-bot project-bot bot added this to Needs review in Dev Dec 30, 2021
@project-bot project-bot bot moved this from Needs review to By Code Owner in Dev Dec 30, 2021
@frenck frenck marked this pull request as ready for review December 30, 2021 10:30
Copy link
Contributor

@davet2001 davet2001 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! I will use this! 馃榾

homeassistant/components/whois/config_flow.py Outdated Show resolved Hide resolved
frenck and others added 2 commits December 30, 2021 13:26
Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
@frenck frenck mentioned this pull request Dec 30, 2021
22 tasks
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_IMPORT},
data={CONF_NAME: config[CONF_NAME]},
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you not need to pass also the domain name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ouch, nicely spotted! 馃檹 thanks

Copy link
Member Author

@frenck frenck Dec 30, 2021

Choose a reason for hiding this comment

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

Added missing domain import in 90ada67

"""Initialize the sensor."""
self._attr_name = domain
Copy link
Contributor

Choose a reason for hiding this comment

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

You are probably planning to do it in a follow-up PR, but since you are dropping the name from the config entry, does it not make sense to add the unique_id to the entity directly in this PR to be able to rename it in the UI?

Copy link
Member Author

@frenck frenck Dec 30, 2021

Choose a reason for hiding this comment

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

Yeah, that is the idea :)
I wanted to move that into the PR that adds more sensors/sensor entity descriptions to ensure a stable unique ID from the get-go (for all sensors)

Dev automation moved this from By Code Owner to Reviewer approved Dec 30, 2021
@frenck frenck merged commit b5300fb into dev Dec 30, 2021
Dev automation moved this from Reviewer approved to Done Dec 30, 2021
@frenck frenck deleted the frenck-2021-3398 branch December 30, 2021 21:42
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2021
@frenck
Copy link
Member Author

frenck commented Jan 25, 2022

This PR wasn't labeled correctly, added the breaking change label.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants