8000 Add config flow for Waze Travel Time by raman325 · Pull Request #43419 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add config flow for Waze Travel Time #43419

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

Merged
merged 36 commits into from
Apr 5, 2021

Conversation

raman325
Copy link
Contributor
@raman325 raman325 commented Nov 20, 2020

Breaking Change

Config flow support has been added to waze_travel_time. Existing YAML configuration entries will be imported automatically but should be removed from YAML configuration after import. Import support will be removed in a future release.

Proposed change

Adds config flow support to waze_travel_time. The original platform setup strategy has been left around via config flow import to make the transition easier per @bachya 's recommendation below. The plan is to deprecate it then remove it in a future release.

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:

N/A

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.
  • 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:

@bachya
Copy link
Contributor
bachya commented Nov 20, 2020

My $0.02: I wouldn't add a config flow and remove YAML configuration in the same PR. I would split that work between 3 PRs:

  1. Add config flow (including an import step so that there's no breaking change)
  2. Deprecate the existing YAML configuration (scheduling removal for a few versions out, like 0.120.x)
  3. In that future version, fully remove YAML configuration

@raman325
Copy link
Contributor Author

I am happy to do that but it won't prevent a breaking change. In order to support config flow, this has to move to a top level config item.

@bachya
Copy link
Contributor
bachya commented Nov 21, 2020

You don't need to change the schema to support config entries. See how Tile does it (using the device_tracker key).

@raman325
Copy link
Contributor Author

ah this is clever, thanks!

Copy link
Member
@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

Please seem comments above.

Thanks 👍

< 8000 p class="text-center mt-3" data-hide-on-error>

@ctalkington
Copy link
Contributor

this will need a breaking change notice, even though it technically isn't breaking, as its used when creating release blog post.

@raman325
Copy link
Contributor Author
raman325 commented Dec 5, 2020

this will need a breaking change notice, even though it technically isn't breaking, as its used when creating release blog post.

Why is that? Doesn't seem like a pattern that is typically used. As an example, for DirectTV the breaking change notice was only posted after import configuration was removed

@MartinHjelmare
Copy link
Member

Our standard is to mark both the deprecation and the invalidation PR as breaking.

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Jan 26, 2021
@raman325 raman325 force-pushed the waze_config_flow 8000 branch from 00970a1 to f39de59 Compare January 26, 2021 21:29
@raman325
Copy link
Contributor Author

still valid

MartinHjelmare added a commit that referenced this pull request Mar 31, 2021
* add config flow support to google_travel_time

* fix bugs and add strings

* fix import and add new test

* address comments in #43419 since this is a similar PR

* fix default name and test

* add unique ID and device info

* fix test

* feedback from waze PR

* continue incorporating feedback from waze PR

* final fixes and update tests

* call update in lambda

* Update homeassistant/components/google_travel_time/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* additional fixes

* validate config entry data during config flow and config entry setup

* don't store entity

* patch dependency instead of HA code

* fixes

* improve tests by moving all patching to fixtures

* use self.hass instead of setting self._hass

* invert if

* remove unnecessary else

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
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.

Looks good!

@raman325 raman325 merged commit 5305d08 into home-assistant:dev Apr 5, 2021
@raman325 raman325 deleted the waze_config_flow branch April 5, 2021 23:25
@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2021
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.

6 participants
0