Skip to content

Display unit of elevation in met config flow#88283

Merged
emontnemery merged 3 commits into
home-assistant:devfrom
chrisx8:fix_84895_met_elevation_unit
Mar 28, 2023
Merged

Display unit of elevation in met config flow#88283
emontnemery merged 3 commits into
home-assistant:devfrom
chrisx8:fix_84895_met_elevation_unit

Conversation

@chrisx8
Copy link
Copy Markdown
Contributor

@chrisx8 chrisx8 commented Feb 17, 2023

Breaking change

The met integration now requires elevation to be set in meters, regardless of the unit system set in Home Assistant. This mirrors the behavior of Home Assistant Core, which requires elevation to be in meters regardless of the unit system.

This only affects users who:

  • set up the met integration manually via Settings (not set up automatically during onboarding), AND
  • Home Assistant's unit system is not set to metric

Please double-check that elevation in met is set correctly, using the integration's "Configure" dialog.

Met integration with "Configure" option

Proposed change

Require elevation in met to be in meters.

Display the unit of elevation (always meters) in met's config flow data entry dialog.

Met's config flow, with unit of elevation shown

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

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

Code owner commands

Code owners of met 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 met Removes the current integration label and assignees on the issue, add the integration domain after the command.

@chrisx8 chrisx8 force-pushed the fix_84895_met_elevation_unit branch from df23178 to ef32efb Compare February 17, 2023 18:22
Comment thread homeassistant/components/met/__init__.py Outdated
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant Bot marked this pull request as draft February 18, 2023 12:36
@chrisx8 chrisx8 force-pushed the fix_84895_met_elevation_unit branch from ef32efb to 2cd6318 Compare February 19, 2023 02:39
@chrisx8 chrisx8 marked this pull request as ready for review February 19, 2023 02:39
@home-assistant home-assistant Bot requested a review from frenck February 19, 2023 02:39
Copy link
Copy Markdown
Contributor

@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

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

LGTM based on the explanation from @chrisx8 👍

@frenck
Copy link
Copy Markdown
Member

frenck commented Feb 20, 2023

@emontnemery Sorry it isn't, it removes a conversion, thus breaking existing installations.

@emontnemery emontnemery self-requested a review February 20, 2023 12:50
frenck
frenck previously requested changes Feb 20, 2023
Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Left a comment above, this PR needs changes to prevent is being a breaking change for existing installations.

../Frenck

@home-assistant home-assistant Bot marked this pull request as draft February 20, 2023 12:52
@emontnemery
Copy link
Copy Markdown
Contributor

emontnemery commented Feb 20, 2023

@chrisx8 it's quite the mess you've uncovered here.

I think we need to do this in steps, where one step is one PR:

  1. Move the conversion of elevation from feet to meters so it only happens when the elevation is stored in the config entry: Only do unit conversion of met elevation when set in config entry  #88491
  2. Add an option flow to allow users to reconfigure the location, including the elevation: Add options flow for met #88525
  3. As a final step, implement the changes proposed in this PR together with a breaking change note asking users to double check the elevation: This PR

@chrisx8
Copy link
Copy Markdown
Contributor Author

chrisx8 commented Feb 22, 2023

Rebased and added a breaking change note about requiring elevation to be in meters

@chrisx8 chrisx8 marked this pull request as ready for review February 22, 2023 16:15
@home-assistant home-assistant Bot requested a review from frenck February 22, 2023 16:15
@chrisx8 chrisx8 force-pushed the fix_84895_met_elevation_unit branch from 9dced4c to 3ac9144 Compare February 22, 2023 16:18
Co-authored-by: lijake8 <lijake8@users.noreply.github.com>
Signed-off-by: Chris Xiao <30990835+chrisx8@users.noreply.github.com>
@chrisx8 chrisx8 force-pushed the fix_84895_met_elevation_unit branch from 3ac9144 to 56e7b93 Compare February 25, 2023 20:22
@chrisx8 chrisx8 force-pushed the fix_84895_met_elevation_unit branch from 56e7b93 to c7d0147 Compare February 25, 2023 20:22
@chrisx8 chrisx8 force-pushed the fix_84895_met_elevation_unit branch from c7d0147 to e7fb048 Compare February 25, 2023 20:23
@chrisx8
Copy link
Copy Markdown
Contributor Author

chrisx8 commented Mar 18, 2023

@emontnemery Any update here?

This PR requires elevation in met to be in meters, and it will display the unit of elevation (always meters) in met's config flow data entry dialog. I have also added a breaking change note for the unit change.

Copy link
Copy Markdown
Contributor

@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

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

Thanks a lot @chrisx8 for sorting out this mess 👍

@emontnemery emontnemery dismissed frenck’s stale review March 28, 2023 09:51

A breaking change note has been added, and the impact of the change is now minimal because only manually setup config entries are affected

@emontnemery emontnemery merged commit e617bfb into home-assistant:dev Mar 28, 2023
@chrisx8 chrisx8 deleted the fix_84895_met_elevation_unit branch March 28, 2023 13:59
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 29, 2023
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.

Met integration does not describe Units of Elevation (ft, m, etc)

4 participants